summary refs log tree commit diff
path: root/pkgs/development/interpreters/php_configurable/default.nix
diff options
context:
space:
mode:
authorMarc Weber <marco-oweber@gmx.de>2008-12-20 01:20:35 +0000
committerMarc Weber <marco-oweber@gmx.de>2008-12-20 01:20:35 +0000
commite996113be7f41f067aaefac881c540b5ceb8d2d4 (patch)
tree177f16552ca2d05020c3d45a0b45502556a09502 /pkgs/development/interpreters/php_configurable/default.nix
parent5ab6464edb9bbc2a9aa15122ffc02b57ad236bb7 (diff)
downloadnixpkgs-e996113be7f41f067aaefac881c540b5ceb8d2d4.tar
nixpkgs-e996113be7f41f067aaefac881c540b5ceb8d2d4.tar.gz
nixpkgs-e996113be7f41f067aaefac881c540b5ceb8d2d4.tar.bz2
nixpkgs-e996113be7f41f067aaefac881c540b5ceb8d2d4.tar.lz
nixpkgs-e996113be7f41f067aaefac881c540b5ceb8d2d4.tar.xz
nixpkgs-e996113be7f41f067aaefac881c540b5ceb8d2d4.tar.zst
nixpkgs-e996113be7f41f067aaefac881c540b5ceb8d2d4.zip
removed mkDerivationByConfiguration, using composableDerivation instead
qgis, vim_configurable both work now

svn path=/nixpkgs/trunk/; revision=13661
Diffstat (limited to 'pkgs/development/interpreters/php_configurable/default.nix')
-rw-r--r--pkgs/development/interpreters/php_configurable/default.nix199
1 files changed, 102 insertions, 97 deletions
diff --git a/pkgs/development/interpreters/php_configurable/default.nix b/pkgs/development/interpreters/php_configurable/default.nix
index d10efcec802..d079c83f364 100644
--- a/pkgs/development/interpreters/php_configurable/default.nix
+++ b/pkgs/development/interpreters/php_configurable/default.nix
@@ -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... 
+    name = "php_configurable-${version}";
 
-    mandatory = { buildInputs = ["flex" "bison" "pkgconfig"]; };
+    buildInputs = ["flex" "bison" "pkgconfig"];
 
-    # SAPI modules:
-    
-    apxs2 = {
-      cfgOption = "--with-apxs2=\$apacheHttpd/bin/apxs";
-      pass = "apacheHttpd";
-    };
+    flags = {
 
-    # Extensions 
+# much left to do here...
 
-    curl = {
-      cfgOption = "--with-curl=${args.curl} --with-curlwrappers";
-      pass = "curl";
-    };
+      # SAPI modules:
       
-    zlib = {
-      cfgOption = "--with-zlib=${args.zlib}";
-      pass = "zlib";
-    };
+        apxs2 = {
+          configureFlags = ["--with-apxs2=${apacheHttpd}/bin/apxs"];
+          buildInputs = [apacheHttpd];
+        };
 
-    libxml2 = {
-      cfgOption = "--with-libxml-dir=\$libxml2";
-      pass = { inherit (args) libxml2; }; 
-    };
-    
-    no_libxml2 = {
-      cfgOption = "--disable-libxml";
-    };
+        # Extensions
 
-    postgresql = {
-      cfgOption = "--with-pgsql=\$postgresql";
-      pass = { inherit (args) postgresql; };
-    };
-    
-    mysql = {
-      cfgOption = "--with-mysql=\$mysql";
-      pass = { inherit (args) mysql; };
-    };
+        curl = {
+          configureFlags = ["--with-curl=${args.curl}" "--with-curlwrappers"];
+          buildInputs = [curl];
+        };
+        
+        zlib = {
+          configureFlags = ["--with-zlib=${args.zlib}"];
+          buildInputs = [zlib];
+        };
 
-    mysqli = {
-      cfgOption = "--with-mysqli=\$mysql/bin/mysql_config";
-      pass = { inherit (args) mysql; }; 
-    };
+        libxml2 = {
+          configureFlags = ["--with-libxml-dir=${libxml2}"];
+          buildInputs = [ libxml2 ];
+        };
+      
+        postgresql = {
+          configureFlags = ["--with-pgsql=${postgresql}"];
+          buildInputs = [ postgresql ];
+        };
+      
+        mysql = {
+          configureFlags = ["--with-mysql=${mysql}"];
+          buildInputs = [ mysql ];
+        };
 
-    mysqli_embedded = {
-      cfgOption = "--enable-embedded-mysqli";
-      depends = "mysqli";
-    };
+        mysqli = {
+          configureFlags = ["--with-mysqli=${mysql}/bin/mysql_config"];
+          buildInputs = [ mysql];
+        };
 
-    pdo_mysql = {
-      cfgOption = "--with-pdo-mysql=\$mysql";
-      pass = { inherit (args) mysql; }; 
-    };
-    
-    no_pdo_mysql = { };
+        mysqli_embedded = {
+          configureFlags = ["--enable-embedded-mysqli"];
+          depends = "mysqli";
+          assertion = fixed.mysqliSupport;
+        };
 
-    bcmath = {
-      cfgOption = "--enable-bcmath";
-    };
+        pdo_mysql = {
+          configureFlags = ["--with-pdo-mysql=${mysql}"];
+          buildInputs = [ mysql ];
+        };
+      
+        bcmath = {
+          configureFlags = ["--enable-bcmath"];
+        };
 
-    gd = {
-      cfgOption = "--with-gd=${args.gd}";
-      buildInputs = ["gd"]; # <-- urgh, these strings are ugly
-    };
+        gd = {
+          configureFlags = ["--with-gd=${args.gd}"];
+          buildInputs = [gd];
+        };
 
-    sockets = {
-      cfgOption = "--enable-sockets";
-    };
+        sockets = {
+          configureFlags = ["--enable-sockets"];
+        };
 
-    openssl = {
-      cfgOption = "--with-openssl=${args.openssl}";
-      buildInputs = ["openssl"];
-    };
+        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" ];
-      pass = {
-        xdebug_src = args.fetchurl {
-          name = "xdebug-2.0.2.tar.gz";
-          url = "http://xdebug.org/link.php?url=xdebug202";
-          sha256 = "1h0bxvf8krr203fmk1k7izrrr81gz537xmd3pqh4vslwdlbhrvic";
+        /*
+           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";
+          };
         };
       };
-    };
-
-  };
-
-  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;
+    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
+
+}