about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-11-01 22:54:46 +0100
committerGitHub <noreply@github.com>2022-11-01 22:54:46 +0100
commit42e98b3343325b9af782962e9c9840421b425cfd (patch)
tree5a550457d601dcfb4bc677b1fcf0ccf3b9dbfed5 /pkgs
parentdcb0e1f6923aa771872850dbaa23dd41afb4f178 (diff)
parenta5f43691301497cdd0244286cd75d227e1e91bd9 (diff)
Merge pull request #195752 from sheldonneuberger-sc/snn-android-ndk
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/mobile/androidenv/ndk-bundle/default.nix16
1 files changed, 10 insertions, 6 deletions
diff --git a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix
index ad729e24fb8aa..f57a5c08422b1 100644
--- a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix
+++ b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix
@@ -13,7 +13,7 @@ deployAndroidPackage {
     ++ lib.optionals stdenv.isLinux [ autoPatchelfHook ];
   autoPatchelfIgnoreMissingDeps = true;
   buildInputs = lib.optionals (os == "linux") [ pkgs.zlib ];
-  patchInstructions = lib.optionalString (os == "linux") (''
+  patchInstructions = ''
     patchShebangs .
 
     # TODO: allow this stuff
@@ -37,9 +37,11 @@ deployAndroidPackage {
         addAutoPatchelfSearchPath $out/libexec/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/lib64
     fi
 
-    find toolchains -type d -name bin -or -name lib64 | while read dir; do
-        autoPatchelf "$dir"
-    done
+    if [ -d toolchains/llvm/prebuilt/linux-x86_64 ]; then
+        find toolchains/llvm/prebuilt/linux-x86_64 -type d -name bin -or -name lib64 | while read dir; do
+            autoPatchelf "$dir"
+        done
+    fi
 
     # fix ineffective PROGDIR / MYNDKDIR determination
     for progname in ndk-build; do
@@ -47,7 +49,9 @@ deployAndroidPackage {
     done
 
     # Patch executables
-    autoPatchelf prebuilt/linux-x86_64
+    if [ -d prebuild/linux-x86_64 ]; then
+        autoPatchelf prebuilt/linux-x86_64
+    fi
 
     # wrap
     for progname in ndk-build; do
@@ -59,6 +63,6 @@ deployAndroidPackage {
     for progname in ndk-build; do
         ln -sf ../libexec/android-sdk/ndk-bundle/$progname $out/bin/$progname
     done
-  '');
+  '';
   noAuditTmpdir = true; # Audit script gets invoked by the build/ component in the path for the make standalone script
 }