2013-07-31 15:00:57 +01:00
|
|
|
{stdenv, stdenv_32bit, fetchurl, unzip}:
|
2012-11-07 20:10:39 +00:00
|
|
|
|
2014-12-16 07:22:55 +00:00
|
|
|
let
|
|
|
|
version = "21";
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2012-11-07 20:10:39 +00:00
|
|
|
stdenv.mkDerivation {
|
2014-12-16 07:22:55 +00:00
|
|
|
name = "android-platform-tools-r${version}";
|
2012-11-07 20:10:39 +00:00
|
|
|
src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
|
|
|
|
then fetchurl {
|
2014-12-16 07:22:55 +00:00
|
|
|
url = "https://dl-ssl.google.com/android/repository/platform-tools_r${version}-linux.zip";
|
|
|
|
sha256 = "35a1762b355451e000a816d97d9af640ca99ae6c5b5b406a3e680210af8106ad";
|
2012-11-07 20:10:39 +00:00
|
|
|
}
|
|
|
|
else if stdenv.system == "x86_64-darwin" then fetchurl {
|
2014-12-16 07:22:55 +00:00
|
|
|
url = "https://dl-ssl.google.com/android/repository/platform-tools_r${version}-macosx.zip";
|
|
|
|
sha256 = "30ae8724da3db772a776d616b4746516f24ae81330e84315a7ce0c49e0b0b3cb";
|
2012-11-07 20:10:39 +00:00
|
|
|
}
|
|
|
|
else throw "System ${stdenv.system} not supported!";
|
2014-12-16 07:22:55 +00:00
|
|
|
|
2012-11-07 20:10:39 +00:00
|
|
|
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 15:00:57 +01:00
|
|
|
for i in adb fastboot
|
2012-11-07 20:10:39 +00:00
|
|
|
do
|
2014-12-26 17:33:16 +00:00
|
|
|
patchelf --set-interpreter ${stdenv_32bit.cc.libc}/lib/ld-linux.so.2 $i
|
2015-01-15 04:51:58 +00:00
|
|
|
patchelf --set-rpath ${stdenv_32bit.cc.cc}/lib $i
|
2012-11-07 20:10:39 +00:00
|
|
|
done
|
|
|
|
''}
|
|
|
|
'';
|
|
|
|
|
2012-11-08 15:49:36 +00:00
|
|
|
buildInputs = [ unzip ];
|
2012-11-07 20:10:39 +00:00
|
|
|
}
|