summary refs log tree commit diff
path: root/pkgs/development/interpreters/php/default.nix
diff options
context:
space:
mode:
authorMarc Scholten <marc@pedigital.de>2016-06-08 22:37:06 +0200
committerMarc Scholten <marc@pedigital.de>2016-06-09 14:49:55 +0200
commitd4babc49dcf0db770cc49f6e1cda7b89fdf0fca7 (patch)
tree2bf58901e6f02001a7d05243970a952ee396382d /pkgs/development/interpreters/php/default.nix
parente52194f17d15b484fdfdf625fbe4cba759739920 (diff)
downloadnixpkgs-d4babc49dcf0db770cc49f6e1cda7b89fdf0fca7.tar
nixpkgs-d4babc49dcf0db770cc49f6e1cda7b89fdf0fca7.tar.gz
nixpkgs-d4babc49dcf0db770cc49f6e1cda7b89fdf0fca7.tar.bz2
nixpkgs-d4babc49dcf0db770cc49f6e1cda7b89fdf0fca7.tar.lz
nixpkgs-d4babc49dcf0db770cc49f6e1cda7b89fdf0fca7.tar.xz
nixpkgs-d4babc49dcf0db770cc49f6e1cda7b89fdf0fca7.tar.zst
nixpkgs-d4babc49dcf0db770cc49f6e1cda7b89fdf0fca7.zip
php: Now builds on darwin
Diffstat (limited to 'pkgs/development/interpreters/php/default.nix')
-rw-r--r--pkgs/development/interpreters/php/default.nix19
1 files changed, 13 insertions, 6 deletions
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix
index 8aea0f4d23f..5d20a0ee8c8 100644
--- a/pkgs/development/interpreters/php/default.nix
+++ b/pkgs/development/interpreters/php/default.nix
@@ -2,7 +2,7 @@
 , mysql, libxml2, readline, zlib, curl, postgresql, gettext
 , openssl, pkgconfig, sqlite, config, libjpeg, libpng, freetype
 , libxslt, libmcrypt, bzip2, icu, openldap, cyrus_sasl, libmhash, freetds
-, uwimap, pam, gmp, apacheHttpd }:
+, uwimap, pam, gmp, apacheHttpd, libiconv }:
 
 let
 
@@ -21,7 +21,10 @@ let
 
       buildInputs = [ flex bison pkgconfig ];
 
-      configureFlags = ["EXTENSION_DIR=$(out)/lib/php/extensions"];
+      configureFlags = [
+        "EXTENSION_DIR=$(out)/lib/php/extensions"
+        "--with-iconv=${libiconv}"
+      ];
 
       flags = {
 
@@ -49,9 +52,9 @@ let
             "LDAP_DIR=${openldap.dev}"
             "LDAP_INCDIR=${openldap.dev}/include"
             "LDAP_LIBDIR=${openldap.out}/lib"
-            "--with-ldap-sasl=${cyrus_sasl.dev}"
+            (lib.optional stdenv.isLinux "--with-ldap-sasl=${cyrus_sasl.dev}")
             ];
-          buildInputs = [openldap cyrus_sasl openssl];
+          buildInputs = [openldap openssl] ++ lib.optional stdenv.isLinux cyrus_sasl;
         };
 
         mhash = {
@@ -218,14 +221,14 @@ let
       };
 
       cfg = {
-        imapSupport = config.php.imap or true;
+        imapSupport = config.php.imap or (!stdenv.isDarwin);
         ldapSupport = config.php.ldap or true;
         mhashSupport = config.php.mhash or true;
         mysqlSupport = (!php7) && (config.php.mysql or true);
         mysqliSupport = config.php.mysqli or true;
         pdo_mysqlSupport = config.php.pdo_mysql or true;
         libxml2Support = config.php.libxml2 or true;
-        apxs2Support = config.php.apxs2 or true;
+        apxs2Support = config.php.apxs2 or (!stdenv.isDarwin);
         bcmathSupport = config.php.bcmath or true;
         socketsSupport = config.php.sockets or true;
         curlSupport = config.php.curl or true;
@@ -287,6 +290,10 @@ let
 
       patches = if !php7 then [ ./fix-paths.patch ] else [ ./fix-paths-php7.patch ];
 
+      postPatch = lib.optional stdenv.isDarwin ''
+        substituteInPlace configure --replace "-lstdc++" "-lc++"
+      '';
+
     });
 
 in {