removed mkDerivationByConfiguration, using composableDerivation instead

qgis, vim_configurable both work now

svn path=/nixpkgs/trunk/; revision=13661
This commit is contained in:
Marc Weber
2008-12-20 01:20:35 +00:00
parent 5ab6464edb
commit e996113be7
22 changed files with 661 additions and 1230 deletions

View File

@@ -1,122 +1,126 @@
let version = "5.2.6"; in
args:
args: with args;
(args.mkDerivationByConfiguration {
let inherit (args.composableDerivation) composableDerivation edf wwf; in
flagConfig = {
composableDerivation {
initial = fixed : {
# much left to do here...
mandatory = { buildInputs = ["flex" "bison" "pkgconfig"]; };
# SAPI modules:
apxs2 = {
cfgOption = "--with-apxs2=\$apacheHttpd/bin/apxs";
pass = "apacheHttpd";
};
# Extensions
curl = {
cfgOption = "--with-curl=${args.curl} --with-curlwrappers";
pass = "curl";
};
zlib = {
cfgOption = "--with-zlib=${args.zlib}";
pass = "zlib";
};
libxml2 = {
cfgOption = "--with-libxml-dir=\$libxml2";
pass = { inherit (args) libxml2; };
};
no_libxml2 = {
cfgOption = "--disable-libxml";
};
postgresql = {
cfgOption = "--with-pgsql=\$postgresql";
pass = { inherit (args) postgresql; };
};
mysql = {
cfgOption = "--with-mysql=\$mysql";
pass = { inherit (args) mysql; };
};
mysqli = {
cfgOption = "--with-mysqli=\$mysql/bin/mysql_config";
pass = { inherit (args) mysql; };
};
mysqli_embedded = {
cfgOption = "--enable-embedded-mysqli";
depends = "mysqli";
};
pdo_mysql = {
cfgOption = "--with-pdo-mysql=\$mysql";
pass = { inherit (args) mysql; };
};
no_pdo_mysql = { };
bcmath = {
cfgOption = "--enable-bcmath";
};
gd = {
cfgOption = "--with-gd=${args.gd}";
buildInputs = ["gd"]; # <-- urgh, these strings are ugly
};
sockets = {
cfgOption = "--enable-sockets";
};
openssl = {
cfgOption = "--with-openssl=${args.openssl}";
buildInputs = ["openssl"];
};
/*
Building xdebug withing php to be able to add the parameters to the ini file.. Ther should be a better way
meta = {
description = "debugging support for PHP";
homepage = http://xdebug.org;
license = "based on the PHP license - as is";
};
*/
xdebug = {
buildInputs = [ "automake" "autoconf" ];
pass = {
xdebug_src = args.fetchurl {
name = "xdebug-2.0.2.tar.gz";
url = "http://xdebug.org/link.php?url=xdebug202";
sha256 = "1h0bxvf8krr203fmk1k7izrrr81gz537xmd3pqh4vslwdlbhrvic";
};
};
};
};
defaults = [ "mysql" "mysqli" "pdo_mysql" "libxml2" "apxs2" "bcmath" ];
optionals = [ "libxml2" "gettext" "postgresql" "zlib" "openssl" ];
extraAttrs = co: {
name = "php_configurable-${version}";
buildInputs = args.lib.getAttr ["phpIncludes"] [] args ++ co.buildInputs;
buildInputs = ["flex" "bison" "pkgconfig"];
flags = {
# much left to do here...
# SAPI modules:
apxs2 = {
configureFlags = ["--with-apxs2=${apacheHttpd}/bin/apxs"];
buildInputs = [apacheHttpd];
};
# Extensions
curl = {
configureFlags = ["--with-curl=${args.curl}" "--with-curlwrappers"];
buildInputs = [curl];
};
zlib = {
configureFlags = ["--with-zlib=${args.zlib}"];
buildInputs = [zlib];
};
libxml2 = {
configureFlags = ["--with-libxml-dir=${libxml2}"];
buildInputs = [ libxml2 ];
};
postgresql = {
configureFlags = ["--with-pgsql=${postgresql}"];
buildInputs = [ postgresql ];
};
mysql = {
configureFlags = ["--with-mysql=${mysql}"];
buildInputs = [ mysql ];
};
mysqli = {
configureFlags = ["--with-mysqli=${mysql}/bin/mysql_config"];
buildInputs = [ mysql];
};
mysqli_embedded = {
configureFlags = ["--enable-embedded-mysqli"];
depends = "mysqli";
assertion = fixed.mysqliSupport;
};
pdo_mysql = {
configureFlags = ["--with-pdo-mysql=${mysql}"];
buildInputs = [ mysql ];
};
bcmath = {
configureFlags = ["--enable-bcmath"];
};
gd = {
configureFlags = ["--with-gd=${args.gd}"];
buildInputs = [gd];
};
sockets = {
configureFlags = ["--enable-sockets"];
};
openssl = {
configureFlags = ["--with-openssl=${args.openssl}"];
buildInputs = ["openssl"];
};
/*
Building xdebug withing php to be able to add the parameters to the ini file.. Ther should be a better way
meta = {
description = "debugging support for PHP";
homepage = http://xdebug.org;
license = "based on the PHP license - as is";
};
*/
xdebug = {
buildInputs = [ automake autoconf ];
xdebug_src = args.fetchurl {
name = "xdebug-2.0.2.tar.gz";
url = "http://xdebug.org/link.php?url=xdebug202";
sha256 = "1h0bxvf8krr203fmk1k7izrrr81gz537xmd3pqh4vslwdlbhrvic";
};
};
};
cfg = {
mysqlSupport = true;
mysqliSupport = true;
pdo_mysqlSupport = true;
libxml2Support = true;
apxs2Support = true;
bcmathSupport = true;
socketsSupport = true;
curlSupport = true;
gettextSupport = true;
postgresqlSupport = true;
zlibSupport = true;
opnesslSupport = true;
xdebugSupport = true;
};
configurePhase = ''
iniFile=$out/etc/$name.ini
[[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out ${co.configureFlags}
./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
echo configurePhase end
'';
@@ -124,11 +128,11 @@ args:
unset installPhase; installPhase;
cp php.ini-recommended $iniFile
# Now Let's build xdebug if flag has been given
# Now Let's build xdebug if flag has been given
# TODO I think there are better paths than the given below
if [ -n $flag_set_xdebug ]; then
PATH=$PATH:$out/bin
tar xfz $xdebug_src;
tar xfz $xdebug_src;
cd xdebug*
phpize
./configure --prefix=$out
@@ -157,13 +161,14 @@ args:
name = "php-${version}.tar.bz2";
};
meta = {
meta = {
description = "The PHP language runtime engine";
homepage = http://www.php.net/;
license = "PHP-3";
};
patches = [./fix.patch];
};
}) args
}