From b4d9f6ddca2597af0323f4546b4ae466e0280243 Mon Sep 17 00:00:00 2001 From: Clemens Fruhwirth Date: Wed, 31 Oct 2018 13:16:05 +0100 Subject: [PATCH] androidsdk: Re-add emulator that was broken out of the sdk-tools package. --- .../mobile/androidenv/androidsdk.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pkgs/development/mobile/androidenv/androidsdk.nix b/pkgs/development/mobile/androidenv/androidsdk.nix index 3c2e6c530d22..26750aed6cfc 100644 --- a/pkgs/development/mobile/androidenv/androidsdk.nix +++ b/pkgs/development/mobile/androidenv/androidsdk.nix @@ -41,10 +41,16 @@ stdenv.mkDerivation rec { } else throw "platform not ${stdenv.hostPlatform.system} supported!"; + emulator = fetchurl { + url = "https://dl.google.com/android/repository/emulator-linux-4969155.zip"; + sha256 = "0iw0j6j3w9zpfalsa7xq2czz4vzgq96zk2zddjhanwwx4p8fhrfd"; + }; + buildCommand = '' mkdir -p $out/libexec cd $out/libexec unpackFile $src + unpackFile $emulator cd tools for f in monitor bin/monkeyrunner bin/uiautomatorviewer @@ -76,13 +82,16 @@ stdenv.mkDerivation rec { # The emulators need additional libraries, which are dynamically loaded => let's wrap them ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") '' - for i in emulator emulator-check + cd .. + for i in emulator/emulator* emulator/qemu/linux-x86_64/qemu-system-* do + patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 $i wrapProgram `pwd`/$i \ --prefix PATH : ${stdenv.lib.makeBinPath [ file glxinfo ]} \ --suffix LD_LIBRARY_PATH : `pwd`/lib:${makeLibraryPath [ stdenv.cc.cc libX11 libxcb libXau libXdmcp libXext libGLU_combined alsaLib zlib libpulseaudio dbus.lib ]} \ --suffix QT_XKB_CONFIG_ROOT : ${xkeyboardconfig}/share/X11/xkb done + cd tools ''} ''} @@ -263,6 +272,14 @@ stdenv.mkDerivation rec { fi done + for i in $out/libexec/emulator/* + do + if [ ! -d $i ] && [ -x $i ] + then + ln -sf $i $out/bin/$(basename $i) + fi + done + wrapProgram $out/bin/sdkmanager \ --set JAVA_HOME ${jdk}