2012-10-15 15:14:26 +00: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
|
|
|
|
, openssl, pkgconfig, sqlite, config, libiconv, libjpeg, libpng, freetype }:
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2012-10-15 15:14:26 +00:00
|
|
|
composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
|
2010-05-29 18:26:54 +00:00
|
|
|
|
2012-10-26 13:20:34 +00:00
|
|
|
version = "5.3.18";
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2011-07-18 20:50:59 +00:00
|
|
|
name = "php-${version}";
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2012-10-15 15:14:26 +00: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 15:14:26 +00: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 15:14:26 +00: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 15:14:26 +00:00
|
|
|
configureFlags = ["--with-curl=${curl}" "--with-curlwrappers"];
|
2009-04-27 01:18:03 +00:00
|
|
|
buildInputs = [curl openssl];
|
2009-03-06 23:21:28 +00:00
|
|
|
};
|
2012-10-15 15:14:26 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
zlib = {
|
2012-10-15 15:14:26 +00: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 18:26:54 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-libxml-dir=${libxml2}"
|
|
|
|
"--with-iconv-dir=${libiconv}"
|
|
|
|
];
|
2009-03-06 23:21:28 +00:00
|
|
|
buildInputs = [ libxml2 ];
|
|
|
|
};
|
2012-10-15 15:14:26 +00:00
|
|
|
|
2011-05-03 08:25:45 +00:00
|
|
|
readline = {
|
|
|
|
configureFlags = ["--with-readline=${readline}"];
|
|
|
|
buildInputs = [ readline ];
|
|
|
|
};
|
|
|
|
|
2009-05-13 10:43:34 +00:00
|
|
|
sqlite = {
|
|
|
|
configureFlags = ["--with-pdo-sqlite=${sqlite}"];
|
|
|
|
buildInputs = [ sqlite ];
|
|
|
|
};
|
2012-10-15 15:14:26 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
postgresql = {
|
|
|
|
configureFlags = ["--with-pgsql=${postgresql}"];
|
|
|
|
buildInputs = [ postgresql ];
|
|
|
|
};
|
2012-10-15 15:14:26 +00: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 15:14:26 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
bcmath = {
|
|
|
|
configureFlags = ["--enable-bcmath"];
|
|
|
|
};
|
2008-08-31 06:36:56 +00: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 06:36:56 +00:00
|
|
|
|
2009-06-14 01:30:04 +00: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 15:14:26 +00:00
|
|
|
configureFlags = ["--with-openssl=${openssl}"];
|
2009-03-06 23:21:28 +00:00
|
|
|
buildInputs = ["openssl"];
|
2008-06-06 13:03:55 +00: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
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
/*
|
2009-10-23 08:56:46 +00: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 11:30:20 +00: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 17:56:56 +00: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;
|
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 17:46:50 +00:00
|
|
|
cp php.ini-production $iniFile
|
2009-03-06 23:21:28 +00:00
|
|
|
'';
|
|
|
|
|
2012-10-15 15:14:26 +00: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 13:20:34 +00: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];
|
|
|
|
|
|
|
|
})
|