about summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers
diff options
context:
space:
mode:
authorAndreas Herrmann <andreash87@gmx.ch>2019-08-19 14:28:23 +0200
committerFlorian Klink <flokli@flokli.de>2019-10-11 21:44:28 +0200
commitf6572b4e646ecfe6f836aef993bb0df874f0082d (patch)
tree99f5e756a8d346cb50715b8617339883303c1d91 /pkgs/development/tools/build-managers
parentd132d47199b8f89486e6f1f514a2938a50e735fa (diff)
downloadnixlib-f6572b4e646ecfe6f836aef993bb0df874f0082d.tar
nixlib-f6572b4e646ecfe6f836aef993bb0df874f0082d.tar.gz
nixlib-f6572b4e646ecfe6f836aef993bb0df874f0082d.tar.bz2
nixlib-f6572b4e646ecfe6f836aef993bb0df874f0082d.tar.lz
nixlib-f6572b4e646ecfe6f836aef993bb0df874f0082d.tar.xz
nixlib-f6572b4e646ecfe6f836aef993bb0df874f0082d.tar.zst
nixlib-f6572b4e646ecfe6f836aef993bb0df874f0082d.zip
bazel: patch #!/usr/bin/env bash
To point to the custom bash instead of `/nix/store.../bin/env bash`.
Diffstat (limited to 'pkgs/development/tools/build-managers')
-rw-r--r--pkgs/development/tools/build-managers/bazel/default.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/pkgs/development/tools/build-managers/bazel/default.nix b/pkgs/development/tools/build-managers/bazel/default.nix
index c0ff09d09767..95617241c1b6 100644
--- a/pkgs/development/tools/build-managers/bazel/default.nix
+++ b/pkgs/development/tools/build-managers/bazel/default.nix
@@ -5,7 +5,7 @@
 , lr, xe, zip, unzip, bash, writeCBin, coreutils
 , which, gawk, gnused, gnutar, gnugrep, gzip, findutils
 # updater
-, python3, writeScript
+, python27, python3, writeScript
 # Apple dependencies
 , cctools, libcxx, CoreFoundation, CoreServices, Foundation
 # Allow to independently override the jdks used to build and run respectively
@@ -328,10 +328,11 @@ stdenv.mkDerivation rec {
     '';
 
     genericPatches = ''
-      # Substitute python's stub shebang to plain python path. (see TODO add pr URL)
+      # Substitute j2objc and objc wrapper's python shebang to plain python path.
       # See also `postFixup` where python is added to $out/nix-support
-      substituteInPlace src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt \
-          --replace "#!/usr/bin/env python" "#!${python3}/bin/python"
+      substituteInPlace tools/j2objc/j2objc_header_map.py --replace "$!/usr/bin/python2.7" "#!${python27}/bin/python"
+      substituteInPlace tools/j2objc/j2objc_wrapper.py --replace "$!/usr/bin/python2.7" "#!${python27}/bin/python"
+      substituteInPlace tools/objc/j2objc_dead_code_pruner.py --replace "$!/usr/bin/python2.7" "#!${python27}/bin/python"
 
       # md5sum is part of coreutils
       sed -i 's|/sbin/md5|md5sum|' \
@@ -343,6 +344,8 @@ stdenv.mkDerivation rec {
         # Only files containing /bin are taken into account.
         substituteInPlace "$path" \
           --replace /bin/bash ${customBash}/bin/bash \
+          --replace "/usr/bin/env bash" ${customBash}/bin/bash \
+          --replace "/usr/bin/env python" ${python3}/bin/python \
           --replace /usr/bin/env ${coreutils}/bin/env \
           --replace /bin/true ${coreutils}/bin/true
       done