bazel: patch #!/usr/bin/env bash

To point to the custom bash instead of `/nix/store.../bin/env bash`.

authored by Andreas Herrmann and committed by Florian Klink f6572b4e d132d471

+7 -4
+7 -4
pkgs/development/tools/build-managers/bazel/default.nix
··· 5 5 , lr, xe, zip, unzip, bash, writeCBin, coreutils 6 6 , which, gawk, gnused, gnutar, gnugrep, gzip, findutils 7 7 # updater 8 - , python3, writeScript 8 + , python27, python3, writeScript 9 9 # Apple dependencies 10 10 , cctools, libcxx, CoreFoundation, CoreServices, Foundation 11 11 # Allow to independently override the jdks used to build and run respectively ··· 328 328 ''; 329 329 330 330 genericPatches = '' 331 - # Substitute python's stub shebang to plain python path. (see TODO add pr URL) 331 + # Substitute j2objc and objc wrapper's python shebang to plain python path. 332 332 # See also `postFixup` where python is added to $out/nix-support 333 - substituteInPlace src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt \ 334 - --replace "#!/usr/bin/env python" "#!${python3}/bin/python" 333 + substituteInPlace tools/j2objc/j2objc_header_map.py --replace "$!/usr/bin/python2.7" "#!${python27}/bin/python" 334 + substituteInPlace tools/j2objc/j2objc_wrapper.py --replace "$!/usr/bin/python2.7" "#!${python27}/bin/python" 335 + substituteInPlace tools/objc/j2objc_dead_code_pruner.py --replace "$!/usr/bin/python2.7" "#!${python27}/bin/python" 335 336 336 337 # md5sum is part of coreutils 337 338 sed -i 's|/sbin/md5|md5sum|' \ ··· 343 344 # Only files containing /bin are taken into account. 344 345 substituteInPlace "$path" \ 345 346 --replace /bin/bash ${customBash}/bin/bash \ 347 + --replace "/usr/bin/env bash" ${customBash}/bin/bash \ 348 + --replace "/usr/bin/env python" ${python3}/bin/python \ 346 349 --replace /usr/bin/env ${coreutils}/bin/env \ 347 350 --replace /bin/true ${coreutils}/bin/true 348 351 done