about summary refs log tree commit diff
path: root/pkgs/stdenv/generic
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2023-11-06 00:13:45 +0200
committerArtturin <Artturin@artturin.com>2023-11-25 18:16:12 +0200
commite68001550de99fac8336e2c230dcd7e0157777ed (patch)
treea465519961341f82f616539e0faaf99c70673083 /pkgs/stdenv/generic
parent17012aa0d202dcce7ac51cf82e047674f9fe545e (diff)
downloadnixlib-e68001550de99fac8336e2c230dcd7e0157777ed.tar
nixlib-e68001550de99fac8336e2c230dcd7e0157777ed.tar.gz
nixlib-e68001550de99fac8336e2c230dcd7e0157777ed.tar.bz2
nixlib-e68001550de99fac8336e2c230dcd7e0157777ed.tar.lz
nixlib-e68001550de99fac8336e2c230dcd7e0157777ed.tar.xz
nixlib-e68001550de99fac8336e2c230dcd7e0157777ed.tar.zst
nixlib-e68001550de99fac8336e2c230dcd7e0157777ed.zip
stdenv: run patchShebangs on the configure script when it's a file
if the configure script has a `/usr/bin/env` or some other shebang which
is not in the sandbox then there will be errors such as

`...-stdenv-linux/setup: line 1299: ./configure: cannot execute: required file not found`

There are 250 files which `patchShebangs` `./configure`

https://github.com/search?q=NOT+is%3Afork+lang%3Anix+%2FpatchShebangs+.%5C%2Fconfigure%2F&type=code
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r--pkgs/stdenv/generic/setup.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index ad9857fc9d61..b06758821da8 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -1273,6 +1273,10 @@ configurePhase() {
                 prependToVar configureFlags --disable-static
             fi
         fi
+
+        if [ -z "${dontPatchShebangsInConfigure:-}" ]; then
+            patchShebangs --build "$configureScript"
+        fi
     fi
 
     if [ -n "$configureScript" ]; then