summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2017-05-01 11:05:43 +0200
committerGitHub <noreply@github.com>2017-05-01 11:05:43 +0200
commit6008ede40daaa879b295e8f6a61d164a02abb069 (patch)
treed98532ec7354d3d55b3e29b9fecdfe93996d4469 /pkgs/development/interpreters
parent3d1f825d2b954e849eb5683c85d6a448c0f4317c (diff)
parentb330329768cc753b6bd8f0e6e3f398382566f7c8 (diff)
downloadnixlib-6008ede40daaa879b295e8f6a61d164a02abb069.tar
nixlib-6008ede40daaa879b295e8f6a61d164a02abb069.tar.gz
nixlib-6008ede40daaa879b295e8f6a61d164a02abb069.tar.bz2
nixlib-6008ede40daaa879b295e8f6a61d164a02abb069.tar.lz
nixlib-6008ede40daaa879b295e8f6a61d164a02abb069.tar.xz
nixlib-6008ede40daaa879b295e8f6a61d164a02abb069.tar.zst
nixlib-6008ede40daaa879b295e8f6a61d164a02abb069.zip
Merge pull request #24648 from asppsa/php-config-fix2
php: fix php-config header file paths
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/php/default.nix32
1 files changed, 21 insertions, 11 deletions
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix
index c3f56b4c6649..96ea21e02057 100644
--- a/pkgs/development/interpreters/php/default.nix
+++ b/pkgs/development/interpreters/php/default.nix
@@ -23,11 +23,6 @@ let
       buildInputs = [ flex bison pkgconfig ]
         ++ lib.optional stdenv.isLinux systemd;
 
-      configureFlags = [
-        "EXTENSION_DIR=$(out)/lib/php/extensions"
-      ] ++ lib.optional stdenv.isDarwin "--with-iconv=${libiconv}"
-        ++ lib.optional stdenv.isLinux  "--with-fpm-systemd";
-
       flags = {
 
         # much left to do here...
@@ -267,26 +262,40 @@ let
 
       hardeningDisable = [ "bindnow" ];
 
-      configurePhase = ''
+      preConfigure = ''
         # Don't record the configure flags since this causes unnecessary
-        # runtime dependencies - except for php-embed, as uwsgi needs them.
-        ${lib.optionalString (!(config.php.embed or false)) ''
+        # runtime dependencies
         for i in main/build-defs.h.in scripts/php-config.in; do
           substituteInPlace $i \
             --replace '@CONFIGURE_COMMAND@' '(omitted)' \
             --replace '@CONFIGURE_OPTIONS@' "" \
             --replace '@PHP_LDFLAGS@' ""
         done
-        ''}
 
-        [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
-        ./configure --with-config-file-scan-dir=/etc/php.d --with-config-file-path=$out/etc --prefix=$out $configureFlags
+        #[[ -z "$libxml2" ]] || addToSearchPath PATH $libxml2/bin
+
+        configureFlags+=(--with-config-file-path=$out/etc \
+          --includedir=$dev/include \
+          EXTENSION_DIR=$out/lib/php/extensions)
       '';
 
+      configureFlags = [
+        "--with-config-file-scan-dir=/etc/php.d"
+      ] ++ lib.optional stdenv.isDarwin "--with-iconv=${libiconv}"
+        ++ lib.optional stdenv.isLinux  "--with-fpm-systemd";
+
       postInstall = ''
         cp php.ini-production $out/etc/php.ini
       '';
 
+      postFixup = ''
+        mkdir -p $dev/bin $dev/share/man/man1
+        mv $out/bin/phpize $out/bin/php-config $dev/bin/
+        mv $out/share/man/man1/phpize.1.gz \
+          $out/share/man/man1/php-config.1.gz \
+          $dev/share/man/man1/
+      '';
+
       src = fetchurl {
         url = "http://www.php.net/distributions/php-${version}.tar.bz2";
         inherit sha256;
@@ -298,6 +307,7 @@ let
         license = licenses.php301;
         maintainers = with maintainers; [ globin ];
         platforms = platforms.all;
+        outputsToInstall = [ "out" "dev" ];
       };
 
       patches = if !php7 then [ ./fix-paths.patch ] else [ ./fix-paths-php7.patch ];