Commit:    633b87d69ea1d3c48503f50ac4d0b7577b84ed15
Author:    Anatol Belski <[email protected]>         Fri, 13 Sep 2013 11:54:06 +0200
Parents:   064aa8b90013d89b2a26bcf8717df194b4d483dd
Branches:  master

Link:       
http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=633b87d69ea1d3c48503f50ac4d0b7577b84ed15

Log:
implemented mechanism to compile with non core ext deps

Changed paths:
  M  client/data/config/pecl/exts.ini
  M  client/data/config/pecl/pecl53.ini
  M  client/data/config/pecl/pecl54.ini
  M  client/data/config/pecl/pecl55_x64.ini
  M  client/data/config/pecl/pecl55_x86.ini
  M  client/include/BranchConfig.php
  M  client/include/PeclExt.php
  M  client/script/pecl.php


Diff:
diff --git a/client/data/config/pecl/exts.ini b/client/data/config/pecl/exts.ini
index 290ff2b..d7e93c2 100644
--- a/client/data/config/pecl/exts.ini
+++ b/client/data/config/pecl/exts.ini
@@ -192,3 +192,19 @@ libs[]=
 exts[]=
 opts[]=
 
+[memoize]
+type=enable
+libs[]=
+exts[]=apc
+;exts[]=memcached
+opts[]=--enable-memoize-memory
+opts[]=--enable-memoize-apc
+;opts[]=--enable-memoize-memcached
+
+[igbinary]
+type=enable
+libs[]=
+exts[]=apc
+opts[]=
+
+
diff --git a/client/data/config/pecl/pecl53.ini 
b/client/data/config/pecl/pecl53.ini
index d3133f3..001d286 100644
--- a/client/data/config/pecl/pecl53.ini
+++ b/client/data/config/pecl/pecl53.ini
@@ -7,6 +7,7 @@ appver=xp
 debug=0
 pgo=0
 pecl_deps_base=c:/pecl-dep-libs/vc9/x86
+pecl_non_core_ext_deps_base=c:/pecl-dep-ext
 arch=x86
 compiler=vc9
 
diff --git a/client/data/config/pecl/pecl54.ini 
b/client/data/config/pecl/pecl54.ini
index 55456d5..e56d78c 100644
--- a/client/data/config/pecl/pecl54.ini
+++ b/client/data/config/pecl/pecl54.ini
@@ -7,6 +7,7 @@ appver=xp
 debug=0
 pgo=0
 pecl_deps_base=c:/pecl-dep-libs/vc9/x86
+pecl_non_core_ext_deps_base=c:/pecl-dep-ext
 arch=x86
 compiler=vc9
 
diff --git a/client/data/config/pecl/pecl55_x64.ini 
b/client/data/config/pecl/pecl55_x64.ini
index 4a74a66..4b96d5f 100644
--- a/client/data/config/pecl/pecl55_x64.ini
+++ b/client/data/config/pecl/pecl55_x64.ini
@@ -9,6 +9,7 @@ pgo=0
 compiler=vc11
 arch=x64
 pecl_deps_base=c:/pecl-dep-libs/vc11/x64
+pecl_non_core_ext_deps_base=c:/pecl-dep-ext
 
 [build-nts-windows-vc11-x64]
 name=nts-windows-vc11-x64
diff --git a/client/data/config/pecl/pecl55_x86.ini 
b/client/data/config/pecl/pecl55_x86.ini
index 1cd665c..b20c33e 100644
--- a/client/data/config/pecl/pecl55_x86.ini
+++ b/client/data/config/pecl/pecl55_x86.ini
@@ -9,6 +9,7 @@ pgo=0
 compiler=vc11
 arch=x86
 pecl_deps_base=c:/pecl-dep-libs/vc11/x86
+pecl_non_core_ext_deps_base=c:/pecl-dep-ext
 
 [build-nts-windows-vc11-x86]
 name=nts-windows-vc11-x86
diff --git a/client/include/BranchConfig.php b/client/include/BranchConfig.php
index 96d8cce..e238ee7 100644
--- a/client/include/BranchConfig.php
+++ b/client/include/BranchConfig.php
@@ -23,6 +23,7 @@ class BranchConfig {
                'Appver'                => 'appver',
                'BuildSrcSubdir'        => 'build_src_subdir',
                'PeclDepsBase'  => 'pecl_deps_base',
+               'PeclNonCoreExtDepsBase' => 'pecl_non_core_ext_deps_base',
        );
 
        function __construct($path)
