From 495c5a22910420a4abd562477579380b41108bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Thu, 24 May 2018 14:38:27 +0200 Subject: [PATCH] androidndk: Fixes missing libraries for prebuilt clang --- .../mobile/androidenv/androidndk.nix | 21 +++++++++---------- .../development/mobile/androidenv/default.nix | 6 +++--- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/pkgs/development/mobile/androidenv/androidndk.nix b/pkgs/development/mobile/androidenv/androidndk.nix index 78e278be2376..a0a15bf184dc 100644 --- a/pkgs/development/mobile/androidenv/androidndk.nix +++ b/pkgs/development/mobile/androidenv/androidndk.nix @@ -1,6 +1,6 @@ -{ stdenv, fetchurl, zlib, ncurses, p7zip, lib, makeWrapper +{ stdenv, fetchurl, zlib, ncurses5, p7zip, lib, makeWrapper , coreutils, file, findutils, gawk, gnugrep, gnused, jdk, which -, platformTools, python3, version, sha256 +, platformTools, python3, libcxx, version, sha256 }: stdenv.mkDerivation rec { @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { phases = "buildPhase"; - nativeBuildInputs = [ p7zip makeWrapper ]; + nativeBuildInputs = [ p7zip makeWrapper file ]; buildCommand = let bin_path = "$out/bin"; @@ -33,9 +33,14 @@ stdenv.mkDerivation rec { in '' set -x mkdir -pv $out/libexec + mkdir -pv $out/lib64 + ln -s ${ncurses5.out}/lib/libncursesw.so.5 $out/lib64/libtinfo.so.5 + ln -s ${ncurses5.out}/lib/libncurses.so.5 $out/lib64/libncurses.so.5 cd $out/libexec 7z x $src + patchShebangs ${pkg_path} + # so that it doesn't fail because of read-only permissions set cd - ${if (version == "10e") then @@ -46,8 +51,6 @@ stdenv.mkDerivation rec { '' else '' - patchShebangs ${pkg_path}/build/tools/make-standalone-toolchain.sh - patch -p1 \ --no-backup-if-mismatch \ -d $out/libexec/${name} < ${ ./. + builtins.toPath ("/make_standalone_toolchain.py_" + "${version}" + ".patch") } @@ -60,17 +63,13 @@ stdenv.mkDerivation rec { \( -type f -a -name "*.so*" \) -o \ \( -type f -a -perm -0100 \) \ \) -exec patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-*so.? \ - --set-rpath ${stdenv.lib.makeLibraryPath [ zlib.out ncurses ]} {} \; + --set-rpath $out/lib64:${stdenv.lib.makeLibraryPath [ libcxx.out zlib.out ncurses5 ]} {} \; # fix ineffective PROGDIR / MYNDKDIR determination for i in ndk-build ${lib.optionalString (version == "10e") "ndk-gdb ndk-gdb-py"} do sed -i -e ${sed_script_1} $i done - ${lib.optionalString (version == "10e") '' - sed -i -e ${sed_script_2} ndk-which - # a bash script - patchShebangs ndk-which - ''} + # wrap for i in ndk-build ${lib.optionalString (version == "10e") "ndk-gdb ndk-gdb-py ndk-which"} do diff --git a/pkgs/development/mobile/androidenv/default.nix b/pkgs/development/mobile/androidenv/default.nix index 3978ae1aeb7b..5846e4fb6de0 100644 --- a/pkgs/development/mobile/androidenv/default.nix +++ b/pkgs/development/mobile/androidenv/default.nix @@ -219,7 +219,7 @@ rec { inherit (buildPackages) p7zip makeWrapper; inherit (pkgs) - stdenv fetchurl zlib ncurses lib python3 + stdenv fetchurl zlib ncurses5 lib python3 libcxx coreutils file findutils gawk gnugrep gnused jdk which; inherit platformTools; version = "10e"; @@ -230,7 +230,7 @@ rec { inherit (buildPackages) p7zip makeWrapper; inherit (pkgs) - stdenv fetchurl zlib ncurses lib python3 + stdenv fetchurl zlib ncurses5 lib python3 libcxx coreutils file findutils gawk gnugrep gnused jdk which; inherit platformTools; version = "16b"; @@ -241,7 +241,7 @@ rec { inherit (buildPackages) p7zip makeWrapper; inherit (pkgs) - stdenv fetchurl zlib ncurses lib python3 + stdenv fetchurl zlib ncurses5 lib python3 libcxx coreutils file findutils gawk gnugrep gnused jdk which; inherit platformTools; version = "17";