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
This commit is contained in:
Artturin 2023-11-06 00:13:45 +02:00
parent 17012aa0d2
commit e68001550d

View file

@ -1273,6 +1273,10 @@ configurePhase() {
prependToVar configureFlags --disable-static
fi
fi
if [ -z "${dontPatchShebangsInConfigure:-}" ]; then
patchShebangs --build "$configureScript"
fi
fi
if [ -n "$configureScript" ]; then