Skip to content

Commit

Permalink
php < 7.4: Fix validation of PKG_CONFIG var
Browse files Browse the repository at this point in the history
They were assuming it is an absolute path, but it (conventionally) can
be something to look up on the PATH too.

Fixes #90202
  • Loading branch information
Ericson2314 committed Jun 13, 2020
1 parent 41dc003 commit c1b9f86
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pkgs/development/interpreters/php/default.nix
Expand Up @@ -195,9 +195,10 @@ let

hardeningDisable = [ "bindnow" ];

preConfigure = ''
# Don't record the configure flags since this causes unnecessary
# runtime dependencies
preConfigure =
# Don't record the configure flags since this causes unnecessary
# runtime dependencies
''
for i in main/build-defs.h.in scripts/php-config.in; do
substituteInPlace $i \
--replace '@CONFIGURE_COMMAND@' '(omitted)' \
Expand All @@ -206,7 +207,14 @@ let
done
export EXTENSION_DIR=$out/lib/php/extensions
''
# PKG_CONFIG need not be a relative path
+ lib.optionalString (! lib.versionAtLeast version "7.4") ''
for i in $(find . -type f -name "*.m4"); do
substituteInPlace $i \
--replace 'test -x "$PKG_CONFIG"' 'type -P "$PKG_CONFIG" >/dev/null'
done
'' + ''
./buildconf --copy --force
if test -f $src/genfiles; then
Expand Down

0 comments on commit c1b9f86

Please sign in to comment.