2014-11-10 22:54:44 +00:00
|
|
|
{ stdenv, fetchurl, zlib, ncurses, p7zip
|
2014-04-20 10:29:10 +01:00
|
|
|
}:
|
|
|
|
|
2014-11-24 07:57:18 +00:00
|
|
|
assert stdenv.isLinux;
|
|
|
|
|
2014-04-20 10:29:10 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2014-11-10 22:54:44 +00:00
|
|
|
name = "android-ndk-r10c";
|
2014-04-20 10:29:10 +01:00
|
|
|
|
|
|
|
src = if stdenv.system == "i686-linux"
|
|
|
|
then fetchurl {
|
2014-11-10 22:54:44 +00:00
|
|
|
url = "http://dl.google.com/android/ndk/${name}-linux-x86.bin";
|
|
|
|
sha256 = "0gyq68zrpzj3gkh81czs6r0jmikg5rwzh1bqg4rk16g2nxm4lll3";
|
2014-04-20 10:29:10 +01:00
|
|
|
}
|
|
|
|
else if stdenv.system == "x86_64-linux" then fetchurl {
|
2014-11-10 22:54:44 +00:00
|
|
|
url = "http://dl.google.com/android/ndk/${name}-linux-x86_64.bin";
|
|
|
|
sha256 = "126rqzkmf8xz1hqdziwx81yln17hpivs2j45rxhzdr45iw9b758c";
|
2014-04-20 10:29:10 +01:00
|
|
|
}
|
2014-11-10 22:54:44 +00:00
|
|
|
else throw "platform ${stdenv.system} not supported!";
|
2014-04-20 10:29:10 +01:00
|
|
|
|
|
|
|
phases = "installPhase";
|
|
|
|
|
2014-11-10 22:54:44 +00:00
|
|
|
buildInputs = [ p7zip ];
|
|
|
|
|
2014-04-20 10:29:10 +01:00
|
|
|
installPhase = ''
|
|
|
|
set -x
|
|
|
|
mkdir -pv $out
|
2014-11-10 22:54:44 +00:00
|
|
|
7z x $src
|
2014-04-20 10:29:10 +01:00
|
|
|
mv */* $out
|
2014-09-25 10:59:16 +01:00
|
|
|
|
|
|
|
# so that it doesn't fail because of read-only permissions set
|
|
|
|
patch -p1 -d $out < ${ ./make-standalone-toolchain.patch }
|
|
|
|
|
2014-04-20 10:29:10 +01:00
|
|
|
find $out \( \
|
|
|
|
\( -type f -a -name "*.so*" \) -o \
|
|
|
|
\( -type f -a -perm +0100 \) \
|
|
|
|
\) -exec patchelf --set-interpreter ${stdenv.gcc.libc}/lib/ld-*so.? \
|
|
|
|
--set-rpath ${zlib}/lib:${ncurses}/lib {} \;
|
|
|
|
'';
|
|
|
|
}
|