[jhbuild/wip/sysdeps: 2/3] Parse 'pkg-config' attribute on modules



commit 2bcd8929a52100eea8c3f546199159c4f96c2a54
Author: Colin Walters <walters verbum org>
Date:   Thu Jun 23 16:59:56 2011 -0400

    Parse 'pkg-config' attribute on modules
    
    https://bugzilla.gnome.org/show_bug.cgi?id=564373

 jhbuild/modtypes/__init__.py  |    3 ++-
 jhbuild/modtypes/autotools.py |    5 ++++-
 jhbuild/modtypes/cmake.py     |    7 ++++---
 jhbuild/modtypes/distutils.py |    7 ++++---
 jhbuild/modtypes/perl.py      |    7 ++++---
 jhbuild/modtypes/tarball.py   |    3 ++-
 jhbuild/modtypes/waf.py       |    7 ++++---
 7 files changed, 24 insertions(+), 15 deletions(-)
---
diff --git a/jhbuild/modtypes/__init__.py b/jhbuild/modtypes/__init__.py
index 739d043..52425e4 100644
--- a/jhbuild/modtypes/__init__.py
+++ b/jhbuild/modtypes/__init__.py
@@ -125,8 +125,9 @@ class Package:
     type = 'base'
     PHASE_START = 'start'
     PHASE_DONE  = 'done'
-    def __init__(self, name, dependencies = [], after = [], suggests = []):
+    def __init__(self, name, dependencies = [], after = [], suggests = [], pkg_config=None):
         self.name = name
+        self.pkg_config = pkg_config
         self.dependencies = dependencies
         self.after = after
         self.suggests = suggests
diff --git a/jhbuild/modtypes/autotools.py b/jhbuild/modtypes/autotools.py
index 52fa4af..609d5e4 100644
--- a/jhbuild/modtypes/autotools.py
+++ b/jhbuild/modtypes/autotools.py
@@ -49,13 +49,14 @@ class AutogenModule(Package, DownloadableModule):
     def __init__(self, name, branch, autogenargs='', makeargs='',
                  makeinstallargs='',
                  dependencies=[], after=[], suggests=[],
+                 pkg_config=None,
                  supports_non_srcdir_builds=True,
                  skip_autogen=False,
                  autogen_sh='autogen.sh',
                  makefile='Makefile',
                  autogen_template=None,
                  check_target=True):
-        Package.__init__(self, name, dependencies, after, suggests)
+        Package.__init__(self, name, dependencies, after, suggests, pkg_config)
         self.branch = branch
         self.autogenargs = autogenargs
         self.makeargs    = makeargs
@@ -315,6 +316,7 @@ class AutogenModule(Package, DownloadableModule):
 
 def parse_autotools(node, config, uri, repositories, default_repo):
     id = node.getAttribute('id')
+    pkg_config = node.getAttribute('pkg-config')
     autogenargs = ''
     makeargs = ''
     makeinstallargs = ''
@@ -381,6 +383,7 @@ def parse_autotools(node, config, uri, repositories, default_repo):
                          dependencies=dependencies,
                          after=after,
                          suggests=suggests,
+                         pkg_config=pkg_config,
                          supports_non_srcdir_builds=supports_non_srcdir_builds,
                          skip_autogen=skip_autogen,
                          autogen_sh=autogen_sh,
diff --git a/jhbuild/modtypes/cmake.py b/jhbuild/modtypes/cmake.py
index b24eb83..e16d039 100644
--- a/jhbuild/modtypes/cmake.py
+++ b/jhbuild/modtypes/cmake.py
@@ -39,8 +39,8 @@ class CMakeModule(Package, DownloadableModule):
     PHASE_INSTALL = 'install'
 
     def __init__(self, name, branch, cmakeargs='', makeargs='',
-                 dependencies=[], after=[], suggests=[]):
-        Package.__init__(self, name, dependencies, after, suggests)
+                 dependencies=[], after=[], suggests=[], pkg_config=None):
+        Package.__init__(self, name, dependencies, after, suggests, pkg_config)
         self.branch = branch
         self.cmakeargs = cmakeargs
         self.makeargs  = makeargs
@@ -145,6 +145,7 @@ class CMakeModule(Package, DownloadableModule):
 
 def parse_cmake(node, config, uri, repositories, default_repo):
     id = node.getAttribute('id')
+    pkg_config = node.getAttribute('pkg-config')
     cmakeargs = ''
     makeargs = ''
     if node.hasAttribute('cmakeargs'):
@@ -157,7 +158,7 @@ def parse_cmake(node, config, uri, repositories, default_repo):
 
     return CMakeModule(id, branch, cmakeargs, makeargs,
                        dependencies = dependencies, after = after,
-                       suggests = suggests)
+                       suggests = suggests, pkg_config=pkg_config)
 
 register_module_type('cmake', parse_cmake)
 
diff --git a/jhbuild/modtypes/distutils.py b/jhbuild/modtypes/distutils.py
index d4d56a1..4b3d933 100644
--- a/jhbuild/modtypes/distutils.py
+++ b/jhbuild/modtypes/distutils.py
@@ -39,8 +39,8 @@ class DistutilsModule(Package, DownloadableModule):
 
     def __init__(self, name, branch,
                  dependencies = [], after = [], suggests = [],
-                 supports_non_srcdir_builds = True):
-        Package.__init__(self, name, dependencies, after, suggests)
+                 supports_non_srcdir_builds = True, pkg_config=None):
+        Package.__init__(self, name, dependencies, after, suggests, pkg_config)
         self.branch = branch
         self.supports_non_srcdir_builds = supports_non_srcdir_builds
         self.supports_install_destdir = True
