From 18180858af59960354968918cef5091cf11daa8b Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Sat, 26 Jan 2013 13:17:31 +0100 Subject: [PATCH 1/5] Enable mcrypt, intl and exif support in PHP --- pkgs/development/interpreters/php/5.3.nix | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/php/5.3.nix b/pkgs/development/interpreters/php/5.3.nix index 014ce9d3b97..56265fda55d 100644 --- a/pkgs/development/interpreters/php/5.3.nix +++ b/pkgs/development/interpreters/php/5.3.nix @@ -1,6 +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 }: +, openssl, pkgconfig, sqlite, config, libiconv, libjpeg, libpng, freetype +, libmcrypt, icu }: composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in { @@ -110,6 +111,20 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) buildInputs = [gettext]; }; + mcrypt = { + configureFlags = ["--with-mcrypt=${libmcrypt}"]; + buildInputs = [libmcrypt]; + }; + + intl = { + configureFlags = ["--enable-intl"]; + buildInputs = [icu]; + }; + + exif = { + configureFlags = ["--enable-exif"]; + }; + /* php is build within this derivation in order to add the xdebug lines to the php.ini. So both Apache and command line php both use xdebug without having to configure anything. @@ -141,12 +156,15 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) opensslSupport = config.php.openssl or true; mbstringSupport = config.php.mbstring or true; gdSupport = config.php.gd or true; + mcryptSupport = config.php.mcrypt or true; + intlSupport = config.php.intl or true; + exifSupport = config.php.exif or true; }; configurePhase = '' iniFile=$out/etc/php-recommended.ini [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin - ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags + ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags echo configurePhase end ''; From b42ba898e13ba3f4650f8225785169294b11fe9a Mon Sep 17 00:00:00 2001 From: Baptist BENOIST Date: Sun, 10 Feb 2013 18:29:08 +0100 Subject: [PATCH 2/5] php: Add xsl optional support Use an override with xsl = true to enable xsl support in php. --- pkgs/development/interpreters/php/5.3.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/php/5.3.nix b/pkgs/development/interpreters/php/5.3.nix index 014ce9d3b97..ff136329d60 100644 --- a/pkgs/development/interpreters/php/5.3.nix +++ b/pkgs/development/interpreters/php/5.3.nix @@ -1,6 +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 }: +, openssl, pkgconfig, sqlite, config, libiconv, libjpeg, libpng, freetype +, libxslt }: composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in { @@ -110,6 +111,11 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) buildInputs = [gettext]; }; + xsl = { + configureFlags = ["--with-xsl=${libxslt}"]; + buildInputs = [libxslt]; + }; + /* php is build within this derivation in order to add the xdebug lines to the php.ini. So both Apache and command line php both use xdebug without having to configure anything. @@ -141,6 +147,7 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) opensslSupport = config.php.openssl or true; mbstringSupport = config.php.mbstring or true; gdSupport = config.php.gd or true; + xslSupport = config.php.xsl or false; }; configurePhase = '' From 8fd5fcbda5dd87966265813c08ab19d28bb9723a Mon Sep 17 00:00:00 2001 From: bbenoist Date: Tue, 12 Feb 2013 19:33:39 +0100 Subject: [PATCH 3/5] php: Add mcrypt optional support Use an override with mcrypt = true to enable libmcrypt support in php. The --disable-posix-threadsds mcrypt build option was required by php. --- pkgs/development/interpreters/php/5.3.nix | 12 +++++++++++- pkgs/development/libraries/libmcrypt/default.nix | 9 ++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/php/5.3.nix b/pkgs/development/interpreters/php/5.3.nix index ff136329d60..7d51a74020f 100644 --- a/pkgs/development/interpreters/php/5.3.nix +++ b/pkgs/development/interpreters/php/5.3.nix @@ -1,7 +1,11 @@ { 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 }: +, libxslt, libmcrypt }: + +let + libmcryptOverride = libmcrypt.override { disablePosixThreads = true; }; +in composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in { @@ -116,6 +120,11 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) buildInputs = [libxslt]; }; + mcrypt = { + configureFlags = ["--with-mcrypt=${libmcrypt}"]; + buildInputs = [libmcryptOverride]; + }; + /* php is build within this derivation in order to add the xdebug lines to the php.ini. So both Apache and command line php both use xdebug without having to configure anything. @@ -148,6 +157,7 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) mbstringSupport = config.php.mbstring or true; gdSupport = config.php.gd or true; xslSupport = config.php.xsl or false; + mcryptSupport = config.php.mcrypt or false; }; configurePhase = '' diff --git a/pkgs/development/libraries/libmcrypt/default.nix b/pkgs/development/libraries/libmcrypt/default.nix index eac577869e2..79019cbc489 100644 --- a/pkgs/development/libraries/libmcrypt/default.nix +++ b/pkgs/development/libraries/libmcrypt/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl, disablePosixThreads ? false }: + +with stdenv.lib; stdenv.mkDerivation rec { name = "libmcrypt-2.5.8"; @@ -10,7 +12,12 @@ stdenv.mkDerivation rec { buildInputs = []; + configureFlags = optional disablePosixThreads + [ "--disable-posix-threads" ]; + meta = { + description = "MCrypt is a replacement for the old crypt() package and crypt(1) command, with extensions."; homepage = http://mcrypt.sourceforge.net; + license = "GPL"; }; } From 99934eb36378d22d793cc86103544278a25922f6 Mon Sep 17 00:00:00 2001 From: bbenoist Date: Tue, 12 Feb 2013 21:23:24 +0100 Subject: [PATCH 4/5] php: Add zip and optional bz2 support Use the overload bz2 = true to enable bz2 support for php. zip support is enabled by default as it doesn't require any library. --- pkgs/development/interpreters/php/5.3.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/php/5.3.nix b/pkgs/development/interpreters/php/5.3.nix index 7d51a74020f..7a243e88971 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 }: +, libxslt, libmcrypt, bzip2 }: let libmcryptOverride = libmcrypt.override { disablePosixThreads = true; }; @@ -125,6 +125,15 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) buildInputs = [libmcryptOverride]; }; + bz2 = { + configureFlags = ["--with-bz2=${bzip2}"]; + buildInputs = [bzip2]; + }; + + zip = { + configureFlags = ["--enable-zip"]; + }; + /* php is build within this derivation in order to add the xdebug lines to the php.ini. So both Apache and command line php both use xdebug without having to configure anything. @@ -158,6 +167,8 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) gdSupport = config.php.gd 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; }; configurePhase = '' From fec1d4b2f7070d92d4c28732b43d0d4d0a1ff5aa Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Fri, 22 Feb 2013 09:24:48 +0100 Subject: [PATCH 5/5] Remove misconfigured mcrypt support --- pkgs/development/interpreters/php/5.3.nix | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkgs/development/interpreters/php/5.3.nix b/pkgs/development/interpreters/php/5.3.nix index 56265fda55d..a262ad75b8b 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 -, libmcrypt, icu }: +, icu }: composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in { @@ -111,11 +111,6 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) buildInputs = [gettext]; }; - mcrypt = { - configureFlags = ["--with-mcrypt=${libmcrypt}"]; - buildInputs = [libmcrypt]; - }; - intl = { configureFlags = ["--enable-intl"]; buildInputs = [icu]; @@ -156,7 +151,6 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) opensslSupport = config.php.openssl or true; mbstringSupport = config.php.mbstring or true; gdSupport = config.php.gd or true; - mcryptSupport = config.php.mcrypt or true; intlSupport = config.php.intl or true; exifSupport = config.php.exif or true; };