From 2985284ccbff8f9774079ce2d7f02cf328776705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rolf=20Schr=C3=B6der?= Date: Sat, 6 Mar 2021 06:30:58 +0100 Subject: [PATCH 1/2] android: Fix shebangs in auto-generated android toolchain scripts The script make_standalone_toolchain.py autogenerates some shell scripts when invoked. These scripts have a hardcoded shebang of '#!/bin/bash'. The generated scripts obviously do not work in a Nix environment. This commit makes sure the scripts have the correct shebang. --- pkgs/development/mobile/androidenv/ndk-bundle/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix index f74b949a7b3c..5b7d5a3f1bab 100644 --- a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix +++ b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix @@ -14,6 +14,10 @@ deployAndroidPackage { patchInstructions = lib.optionalString (os == "linux") ('' patchShebangs . + # Fix the shebangs of the auto-generated scripts. + substituteInPlace $(pwd)/build/tools/make_standalone_toolchain.py \ + --replace '#!/bin/bash' '#!${pkgs.bash}/bin/bash' + '' + lib.optionalString (builtins.compareVersions (lib.getVersion package) "21" > 0) '' patch -p1 \ --no-backup-if-mismatch < ${./make_standalone_toolchain.py_18.patch} || true From c03f846b46705d282b047a15175203afa3776ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rolf=20Schr=C3=B6der?= Date: Sat, 27 Mar 2021 12:46:58 +0100 Subject: [PATCH 2/2] android: replace '$(pwd)' by '.' --- pkgs/development/mobile/androidenv/ndk-bundle/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix index 5b7d5a3f1bab..26d6a847b4d0 100644 --- a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix +++ b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix @@ -15,13 +15,13 @@ deployAndroidPackage { patchShebangs . # Fix the shebangs of the auto-generated scripts. - substituteInPlace $(pwd)/build/tools/make_standalone_toolchain.py \ + substituteInPlace ./build/tools/make_standalone_toolchain.py \ --replace '#!/bin/bash' '#!${pkgs.bash}/bin/bash' '' + lib.optionalString (builtins.compareVersions (lib.getVersion package) "21" > 0) '' patch -p1 \ --no-backup-if-mismatch < ${./make_standalone_toolchain.py_18.patch} || true - wrapProgram $(pwd)/build/tools/make_standalone_toolchain.py --prefix PATH : "${runtime_paths}" + wrapProgram ./build/tools/make_standalone_toolchain.py --prefix PATH : "${runtime_paths}" '' + '' # TODO: allow this stuff