git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #90249 from Ericson2314/fix-old-php

php < 7.4: Fix validation of PKG_CONFIG var

commit20e62aa580c2ed83b1a1b9caf0bd8431c0ab3666 authorTimo Kaufmann <timokau@zoho.com> dateSun 14 Jun 2020, 12:30 (6 years ago) parent29f3a2fc1b9f86
1 file changed+12−4
pkgs/development/interpreters/php/default.nix+12−4
pkgs/development/interpreters/php/default.nix+12−4
@@ -195,9 +195,10 @@ let
195195
196196 hardeningDisable = [ "bindnow" ];
197197
198− preConfigure = ''
199− # Don't record the configure flags since this causes unnecessary
200− # runtime dependencies
198+ preConfigure =
199+ # Don't record the configure flags since this causes unnecessary
200+ # runtime dependencies
201+ ''
201202 for i in main/build-defs.h.in scripts/php-config.in; do
202203 substituteInPlace $i \
203204 --replace '@CONFIGURE_COMMAND@' '(omitted)' \
@@ -206,7 +207,14 @@ let
206207 done
207208
208209 export EXTENSION_DIR=$out/lib/php/extensions
209−
210+ ''
211+ # PKG_CONFIG need not be a relative path
212+ + lib.optionalString (! lib.versionAtLeast version "7.4") ''
213+ for i in $(find . -type f -name "*.m4"); do
214+ substituteInPlace $i \
215+ --replace 'test -x "$PKG_CONFIG"' 'type -P "$PKG_CONFIG" >/dev/null'
216+ done
217+ '' + ''
210218 ./buildconf --copy --force
211219
212220 if test -f $src/genfiles; then