Merge pull request #650 from lovek323/php53

php53: fix on darwin
This commit is contained in:
Domen Kožar 2013-06-29 03:53:26 -07:00
commit f33ebf88b9

View File

@ -1,7 +1,7 @@
{ stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison { stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison
, apacheHttpd, mysql, libxml2, readline, zlib, curl, gd, postgresql, gettext , apacheHttpd, mysql, libxml2, readline, zlib, curl, gd, postgresql, gettext
, openssl, pkgconfig, sqlite, config, libiconv, libjpeg, libpng, freetype , openssl, pkgconfig, sqlite, config, libjpeg, libpng, freetype, libxslt
, libxslt, libmcrypt, bzip2, icu }: , libmcrypt, bzip2, icu, libssh2, makeWrapper, libiconvOrEmpty, libiconv }:
let let
libmcryptOverride = libmcrypt.override { disablePosixThreads = true; }; libmcryptOverride = libmcrypt.override { disablePosixThreads = true; };
@ -15,7 +15,15 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
enableParallelBuilding = true; enableParallelBuilding = true;
buildInputs = ["flex" "bison" "pkgconfig"]; buildInputs
= [ flex bison pkgconfig ]
++ stdenv.lib.optionals stdenv.isDarwin [ libssh2 makeWrapper ];
# need to include the C++ standard library when compiling on darwin
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lstdc++";
# need to specify where the dylib for icu is stored
DYLD_LIBRARY_PATH = stdenv.lib.optionalString stdenv.isDarwin "${icu}/lib";
flags = { flags = {
@ -35,17 +43,21 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
buildInputs = [curl openssl]; buildInputs = [curl openssl];
}; };
pcntl = {
configureFlags = [ "--enable-pcntl" ];
};
zlib = { zlib = {
configureFlags = ["--with-zlib=${zlib}"]; configureFlags = ["--with-zlib=${zlib}"];
buildInputs = [zlib]; buildInputs = [zlib];
}; };
libxml2 = { libxml2 = {
configureFlags = [ configureFlags
"--with-libxml-dir=${libxml2}" = [ "--with-libxml-dir=${libxml2}" ]
#"--with-iconv-dir=${libiconv}" ++ stdenv.lib.optional (libiconvOrEmpty != [])
]; [ "--with-iconv=${libiconv}" ];
buildInputs = [ libxml2 ]; buildInputs = [ libxml2 ] ++ libiconvOrEmpty;
}; };
readline = { readline = {
@ -166,30 +178,31 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
}; };
cfg = { cfg = {
mysqlSupport = 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 true;
bcmathSupport = config.php.bcmath or true; bcmathSupport = config.php.bcmath or true;
socketsSupport = config.php.sockets or true; bz2Support = config.php.bz2 or false;
curlSupport = config.php.curl or true; curlSupport = config.php.curl or true;
exifSupport = config.php.exif or true;
ftpSupport = config.php.ftp or true;
gdSupport = config.php.gd or true;
gettextSupport = config.php.gettext or true; gettextSupport = config.php.gettext or true;
intlSupport = config.php.intl or true;
libxml2Support = config.php.libxml2 or true;
mbstringSupport = config.php.mbstring or true;
mcryptSupport = config.php.mcrypt or false;
mysqlSupport = config.php.mysql or true;
mysqliSupport = config.php.mysqli or true;
opensslSupport = config.php.openssl or true;
pcntlSupport = config.php.pcntl or true;
pdo_mysqlSupport = config.php.pdo_mysql or true;
postgresqlSupport = config.php.postgresql or true; postgresqlSupport = config.php.postgresql or true;
readlineSupport = config.php.readline or true; readlineSupport = config.php.readline or true;
sqliteSupport = config.php.sqlite or true;
soapSupport = config.php.soap or true; soapSupport = config.php.soap or true;
zlibSupport = config.php.zlib or true; socketsSupport = config.php.sockets or true;
opensslSupport = config.php.openssl or true; sqliteSupport = config.php.sqlite or true;
mbstringSupport = config.php.mbstring or true;
gdSupport = config.php.gd or true;
intlSupport = config.php.intl or true;
exifSupport = config.php.exif or true;
xslSupport = config.php.xsl or false; xslSupport = config.php.xsl or false;
mcryptSupport = config.php.mcrypt or false;
bz2Support = config.php.bz2 or false;
zipSupport = config.php.zip or true; zipSupport = config.php.zip or true;
ftpSupport = config.php.ftp or true; zlibSupport = config.php.zlib or true;
}; };
configurePhase = '' configurePhase = ''
@ -202,7 +215,11 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
installPhase = '' installPhase = ''
unset installPhase; installPhase; unset installPhase; installPhase;
cp php.ini-production $iniFile cp php.ini-production $iniFile
''; '' + ( stdenv.lib.optionalString stdenv.isDarwin ''
for prog in $out/bin/*; do
wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "$DYLD_LIBRARY_PATH"
done
'' );
src = fetchurl { src = fetchurl {
url = "http://nl.php.net/get/php-${version}.tar.bz2/from/this/mirror"; url = "http://nl.php.net/get/php-${version}.tar.bz2/from/this/mirror";
@ -212,8 +229,10 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
meta = { meta = {
description = "The PHP language runtime engine"; description = "The PHP language runtime engine";
homepage = http://www.php.net/; homepage = http://www.php.net/;
license = "PHP-3"; license = "PHP-3";
maintainers = with stdenv.lib.maintainers; [ lovek323 ];
platforms = stdenv.lib.platforms.unix;
}; };
patches = [./fix.patch]; patches = [./fix.patch];