Merge pull request #24648 from asppsa/php-config-fix2

php: fix php-config header file paths

authored by Michael Raskin and committed by GitHub 6008ede4 3d1f825d

+21 -11
+21 -11
pkgs/development/interpreters/php/default.nix
··· 23 buildInputs = [ flex bison pkgconfig ] 24 ++ lib.optional stdenv.isLinux systemd; 25 26 - configureFlags = [ 27 - "EXTENSION_DIR=$(out)/lib/php/extensions" 28 - ] ++ lib.optional stdenv.isDarwin "--with-iconv=${libiconv}" 29 - ++ lib.optional stdenv.isLinux "--with-fpm-systemd"; 30 - 31 flags = { 32 33 # much left to do here... ··· 267 268 hardeningDisable = [ "bindnow" ]; 269 270 - configurePhase = '' 271 # Don't record the configure flags since this causes unnecessary 272 - # runtime dependencies - except for php-embed, as uwsgi needs them. 273 - ${lib.optionalString (!(config.php.embed or false)) '' 274 for i in main/build-defs.h.in scripts/php-config.in; do 275 substituteInPlace $i \ 276 --replace '@CONFIGURE_COMMAND@' '(omitted)' \ 277 --replace '@CONFIGURE_OPTIONS@' "" \ 278 --replace '@PHP_LDFLAGS@' "" 279 done 280 - ''} 281 282 - [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin 283 - ./configure --with-config-file-scan-dir=/etc/php.d --with-config-file-path=$out/etc --prefix=$out $configureFlags 284 ''; 285 286 postInstall = '' 287 cp php.ini-production $out/etc/php.ini 288 ''; 289 290 src = fetchurl { 291 url = "http://www.php.net/distributions/php-${version}.tar.bz2"; 292 inherit sha256; ··· 298 license = licenses.php301; 299 maintainers = with maintainers; [ globin ]; 300 platforms = platforms.all; 301 }; 302 303 patches = if !php7 then [ ./fix-paths.patch ] else [ ./fix-paths-php7.patch ];
··· 23 buildInputs = [ flex bison pkgconfig ] 24 ++ lib.optional stdenv.isLinux systemd; 25 26 flags = { 27 28 # much left to do here... ··· 262 263 hardeningDisable = [ "bindnow" ]; 264 265 + preConfigure = '' 266 # Don't record the configure flags since this causes unnecessary 267 + # runtime dependencies 268 for i in main/build-defs.h.in scripts/php-config.in; do 269 substituteInPlace $i \ 270 --replace '@CONFIGURE_COMMAND@' '(omitted)' \ 271 --replace '@CONFIGURE_OPTIONS@' "" \ 272 --replace '@PHP_LDFLAGS@' "" 273 done 274 275 + #[[ -z "$libxml2" ]] || addToSearchPath PATH $libxml2/bin 276 + 277 + configureFlags+=(--with-config-file-path=$out/etc \ 278 + --includedir=$dev/include \ 279 + EXTENSION_DIR=$out/lib/php/extensions) 280 ''; 281 282 + configureFlags = [ 283 + "--with-config-file-scan-dir=/etc/php.d" 284 + ] ++ lib.optional stdenv.isDarwin "--with-iconv=${libiconv}" 285 + ++ lib.optional stdenv.isLinux "--with-fpm-systemd"; 286 + 287 postInstall = '' 288 cp php.ini-production $out/etc/php.ini 289 ''; 290 291 + postFixup = '' 292 + mkdir -p $dev/bin $dev/share/man/man1 293 + mv $out/bin/phpize $out/bin/php-config $dev/bin/ 294 + mv $out/share/man/man1/phpize.1.gz \ 295 + $out/share/man/man1/php-config.1.gz \ 296 + $dev/share/man/man1/ 297 + ''; 298 + 299 src = fetchurl { 300 url = "http://www.php.net/distributions/php-${version}.tar.bz2"; 301 inherit sha256; ··· 307 license = licenses.php301; 308 maintainers = with maintainers; [ globin ]; 309 platforms = platforms.all; 310 + outputsToInstall = [ "out" "dev" ]; 311 }; 312 313 patches = if !php7 then [ ./fix-paths.patch ] else [ ./fix-paths-php7.patch ];