summary refs log tree commit diff
diff options
context:
space:
mode:
authorBastian Köcher <git@kchr.de>2018-08-29 14:55:21 +0200
committerBastian Köcher <git@kchr.de>2018-09-07 21:42:49 +0200
commit48bdf31f58b40dfb7f781033c100c87e2dd729f2 (patch)
treef11b49e2777beae97bd21151f6545ab4ec62bbf0
parent89ef631ab9c8340eef83219fd41a5419d3268849 (diff)
downloadnixpkgs-48bdf31f58b40dfb7f781033c100c87e2dd729f2.tar
nixpkgs-48bdf31f58b40dfb7f781033c100c87e2dd729f2.tar.gz
nixpkgs-48bdf31f58b40dfb7f781033c100c87e2dd729f2.tar.bz2
nixpkgs-48bdf31f58b40dfb7f781033c100c87e2dd729f2.tar.lz
nixpkgs-48bdf31f58b40dfb7f781033c100c87e2dd729f2.tar.xz
nixpkgs-48bdf31f58b40dfb7f781033c100c87e2dd729f2.tar.zst
nixpkgs-48bdf31f58b40dfb7f781033c100c87e2dd729f2.zip
androidndk: Fix `make_standalone_toolchain.py`
Python path needs to be absolute and the generated scripts will use also
an absolute path to `bash`.
-rw-r--r--pkgs/development/mobile/androidenv/androidndk.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/pkgs/development/mobile/androidenv/androidndk.nix b/pkgs/development/mobile/androidenv/androidndk.nix
index b79741fca23..eb7e7815280 100644
--- a/pkgs/development/mobile/androidenv/androidndk.nix
+++ b/pkgs/development/mobile/androidenv/androidndk.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, zlib, ncurses5, unzip, lib, makeWrapper
 , coreutils, file, findutils, gawk, gnugrep, gnused, jdk, which
-, platformTools, python3, libcxx, version, sha256
+, platformTools, python3, libcxx, version, sha256, bash
 , fullNDK ? false # set to true if you want other parts of the NDK
                   # that is not used by Nixpkgs like sources,
                   # examples, docs, or LLVM toolchains
@@ -35,8 +35,6 @@ stdenv.mkDerivation rec {
     cd $out/libexec
     unzip -qq $src
 
-    patchShebangs ${pkg_path}
-
     # so that it doesn't fail because of read-only permissions set
     cd -
     ${if (version == "10e") then
@@ -50,9 +48,15 @@ stdenv.mkDerivation rec {
           patch -p1 \
             --no-backup-if-mismatch \
             -d $out/libexec/${name} < ${ ./. + "/make_standalone_toolchain.py_${version}.patch" }
+
+          sed -i 's,#!/usr/bin/env python,#!${python3}/bin/python,g' ${pkg_path}/build/tools/make_standalone_toolchain.py
+          sed -i 's,#!/bin/bash,#!${bash}/bin/bash,g' ${pkg_path}/build/tools/make_standalone_toolchain.py
           wrapProgram ${pkg_path}/build/tools/make_standalone_toolchain.py --prefix PATH : "${runtime_paths}"
         ''
     }
+
+    patchShebangs ${pkg_path}
+
     cd ${pkg_path}
 
   '' + lib.optionalString (!fullNDK) ''