androidenv: fix broken, less frequently used command-line tools

This commit is contained in:
Sander van der Burg 2015-10-15 14:42:24 +00:00
parent 25033c50e8
commit 62e676b959
4 changed files with 35 additions and 9 deletions

View file

@ -53,12 +53,21 @@ stdenv.mkDerivation rec {
done
''}
# The android script used SWT and wants to dynamically load some GTK+ stuff.
# The following wrapper ensures that they can be found:
# The following scripts used SWT and wants to dynamically load some GTK+ stuff.
# Creating these wrappers ensure that they can be found:
wrapProgram `pwd`/android \
--prefix PATH : ${jdk}/bin \
--prefix LD_LIBRARY_PATH : ${glib}/lib:${gtk}/lib:${libXtst}/lib
wrapProgram `pwd`/uiautomatorviewer \
--prefix PATH : ${jdk}/bin \
--prefix LD_LIBRARY_PATH : ${glib}/lib:${gtk}/lib:${libXtst}/lib
wrapProgram `pwd`/hierarchyviewer \
--prefix PATH : ${jdk}/bin \
--prefix LD_LIBRARY_PATH : ${glib}/lib:${gtk}/lib:${libXtst}/lib
# The emulators need additional libraries, which are dynamically loaded => let's wrap them
for i in emulator emulator-arm emulator-mips emulator-x86

View file

@ -1,4 +1,4 @@
{stdenv, stdenv_32bit, fetchurl, unzip, zlib_32bit}:
{stdenv, stdenv_32bit, fetchurl, unzip, zlib_32bit, ncurses_32bit}:
stdenv.mkDerivation rec {
version = "23.0.1";
@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
cd android-*
# Patch the interpreter
for i in aapt aidl dexdump llvm-rs-cc
for i in aapt aidl bcc_compat dexdump llvm-rs-cc
do
patchelf --set-interpreter ${stdenv_32bit.cc.libc}/lib/ld-linux.so.2 $i
done
@ -36,13 +36,22 @@ stdenv.mkDerivation rec {
done
# These binaries need to find libstdc++, libgcc_s and libraries in the current folder
for i in lib/libbcc.so lib/libbcinfo.so lib/libclang.so llvm-rs-cc
for i in lib/libbcc.so lib/libbcinfo.so lib/libclang.so aidl
do
patchelf --set-rpath ${stdenv_32bit.cc.cc}/lib:`pwd`/lib $i
done
# Create link to make libtinfo.so.5 work
ln -s ${ncurses_32bit}/lib/libncurses.so.5 `pwd`/lib/libtinfo.so.5
# These binaries need to find libstdc++, libgcc_s, ncurses, and libraries in the current folder
for i in bcc_compat llvm-rs-cc
do
patchelf --set-rpath ${stdenv_32bit.cc.cc}/lib:${ncurses_32bit}/lib:`pwd`/lib $i
done
# These binaries also need zlib in addition to libstdc++
for i in zipalign
for i in arm-linux-androideabi-ld i686-linux-android-ld mipsel-linux-android-ld split-select zipalign
do
patchelf --set-interpreter ${stdenv_32bit.cc.libc}/lib/ld-linux.so.2 $i
patchelf --set-rpath ${stdenv_32bit.cc.cc}/lib:${zlib_32bit}/lib:`pwd`/lib $i

View file

@ -4,12 +4,14 @@ rec {
platformTools = import ./platform-tools.nix {
inherit (pkgs) stdenv fetchurl unzip;
stdenv_32bit = pkgs_i686.stdenv;
zlib_32bit = pkgs_i686.zlib;
};
buildTools = import ./build-tools.nix {
inherit (pkgs) stdenv fetchurl unzip;
stdenv_32bit = pkgs_i686.stdenv;
zlib_32bit = pkgs_i686.zlib;
ncurses_32bit = pkgs_i686.ncurses;
};
support = import ./support.nix {

View file

@ -1,4 +1,4 @@
{stdenv, stdenv_32bit, fetchurl, unzip}:
{stdenv, stdenv_32bit, zlib_32bit, fetchurl, unzip}:
stdenv.mkDerivation rec {
version = "23.0.1";
@ -22,10 +22,16 @@ stdenv.mkDerivation rec {
${stdenv.lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
''
for i in adb fastboot
for i in adb dmtracedump fastboot hprof-conv sqlite3
do
patchelf --set-interpreter ${stdenv_32bit.cc.libc}/lib/ld-linux.so.2 $i
patchelf --set-rpath ${stdenv_32bit.cc.cc}/lib $i
patchelf --set-rpath ${stdenv_32bit.cc.cc}/lib:`pwd`/lib $i
done
for i in etc1tool
do
patchelf --set-interpreter ${stdenv_32bit.cc.libc}/lib/ld-linux.so.2 $i
patchelf --set-rpath ${stdenv_32bit.cc.cc}/lib:${zlib_32bit}/lib:`pwd`/lib $i
done
''}