From ed3a63b5d7aec50f803e3e91fcb71a001a7ebe78 Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Sat, 15 Jun 2013 21:57:05 +1000 Subject: [PATCH 1/3] php53: fix on darwin * add libssh2 to build inputs (configure fails without this) * link with stdc++ * add icu/lib directory to DYLD_LIBRARY_PATH (and wrap binaries with this environment variable * add libiconv to build inputs * fix --with-iconv configure flag (was --with-iconv-dir which is not a valid flag) --- pkgs/development/interpreters/php/5.3.nix | 43 ++++++++++++++++------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/pkgs/development/interpreters/php/5.3.nix b/pkgs/development/interpreters/php/5.3.nix index 35508230ebd..1625c924cbb 100644 --- a/pkgs/development/interpreters/php/5.3.nix +++ b/pkgs/development/interpreters/php/5.3.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison , apacheHttpd, mysql, libxml2, readline, zlib, curl, gd, postgresql, gettext -, openssl, pkgconfig, sqlite, config, libiconv, libjpeg, libpng, freetype -, libxslt, libmcrypt, bzip2, icu }: +, openssl, pkgconfig, sqlite, config, libjpeg, libpng, freetype, libxslt +, libmcrypt, bzip2, icu, libssh2, makeWrapper, libiconvOrEmpty, libiconv }: let libmcryptOverride = libmcrypt.override { disablePosixThreads = true; }; @@ -15,7 +15,15 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) 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 = { @@ -41,11 +49,11 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) }; libxml2 = { - configureFlags = [ - "--with-libxml-dir=${libxml2}" - #"--with-iconv-dir=${libiconv}" - ]; - buildInputs = [ libxml2 ]; + configureFlags + = [ "--with-libxml-dir=${libxml2}" ] + ++ stdenv.lib.optional (libiconvOrEmpty != []) + [ "--with-iconv=${libiconv}" ]; + buildInputs = [ libxml2 ] ++ libiconvOrEmpty; }; readline = { @@ -89,7 +97,12 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) }; gd = { - configureFlags = ["--with-gd=${gd} --with-freetype-dir=${freetype}"]; + configureFlags = [ + "--with-gd" + "--with-freetype-dir=${freetype}" + "--with-png-dir=${libpng}" + "--with-jpeg-dir=${libjpeg}" + ]; buildInputs = [gd libpng libjpeg freetype]; }; @@ -197,7 +210,11 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) installPhase = '' unset installPhase; installPhase; 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 { url = "http://nl.php.net/get/php-${version}.tar.bz2/from/this/mirror"; @@ -207,8 +224,10 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) meta = { description = "The PHP language runtime engine"; - homepage = http://www.php.net/; - license = "PHP-3"; + homepage = http://www.php.net/; + license = "PHP-3"; + maintainers = with stdenv.lib.maintainers; [ lovek323 ]; + platforms = stdenv.lib.platforms.unix; }; patches = [./fix.patch]; From 6ae1241934323fc04badab567ed64875fb51ba85 Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Thu, 20 Jun 2013 17:42:09 +1000 Subject: [PATCH 2/3] php53: add optional pcntl flag --- pkgs/development/interpreters/php/5.3.nix | 35 +++++++++++++---------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/pkgs/development/interpreters/php/5.3.nix b/pkgs/development/interpreters/php/5.3.nix index 1625c924cbb..a6f5964091f 100644 --- a/pkgs/development/interpreters/php/5.3.nix +++ b/pkgs/development/interpreters/php/5.3.nix @@ -43,6 +43,10 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) buildInputs = [curl openssl]; }; + pcntl = { + configureFlags = [ "--enable-pcntl" ]; + }; + zlib = { configureFlags = ["--with-zlib=${zlib}"]; buildInputs = [zlib]; @@ -174,30 +178,31 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) }; 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; bcmathSupport = config.php.bcmath or true; - socketsSupport = config.php.sockets or true; + bz2Support = config.php.bz2 or false; 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; + 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; readlineSupport = config.php.readline or true; - sqliteSupport = config.php.sqlite or true; soapSupport = config.php.soap or true; - zlibSupport = config.php.zlib or true; - opensslSupport = config.php.openssl 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; + socketsSupport = config.php.sockets or true; + sqliteSupport = config.php.sqlite or true; xslSupport = config.php.xsl or false; - mcryptSupport = config.php.mcrypt or false; - bz2Support = config.php.bz2 or false; zipSupport = config.php.zip or true; - ftpSupport = config.php.ftp or true; + zlibSupport = config.php.zlib or true; }; configurePhase = '' From a7746e3585cbdf437c57f43fa50750a1bc6c3c11 Mon Sep 17 00:00:00 2001 From: "Jason \"Don\" O'Conal" Date: Thu, 20 Jun 2013 17:45:29 +1000 Subject: [PATCH 3/3] php53: restore nix gd version --- pkgs/development/interpreters/php/5.3.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/php/5.3.nix b/pkgs/development/interpreters/php/5.3.nix index a6f5964091f..347a374ffcc 100644 --- a/pkgs/development/interpreters/php/5.3.nix +++ b/pkgs/development/interpreters/php/5.3.nix @@ -102,7 +102,7 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) gd = { configureFlags = [ - "--with-gd" + "--with-gd=${gd}" "--with-freetype-dir=${freetype}" "--with-png-dir=${libpng}" "--with-jpeg-dir=${libjpeg}"