php: Now builds on darwin

This commit is contained in:
Marc Scholten 2016-06-08 22:37:06 +02:00
parent e52194f17d
commit d4babc49dc

View File

@ -2,7 +2,7 @@
, mysql, libxml2, readline, zlib, curl, postgresql, gettext , mysql, libxml2, readline, zlib, curl, postgresql, gettext
, openssl, pkgconfig, sqlite, config, libjpeg, libpng, freetype , openssl, pkgconfig, sqlite, config, libjpeg, libpng, freetype
, libxslt, libmcrypt, bzip2, icu, openldap, cyrus_sasl, libmhash, freetds , libxslt, libmcrypt, bzip2, icu, openldap, cyrus_sasl, libmhash, freetds
, uwimap, pam, gmp, apacheHttpd }: , uwimap, pam, gmp, apacheHttpd, libiconv }:
let let
@ -21,7 +21,10 @@ let
buildInputs = [ flex bison pkgconfig ]; buildInputs = [ flex bison pkgconfig ];
configureFlags = ["EXTENSION_DIR=$(out)/lib/php/extensions"]; configureFlags = [
"EXTENSION_DIR=$(out)/lib/php/extensions"
"--with-iconv=${libiconv}"
];
flags = { flags = {
@ -49,9 +52,9 @@ let
"LDAP_DIR=${openldap.dev}" "LDAP_DIR=${openldap.dev}"
"LDAP_INCDIR=${openldap.dev}/include" "LDAP_INCDIR=${openldap.dev}/include"
"LDAP_LIBDIR=${openldap.out}/lib" "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 = { mhash = {
@ -218,14 +221,14 @@ let
}; };
cfg = { cfg = {
imapSupport = config.php.imap or true; imapSupport = config.php.imap or (!stdenv.isDarwin);
ldapSupport = config.php.ldap or true; ldapSupport = config.php.ldap or true;
mhashSupport = config.php.mhash or true; mhashSupport = config.php.mhash or true;
mysqlSupport = (!php7) && (config.php.mysql or true); mysqlSupport = (!php7) && (config.php.mysql or true);
mysqliSupport = config.php.mysqli or true; mysqliSupport = config.php.mysqli or true;
pdo_mysqlSupport = config.php.pdo_mysql or true; pdo_mysqlSupport = config.php.pdo_mysql or true;
libxml2Support = config.php.libxml2 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; bcmathSupport = config.php.bcmath or true;
socketsSupport = config.php.sockets or true; socketsSupport = config.php.sockets or true;
curlSupport = config.php.curl 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 ]; patches = if !php7 then [ ./fix-paths.patch ] else [ ./fix-paths-php7.patch ];
postPatch = lib.optional stdenv.isDarwin ''
substituteInPlace configure --replace "-lstdc++" "-lc++"
'';
}); });
in { in {