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-06-15 12:57:05 +01:00
|
|
|
, openssl, pkgconfig, sqlite, config, libjpeg, libpng, freetype, libxslt
|
|
|
|
, libmcrypt, bzip2, icu, libssh2, makeWrapper, libiconvOrEmpty, libiconv }:
|
2013-02-12 18:33:39 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2013-05-17 13:06:12 +01:00
|
|
|
version = "5.3.25";
|
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;
|
|
|
|
|
2013-06-15 12:57:05 +01:00
|
|
|
buildInputs
|
|
|
|
= [ flex bison pkgconfig ]
|
|
|
|
++ stdenv.lib.optionals stdenv.isDarwin [ libssh2 makeWrapper ];
|
|
|
|
|
|
|
|
# need to include the C++ standard library when compiling on darwin
|
|
|
|
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lstdc++";
|
|
|
|
|
|
|
|
# need to specify where the dylib for icu is stored
|
|
|
|
DYLD_LIBRARY_PATH = stdenv.lib.optionalString stdenv.isDarwin "${icu}/lib";
|
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 = {
|
2013-06-15 12:57:05 +01:00
|
|
|
configureFlags
|
|
|
|
= [ "--with-libxml-dir=${libxml2}" ]
|
|
|
|
++ stdenv.lib.optional (libiconvOrEmpty != [])
|
|
|
|
[ "--with-iconv=${libiconv}" ];
|
|
|
|
buildInputs = [ libxml2 ] ++ libiconvOrEmpty;
|
2009-03-06 23:21:28 +00:00
|
|
|
};
|
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 = {
|
2013-06-15 12:57:05 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-gd"
|
|
|
|
"--with-freetype-dir=${freetype}"
|
|
|
|
"--with-png-dir=${libpng}"
|
|
|
|
"--with-jpeg-dir=${libjpeg}"
|
|
|
|
];
|
2012-12-01 20:17:50 +00:00
|
|
|
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-01-26 12:17:31 +00:00
|
|
|
intl = {
|
|
|
|
configureFlags = ["--enable-intl"];
|
|
|
|
buildInputs = [icu];
|
|
|
|
};
|
|
|
|
|
|
|
|
exif = {
|
|
|
|
configureFlags = ["--enable-exif"];
|
|
|
|
};
|
|
|
|
|
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];
|
|
|
|
};
|
|
|
|
|
2013-02-12 20:23:24 +00:00
|
|
|
bz2 = {
|
|
|
|
configureFlags = ["--with-bz2=${bzip2}"];
|
|
|
|
buildInputs = [bzip2];
|
|
|
|
};
|
|
|
|
|
|
|
|
zip = {
|
|
|
|
configureFlags = ["--enable-zip"];
|
|
|
|
};
|
|
|
|
|
2013-04-02 11:38:42 +01:00
|
|
|
ftp = {
|
|
|
|
configureFlags = ["--enable-ftp"];
|
|
|
|
};
|
|
|
|
|
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-01-26 12:17:31 +00:00
|
|
|
intlSupport = config.php.intl or true;
|
|
|
|
exifSupport = config.php.exif 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;
|
2013-02-12 20:23:24 +00:00
|
|
|
bz2Support = config.php.bz2 or false;
|
|
|
|
zipSupport = config.php.zip or true;
|
2013-04-02 11:38:42 +01:00
|
|
|
ftpSupport = config.php.ftp 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
|
2013-01-26 12:17:31 +00:00
|
|
|
./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
|
2009-03-06 23:21:28 +00:00
|
|
|
echo configurePhase end
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
unset installPhase; installPhase;
|
2012-07-23 18:46:50 +01:00
|
|
|
cp php.ini-production $iniFile
|
2013-06-15 12:57:05 +01:00
|
|
|
'' + ( stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
for prog in $out/bin/*; do
|
|
|
|
wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "$DYLD_LIBRARY_PATH"
|
|
|
|
done
|
|
|
|
'' );
|
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";
|
2013-05-17 13:06:12 +01:00
|
|
|
sha256 = "15dwks0823m0vc3qv58yxfvchwx9ydg5gjvjy8kpc5w3syras76m";
|
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";
|
2013-06-15 12:57:05 +01:00
|
|
|
homepage = http://www.php.net/;
|
|
|
|
license = "PHP-3";
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ lovek323 ];
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
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];
|
|
|
|
|
|
|
|
})
|