diff --git a/client/include/PeclExt.php b/client/include/PeclExt.php
index e8947e9..ce4d412 100644
--- a/client/include/PeclExt.php
+++ b/client/include/PeclExt.php
@@ -22,6 +22,7 @@ class PeclExt
        protected $ext_dir_in_src_path = NULL;
        protected $package_xml = NULL;
        protected $configure_data = NULL;
+       protected $non_core_ext_deps = array();
 
        public function __construct($pgk_path, $build)
        {
@@ -286,7 +287,13 @@ class PeclExt
                }
 
                if (isset($data['exts']) && $data['exts']) {
-                       /* TODO */
+                       if (empty($this->non_core_ext_deps)) {
+                                $this->setupNonCoreExtDeps();
+                       }
+                       if (!empty($this->non_core_ext_deps)) {
+                               $ret .= ' ';
+                               $ret .= $this->getNonCoreExtDepsConfLines();
+                       }
                } else {
                        $data['exts'] = array();
                }
@@ -464,6 +471,8 @@ class PeclExt
                if ($flag0 && file_exists($log_pack)) {
                        unlink($log_pack);
                }
+
+               $this->cleanupNonCoreExtDeps();
        }
 
        public function check()
@@ -573,5 +582,92 @@ class PeclExt
                        }
                }
        }
+
+       public function setupNonCoreExtDeps()
+       {
+               $config = $this->getPackageConfig();
+               if (!$config) {
+                       /* XXX read non core ext deps from the package.xml 
maybe? */
+                       return;
+               }
+
+               if (!isset($config['exts']) || !is_array($config['exts'])) {
+                       continue;
+               }
+
+               $path = 
$this->build->branch->config->getPeclNonCoreExtDepsBase();
+
+               foreach($config["exts"] as $name) {
+                       if (!$name) {
+                               continue;
+                       }
+
+                       $pkgs = glob("$path/*");
+
+                       if (!$pkgs) {
+                               continue;
+                       }
+
+                       foreach ($pkgs as $pkg) {
+                               $ext = new PeclExt($pkg, $this->build);
+
+                               if (strtolower($ext->getName()) == 
strtolower($name)
+                                       && 
!isset($this->non_core_ext_deps[$ext->getName])
+                                       /* Avoid an ext having itself as dep */
+                                       && strtolower($ext->getName()) != 
strtolower($this->name)) {
+
+                                       $ext->setupNonCoreExtDeps();
+                                       $ext->putSourcesIntoBranch();
+
+                                       
$this->non_core_ext_deps[$ext->getName()] = $ext;
+                               } else {
+                                       $ext->cleanup();
+                                       unset($ext);
+                               }
+                       }
+               }
+
+               return $this->non_core_ext_deps;
+       }
+
+       /* the simple variant, all the usual non core exts will be built on 
each run. */
+       /*public function setupNonCoreExtDeps()
+       {
+               $path = 
$this->build->branch->config->getPeclNonCoreExtDepsBase();
+
+               $pkgs = glob("$path/*");
+
+               foreach($pkgs as $pkg) {
+                       $ext = new PeclExt($pkg, $this->build);
+
+                       if ($ext->getName() != $this->name) {
+                               $ext->putSourcesIntoBranch();
+
+                               $this->non_core_ext_deps[$ext->getName()] = 
$ext;
+                       } else {
+                               $ext->cleanup();
+                               unset($ext);
+                       }
+               }
+       }*/
+
+       public function getNonCoreExtDepsConfLines()
+       {
+               $ret = array();
+
+               foreach ($this->non_core_ext_deps as $ext) {
+                       $ret[] = $ext->getConfigureLine();
+               }
+       
+               return implode(' ', $ret);
+       }
+
+
+       protected function cleanupNonCoreExtDeps()
+       {
+               foreach ($this->non_core_ext_deps as $ext) {
+                       $ext->cleanup();
+               }
+       }
 }
 
diff --git a/client/script/pecl.php b/client/script/pecl.php
index 47f6d91..d565b5a 100644
--- a/client/script/pecl.php
+++ b/client/script/pecl.php
@@ -69,6 +69,7 @@ foreach ($builds as $build_name) {
 
        try {
                $ext = new rm\PeclExt($pkg_path, $build);
+               $ext->setupNonCoreExtDeps();
        } catch (Exception $e) {
                echo $e->getMessage() . PHP_EOL;


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to