From d4babc49dcf0db770cc49f6e1cda7b89fdf0fca7 Mon Sep 17 00:00:00 2001 From: Marc Scholten Date: Wed, 8 Jun 2016 22:37:06 +0200 Subject: php: Now builds on darwin --- pkgs/development/interpreters/php/default.nix | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'pkgs/development/interpreters/php') diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix index 8aea0f4d23f2..5d20a0ee8c8d 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 { -- cgit 1.4.1