2008-12-20 01:20:35 +00:00
|
|
|
args: with args;
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2010-05-29 19:26:54 +01:00
|
|
|
let
|
|
|
|
|
|
|
|
inherit (args.composableDerivation) composableDerivation edf wwf;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2011-04-29 22:01:09 +01:00
|
|
|
version = "5.3.6";
|
2007-11-05 21:13:16 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
name = "php_configurable-${version}";
|
2007-11-05 21:13:16 +00:00
|
|
|
|
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
|
|
|
|
2008-12-20 01:20:35 +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:
|
|
|
|
|
|
|
|
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 = {
|
|
|
|
configureFlags = ["--with-curl=${args.curl}" "--with-curlwrappers"];
|
2009-04-27 02:18:03 +01:00
|
|
|
buildInputs = [curl openssl];
|
2009-03-06 23:21:28 +00:00
|
|
|
};
|
2008-12-20 01:20:35 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
zlib = {
|
|
|
|
configureFlags = ["--with-zlib=${args.zlib}"];
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
postgresql = {
|
|
|
|
configureFlags = ["--with-pgsql=${postgresql}"];
|
|
|
|
buildInputs = [ postgresql ];
|
|
|
|
};
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
bcmath = {
|
|
|
|
configureFlags = ["--enable-bcmath"];
|
|
|
|
};
|
2008-08-31 07:36:56 +01:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
gd = {
|
|
|
|
configureFlags = ["--with-gd=${args.gd}"];
|
2010-05-29 19:26:54 +01:00
|
|
|
buildInputs = [gd libpng libjpeg ];
|
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 = {
|
|
|
|
configureFlags = ["--with-openssl=${args.openssl}"];
|
|
|
|
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"];
|
|
|
|
};
|
2007-11-05 21:13:16 +00:00
|
|
|
|
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 = {
|
2009-09-25 20:39:05 +01:00
|
|
|
mysqlSupport = getConfig ["php" "mysql"] true;
|
|
|
|
mysqliSupport = getConfig ["php" "mysqli"] true;
|
|
|
|
pdo_mysqlSupport = getConfig ["php" "pdo_mysql"] true;
|
|
|
|
libxml2Support = getConfig ["php" "libxml2"] true;
|
|
|
|
apxs2Support = getConfig ["php" "apxs2"] true;
|
|
|
|
bcmathSupport = getConfig ["php" "bcmath"] true;
|
|
|
|
socketsSupport = getConfig ["php" "sockets"] true;
|
|
|
|
curlSupport = getConfig ["php" "curl"] true;
|
|
|
|
gettextSupport = getConfig ["php" "gettext"] true;
|
|
|
|
postgresqlSupport = getConfig ["php" "postgresql"] true;
|
2011-05-03 09:25:45 +01:00
|
|
|
readlineSupport = getConfig ["php" "readline"] true;
|
2009-09-25 20:39:05 +01:00
|
|
|
sqliteSupport = getConfig ["php" "sqlite"] true;
|
|
|
|
soapSupport = getConfig ["php" "soap"] true;
|
|
|
|
zlibSupport = getConfig ["php" "zlib"] true;
|
|
|
|
opensslSupport = getConfig ["php" "openssl"] true;
|
|
|
|
mbstringSupport = getConfig ["php" "mbstring"] true;
|
|
|
|
gdSupport = getConfig ["php" "gd"] 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;
|
2010-05-29 19:26:54 +01:00
|
|
|
cp php.ini-${ if builtins.lessThan (builtins.compareVersions version "5.3") 0
|
|
|
|
then "recommended" /* < PHP 5.3 */
|
|
|
|
else "production" /* >= PHP 5.3 */
|
|
|
|
} $iniFile
|
2009-03-06 23:21:28 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
src = args.fetchurl {
|
|
|
|
url = "http://nl.php.net/get/php-${version}.tar.bz2/from/this/mirror";
|
2011-04-29 22:01:09 +01:00
|
|
|
sha256 = "161iimjsnbvzqbf6chxv778n8qqdig2y704vrkn97vp3487qibih";
|
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];
|
|
|
|
|
|
|
|
})
|