Merge pull request #90249 from Ericson2314/fix-old-php

php < 7.4: Fix validation of PKG_CONFIG var
This commit is contained in:
Timo Kaufmann 2020-06-14 12:30:36 +02:00 committed by GitHub
commit 20e62aa580
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -195,9 +195,10 @@ let
hardeningDisable = [ "bindnow" ]; hardeningDisable = [ "bindnow" ];
preConfigure = '' preConfigure =
# Don't record the configure flags since this causes unnecessary # Don't record the configure flags since this causes unnecessary
# runtime dependencies # runtime dependencies
''
for i in main/build-defs.h.in scripts/php-config.in; do for i in main/build-defs.h.in scripts/php-config.in; do
substituteInPlace $i \ substituteInPlace $i \
--replace '@CONFIGURE_COMMAND@' '(omitted)' \ --replace '@CONFIGURE_COMMAND@' '(omitted)' \
@ -206,7 +207,14 @@ let
done done
export EXTENSION_DIR=$out/lib/php/extensions 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 ./buildconf --copy --force
if test -f $src/genfiles; then if test -f $src/genfiles; then