2012-10-15 16:14:26 +01:00
|
|
|
{ stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison
|
2012-12-01 20:17:50 +00:00
|
|
|
, apacheHttpd, mysql, libxml2, readline, zlib, curl, gd, postgresql, gettext
|
2013-02-10 17:29:08 +00:00
|
|
|
, openssl, pkgconfig, sqlite, config, libiconv, libjpeg, libpng, freetype
|
2013-02-12 18:33:39 +00:00
|
|
|
, libxslt, libmcrypt }:
|
|
|
|
|
|
|
|
let
|
|
|
|
libmcryptOverride = libmcrypt.override { disablePosixThreads = true; };
|
|
|
|
in
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2012-10-15 16:14:26 +01:00
|
|
|
composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
|
2010-05-29 19:26:54 +01:00
|
|
|
|
2012-10-26 14:20:34 +01:00
|
|
|
version = "5.3.18";
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2011-07-18 21:50:59 +01:00
|
|
|
name = "php-${version}";
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2012-10-15 16:14:26 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
buildInputs = ["flex" "bison" "pkgconfig"];
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
flags = {
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2012-10-15 16:14:26 +01:00
|
|
|
# much left to do here...
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
# SAPI modules:
|
2012-10-15 16:14:26 +01:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
apxs2 = {
|
|
|
|
configureFlags = ["--with-apxs2=${apacheHttpd}/bin/apxs"];
|
|
|
|
buildInputs = [apacheHttpd];
|
|
|
|
};
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
# Extensions
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
curl = {
|
2012-10-15 16:14:26 +01:00
|
|
|
configureFlags = ["--with-curl=${curl}" "--with-curlwrappers"];
|
2009-04-27 02:18:03 +01:00
|
|
|
buildInputs = [curl openssl];
|
2009-03-06 23:21:28 +00:00
|
|
|
};
|
2012-10-15 16:14:26 +01:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
zlib = {
|
2012-10-15 16:14:26 +01:00
|
|
|
configureFlags = ["--with-zlib=${zlib}"];
|
2009-03-06 23:21:28 +00:00
|
|
|
buildInputs = [zlib];
|
|
|
|
};
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
libxml2 = {
|
2010-05-29 19:26:54 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-libxml-dir=${libxml2}"
|
|
|
|
"--with-iconv-dir=${libiconv}"
|
|
|
|
];
|
2009-03-06 23:21:28 +00:00
|
|
|
buildInputs = [ libxml2 ];
|
|
|
|
};
|
2012-10-15 16:14:26 +01:00
|
|
|
|
2011-05-03 09:25:45 +01:00
|
|
|
readline = {
|
|
|
|
configureFlags = ["--with-readline=${readline}"];
|
|
|
|
buildInputs = [ readline ];
|
|
|
|
};
|
|
|
|
|
2009-05-13 11:43:34 +01:00
|
|
|
sqlite = {
|
|
|
|
configureFlags = ["--with-pdo-sqlite=${sqlite}"];
|
|
|
|
buildInputs = [ sqlite ];
|
|
|
|
};
|
2012-10-15 16:14:26 +01:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
postgresql = {
|
|
|
|
configureFlags = ["--with-pgsql=${postgresql}"];
|
|
|
|
buildInputs = [ postgresql ];
|
|
|
|
};
|
2012-10-15 16:14:26 +01:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
mysql = {
|
|
|
|
configureFlags = ["--with-mysql=${mysql}"];
|
|
|
|
buildInputs = [ mysql ];
|
|
|
|
};
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
mysqli = {
|
|
|
|
configureFlags = ["--with-mysqli=${mysql}/bin/mysql_config"];
|
|
|
|
buildInputs = [ mysql];
|
|
|
|
};
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
mysqli_embedded = {
|
|
|
|
configureFlags = ["--enable-embedded-mysqli"];
|
|
|
|
depends = "mysqli";
|
|
|
|
assertion = fixed.mysqliSupport;
|
|
|
|
};
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
pdo_mysql = {
|
|
|
|
configureFlags = ["--with-pdo-mysql=${mysql}"];
|
|
|
|
buildInputs = [ mysql ];
|
|
|
|
};
|
2012-10-15 16:14:26 +01:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
bcmath = {
|
|
|
|
configureFlags = ["--enable-bcmath"];
|
|
|
|
};
|
2008-08-31 07:36:56 +01:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
gd = {
|
2012-12-01 20:17:50 +00:00
|
|
|
configureFlags = ["--with-gd=${gd} --with-freetype-dir=${freetype}"];
|
|
|
|
buildInputs = [gd libpng libjpeg freetype];
|
2009-03-06 23:21:28 +00:00
|
|
|
};
|
2008-08-31 07:36:56 +01:00
|
|
|
|
2009-06-14 02:30:04 +01:00
|
|
|
soap = {
|
|
|
|
configureFlags = ["--enable-soap"];
|
|
|
|
};
|
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
sockets = {
|
|
|
|
configureFlags = ["--enable-sockets"];
|
|
|
|
};
|
2009-01-04 20:18:20 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
openssl = {
|
2012-10-15 16:14:26 +01:00
|
|
|
configureFlags = ["--with-openssl=${openssl}"];
|
2009-03-06 23:21:28 +00:00
|
|
|
buildInputs = ["openssl"];
|
2008-06-06 14:03:55 +01:00
|
|
|
};
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
mbstring = {
|
|
|
|
configureFlags = ["--enable-mbstring"];
|
|
|
|
};
|
2012-12-01 20:17:50 +00:00
|
|
|
|
|
|
|
gettext = {
|
|
|
|
configureFlags = ["--with-gettext=${gettext}"];
|
|
|
|
buildInputs = [gettext];
|
|
|
|
};
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2013-02-10 17:29:08 +00:00
|
|
|
xsl = {
|
|
|
|
configureFlags = ["--with-xsl=${libxslt}"];
|
|
|
|
buildInputs = [libxslt];
|
|
|
|
};
|
|
|
|
|
2013-02-12 18:33:39 +00:00
|
|
|
mcrypt = {
|
|
|
|
configureFlags = ["--with-mcrypt=${libmcrypt}"];
|
|
|
|
buildInputs = [libmcryptOverride];
|
|
|
|
};
|
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
/*
|
2009-10-23 09:56:46 +01:00
|
|
|
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.
|
|
|
|
Xdebug could be put in its own derivation.
|
2009-10-23 12:30:20 +01:00
|
|
|
* /
|
2009-03-06 23:21:28 +00:00
|
|
|
meta = {
|
|
|
|
description = "debugging support for PHP";
|
|
|
|
homepage = http://xdebug.org;
|
|
|
|
license = "based on the PHP license - as is";
|
|
|
|
};
|
|
|
|
*/
|
2007-11-05 21:13:16 +00:00
|
|
|
};
|
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
cfg = {
|
2012-09-19 18:56:56 +01:00
|
|
|
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;
|
|
|
|
curlSupport = config.php.curl or true;
|
|
|
|
gettextSupport = config.php.gettext 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;
|
2013-02-10 17:29:08 +00:00
|
|
|
xslSupport = config.php.xsl or false;
|
2013-02-12 18:33:39 +00:00
|
|
|
mcryptSupport = config.php.mcrypt or false;
|
2009-03-06 23:21:28 +00:00
|
|
|
};
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
configurePhase = ''
|
2010-01-06 17:04:38 +00:00
|
|
|
iniFile=$out/etc/php-recommended.ini
|
2009-03-06 23:21:28 +00:00
|
|
|
[[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
|
|
|
|
./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
|
|
|
|
echo configurePhase end
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
unset installPhase; installPhase;
|
2012-07-23 18:46:50 +01:00
|
|
|
cp php.ini-production $iniFile
|
2009-03-06 23:21:28 +00:00
|
|
|
'';
|
|
|
|
|
2012-10-15 16:14:26 +01:00
|
|
|
src = fetchurl {
|
2009-03-06 23:21:28 +00:00
|
|
|
url = "http://nl.php.net/get/php-${version}.tar.bz2/from/this/mirror";
|
2012-10-26 14:20:34 +01:00
|
|
|
sha256 = "0bqsdwil13m1r449c4rhrc8cmx2a09k8h2g107qqxfwanzndwrgh";
|
2009-03-06 23:21:28 +00:00
|
|
|
name = "php-${version}.tar.bz2";
|
|
|
|
};
|
2008-12-20 01:20:35 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
meta = {
|
|
|
|
description = "The PHP language runtime engine";
|
|
|
|
homepage = http://www.php.net/;
|
|
|
|
license = "PHP-3";
|
2007-11-05 21:13:16 +00:00
|
|
|
};
|
2008-12-20 01:20:35 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
patches = [./fix.patch];
|
|
|
|
|
|
|
|
})
|