@@ -92,6 +92,7 @@ class DistutilsModule(Package, DownloadableModule):
 
 def parse_distutils(node, config, uri, repositories, default_repo):
     id = node.getAttribute('id')
+    pkg_config = node.getAttribute('pkg-config')
     supports_non_srcdir_builds = True
 
     if node.hasAttribute('supports-non-srcdir-builds'):
@@ -102,7 +103,7 @@ def parse_distutils(node, config, uri, repositories, default_repo):
 
     return DistutilsModule(id, branch,
             dependencies = dependencies, after = after,
-            suggests = suggests,
+            suggests = suggests, pkg_config = pkg_config,
             supports_non_srcdir_builds = supports_non_srcdir_builds)
 register_module_type('distutils', parse_distutils)
 
diff --git a/jhbuild/modtypes/perl.py b/jhbuild/modtypes/perl.py
index f5173b6..905d892 100644
--- a/jhbuild/modtypes/perl.py
+++ b/jhbuild/modtypes/perl.py
@@ -39,8 +39,8 @@ class PerlModule(Package, DownloadableModule):
     PHASE_INSTALL = 'install'
 
     def __init__(self, name, branch, makeargs='',
-                 dependencies=[], after=[], suggests=[]):
-        Package.__init__(self, name, dependencies, after, suggests)
+                 dependencies=[], after=[], suggests=[], pkg_config=None):
+        Package.__init__(self, name, dependencies, after, suggests, pkg_config)
         self.branch = branch
         self.makeargs = makeargs
 
@@ -82,6 +82,7 @@ class PerlModule(Package, DownloadableModule):
 
 def parse_perl(node, config, uri, repositories, default_repo):
     id = node.getAttribute('id')
+    pkg_config = node.getAttribute('pkg-config')
     makeargs = ''
     if node.hasAttribute('makeargs'):
         makeargs = node.getAttribute('makeargs')
@@ -95,6 +96,6 @@ def parse_perl(node, config, uri, repositories, default_repo):
 
     return PerlModule(id, branch, makeargs,
             dependencies=dependencies, after=after,
-            suggests=suggests)
+            suggests=suggests, pkg_config=pkg_config)
 register_module_type('perl', parse_perl)
 
diff --git a/jhbuild/modtypes/tarball.py b/jhbuild/modtypes/tarball.py
index 70d797a..ced9c7c 100644
--- a/jhbuild/modtypes/tarball.py
+++ b/jhbuild/modtypes/tarball.py
@@ -31,6 +31,7 @@ from jhbuild.modtypes import register_module_type, get_dependencies
 
 def parse_tarball(node, config, uri, repositories, default_repo):
     name = node.getAttribute('id')
+    pkg_config = node.getAttribute('pkg-config')
     version = node.getAttribute('version')
     source_url = None
     source_size = None
@@ -100,7 +101,7 @@ def parse_tarball(node, config, uri, repositories, default_repo):
 
     return AutogenModule(name, branch,
             autogenargs, makeargs, makeinstallargs,
-            dependencies, after, suggests,
+            dependencies, after, suggests, pkg_config,
             supports_non_srcdir_builds = supports_non_srcdir_builds,
             skip_autogen = False, autogen_sh = 'configure',
             makefile = makefile)
diff --git a/jhbuild/modtypes/waf.py b/jhbuild/modtypes/waf.py
index e12b16c..a9cfb54 100644
--- a/jhbuild/modtypes/waf.py
+++ b/jhbuild/modtypes/waf.py
@@ -44,9 +44,9 @@ class WafModule(Package, DownloadableModule):
     PHASE_DIST           = 'dist'
     PHASE_INSTALL        = 'install'
 
-    def __init__(self, name, branch, dependencies=[], after=[], suggests=[],
+    def __init__(self, name, branch, dependencies=[], after=[], suggests=[], pkg_config=None,
                  waf_cmd='./waf'):
-        Package.__init__(self, name, dependencies, after, suggests)
+        Package.__init__(self, name, dependencies, after, suggests, pkg_config)
         self.branch = branch
         self.waf_cmd = waf_cmd
         self.supports_install_destdir = True
@@ -148,6 +148,7 @@ class WafModule(Package, DownloadableModule):
 
 def parse_waf(node, config, uri, repositories, default_repo):
     module_id = node.getAttribute('id')
+    pkg_config = node.getAttribute('pkg-config')
     waf_cmd = './waf'
     if node.hasAttribute('waf-command'):
         waf_cmd = node.getAttribute('waf-command')
@@ -157,6 +158,6 @@ def parse_waf(node, config, uri, repositories, default_repo):
     branch = get_branch(node, repositories, default_repo, config)
 
     return WafModule(module_id, branch, dependencies=dependencies, after=after,
-            suggests=suggests, waf_cmd=waf_cmd)
+            suggests=suggests, pkg_config=pkg_config, waf_cmd=waf_cmd)
 
 register_module_type('waf', parse_waf)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]