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 23 buildInputs = [ flex bison pkgconfig ] 24 24 ++ lib.optional stdenv.isLinux systemd; 25 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 26 flags = { 32 27 33 28 # much left to do here... ··· 267 262 268 263 hardeningDisable = [ "bindnow" ]; 269 264 270 - configurePhase = '' 265 + preConfigure = '' 271 266 # 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)) '' 267 + # runtime dependencies 274 268 for i in main/build-defs.h.in scripts/php-config.in; do 275 269 substituteInPlace $i \ 276 270 --replace '@CONFIGURE_COMMAND@' '(omitted)' \ 277 271 --replace '@CONFIGURE_OPTIONS@' "" \ 278 272 --replace '@PHP_LDFLAGS@' "" 279 273 done 280 - ''} 281 274 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 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) 284 280 ''; 285 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 + 286 287 postInstall = '' 287 288 cp php.ini-production $out/etc/php.ini 288 289 ''; 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 + 290 299 src = fetchurl { 291 300 url = "http://www.php.net/distributions/php-${version}.tar.bz2"; 292 301 inherit sha256; ··· 298 307 license = licenses.php301; 299 308 maintainers = with maintainers; [ globin ]; 300 309 platforms = platforms.all; 310 + outputsToInstall = [ "out" "dev" ]; 301 311 }; 302 312 303 313 patches = if !php7 then [ ./fix-paths.patch ] else [ ./fix-paths-php7.patch ];