2008-12-20 02:20:35 +01:00
|
|
|
args: with args;
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2010-05-29 20:26:54 +02:00
|
|
|
let
|
|
|
|
|
|
|
|
inherit (args.composableDerivation) composableDerivation edf wwf;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2010-11-26 15:26:15 +01:00
|
|
|
version = "5.2.14";
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2011-07-18 22:50:59 +02:00
|
|
|
name = "php-${version}";
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
buildInputs = ["flex" "bison" "pkgconfig"];
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
flags = {
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2008-12-20 02:20:35 +01:00
|
|
|
# much left to do here...
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
# SAPI modules:
|
|
|
|
|
|
|
|
apxs2 = {
|
|
|
|
configureFlags = ["--with-apxs2=${apacheHttpd}/bin/apxs"];
|
|
|
|
buildInputs = [apacheHttpd];
|
|
|
|
};
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
# Extensions
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
curl = {
|
|
|
|
configureFlags = ["--with-curl=${args.curl}" "--with-curlwrappers"];
|
2009-04-27 03:18:03 +02:00
|
|
|
buildInputs = [curl openssl];
|
2009-03-07 00:21:28 +01:00
|
|
|
};
|
2008-12-20 02:20:35 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
zlib = {
|
|
|
|
configureFlags = ["--with-zlib=${args.zlib}"];
|
|
|
|
buildInputs = [zlib];
|
|
|
|
};
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
libxml2 = {
|
2010-05-29 20:26:54 +02:00
|
|
|
configureFlags = [
|
|
|
|
"--with-libxml-dir=${libxml2}"
|
|
|
|
"--with-iconv-dir=${libiconv}"
|
|
|
|
];
|
2009-03-07 00:21:28 +01:00
|
|
|
buildInputs = [ libxml2 ];
|
|
|
|
};
|
2011-05-03 10:25:45 +02:00
|
|
|
|
|
|
|
readline = {
|
|
|
|
configureFlags = ["--with-readline=${readline}"];
|
|
|
|
buildInputs = [ readline ];
|
|
|
|
};
|
2009-03-07 00:21:28 +01:00
|
|
|
|
2009-05-13 12:43:34 +02:00
|
|
|
sqlite = {
|
|
|
|
configureFlags = ["--with-pdo-sqlite=${sqlite}"];
|
|
|
|
buildInputs = [ sqlite ];
|
|
|
|
};
|
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
postgresql = {
|
|
|
|
configureFlags = ["--with-pgsql=${postgresql}"];
|
|
|
|
buildInputs = [ postgresql ];
|
|
|
|
};
|
|
|
|
|
|
|
|
mysql = {
|
|
|
|
configureFlags = ["--with-mysql=${mysql}"];
|
|
|
|
buildInputs = [ mysql ];
|
|
|
|
};
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
mysqli = {
|
|
|
|
configureFlags = ["--with-mysqli=${mysql}/bin/mysql_config"];
|
|
|
|
buildInputs = [ mysql];
|
|
|
|
};
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
mysqli_embedded = {
|
|
|
|
configureFlags = ["--enable-embedded-mysqli"];
|
|
|
|
depends = "mysqli";
|
|
|
|
assertion = fixed.mysqliSupport;
|
|
|
|
};
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
pdo_mysql = {
|
|
|
|
configureFlags = ["--with-pdo-mysql=${mysql}"];
|
|
|
|
buildInputs = [ mysql ];
|
|
|
|
};
|
|
|
|
|
|
|
|
bcmath = {
|
|
|
|
configureFlags = ["--enable-bcmath"];
|
|
|
|
};
|
2008-08-31 08:36:56 +02:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
gd = {
|
|
|
|
configureFlags = ["--with-gd=${args.gd}"];
|
2010-05-29 20:26:54 +02:00
|
|
|
buildInputs = [gd libpng libjpeg ];
|
2009-03-07 00:21:28 +01:00
|
|
|
};
|
2008-08-31 08:36:56 +02:00
|
|
|
|
2009-06-14 03:30:04 +02:00
|
|
|
soap = {
|
|
|
|
configureFlags = ["--enable-soap"];
|
|
|
|
};
|
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
sockets = {
|
|
|
|
configureFlags = ["--enable-sockets"];
|
|
|
|
};
|
2009-01-04 21:18:20 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
openssl = {
|
|
|
|
configureFlags = ["--with-openssl=${args.openssl}"];
|
|
|
|
buildInputs = ["openssl"];
|
2008-06-06 15:03:55 +02:00
|
|
|
};
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
mbstring = {
|
|
|
|
configureFlags = ["--enable-mbstring"];
|
|
|
|
};
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
/*
|
2009-10-23 10:56:46 +02: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 13:30:20 +02:00
|
|
|
* /
|
2009-03-07 00:21:28 +01:00
|
|
|
meta = {
|
|
|
|
description = "debugging support for PHP";
|
|
|
|
homepage = http://xdebug.org;
|
|
|
|
license = "based on the PHP license - as is";
|
|
|
|
};
|
|
|
|
*/
|
2007-11-05 22:13:16 +01:00
|
|
|
};
|
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
cfg = {
|
2009-09-25 21:39:05 +02: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 10:25:45 +02:00
|
|
|
readlineSupport = getConfig ["php" "readline"] true;
|
2009-09-25 21:39:05 +02: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-07 00:21:28 +01:00
|
|
|
};
|
2007-11-05 22:13:16 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
configurePhase = ''
|
2010-01-06 18:04:38 +01:00
|
|
|
iniFile=$out/etc/php-recommended.ini
|
2009-03-07 00:21:28 +01: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 20:26:54 +02: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-07 00:21:28 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
src = args.fetchurl {
|
|
|
|
url = "http://nl.php.net/get/php-${version}.tar.bz2/from/this/mirror";
|
2010-11-26 15:26:15 +01:00
|
|
|
sha256 = "1l9b7iv0f6ds9x2ayclcfgjh62xbabbv11ixp5cqsyaq2ba5ynsi";
|
2009-03-07 00:21:28 +01:00
|
|
|
name = "php-${version}.tar.bz2";
|
|
|
|
};
|
2008-12-20 02:20:35 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
meta = {
|
|
|
|
description = "The PHP language runtime engine";
|
|
|
|
homepage = http://www.php.net/;
|
|
|
|
license = "PHP-3";
|
2007-11-05 22:13:16 +01:00
|
|
|
};
|
2008-12-20 02:20:35 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
patches = [./fix.patch];
|
|
|
|
|
|
|
|
})
|