2013-07-31 16:00:57 +02:00
|
|
|
{stdenv, stdenv_32bit, fetchurl, unzip}:
|
2012-11-07 21:10:39 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2013-07-31 16:00:57 +02:00
|
|
|
name = "android-platform-tools-r18.0.1";
|
2012-11-07 21:10:39 +01:00
|
|
|
src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
|
|
|
|
then fetchurl {
|
2013-07-31 16:00:57 +02:00
|
|
|
url = https://dl-ssl.google.com/android/repository/platform-tools_r18.0.1-linux.zip;
|
|
|
|
sha1 = "cf9bdbbaa34da37b59724f914dad907c2c74a387";
|
2012-11-07 21:10:39 +01:00
|
|
|
}
|
|
|
|
else if stdenv.system == "x86_64-darwin" then fetchurl {
|
2013-07-31 16:00:57 +02:00
|
|
|
url = https://dl-ssl.google.com/android/repository/platform-tools_r18.0.1-macosx.zip;
|
2013-07-31 16:14:47 +02:00
|
|
|
sha1 = "126325cbb55928c38acbb9c7bb5d9145d94fad56";
|
2012-11-07 21:10:39 +01:00
|
|
|
}
|
|
|
|
else throw "System ${stdenv.system} not supported!";
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cd $out
|
|
|
|
unzip $src
|
|
|
|
cd platform-tools
|
|
|
|
|
|
|
|
${stdenv.lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
|
|
|
|
''
|
2013-07-31 16:00:57 +02:00
|
|
|
for i in adb fastboot
|
2012-11-07 21:10:39 +01:00
|
|
|
do
|
|
|
|
patchelf --set-interpreter ${stdenv_32bit.gcc.libc}/lib/ld-linux.so.2 $i
|
2013-07-31 16:00:57 +02:00
|
|
|
patchelf --set-rpath ${stdenv_32bit.gcc.gcc}/lib $i
|
2012-11-07 21:10:39 +01:00
|
|
|
done
|
|
|
|
''}
|
|
|
|
'';
|
|
|
|
|
2012-11-08 16:49:36 +01:00
|
|
|
buildInputs = [ unzip ];
|
2012-11-07 21:10:39 +01:00
|
|
|
}
|