jhbuild r1996 - in trunk: . doc/C jhbuild jhbuild/frontends jhbuild/modtypes



Author: fpeters
Date: Sat Apr  5 14:55:53 2008
New Revision: 1996
URL: http://svn.gnome.org/viewvc/jhbuild?rev=1996&view=rev

Log:
* doc/C/jhbuild.xml, jhbuild/config.py, jhbuild/defaults.jhbuildrc,
jhbuild/frontends/terminal.py, jhbuild/modtypes/__init__.py,
jhbuild/modtypes/autotools.py, jhbuild/modtypes/cmake.py,
jhbuild/modtypes/distutils.py, jhbuild/modtypes/linux.py,
jhbuild/modtypes/mesa.py, jhbuild/modtypes/mozillamodule.py,
jhbuild/modtypes/perl.py, jhbuild/modtypes/tarball.py: added a new
per-module configuration variable, module_extra_env, to set environment
variables when executing commands for that module.



Modified:
   trunk/ChangeLog
   trunk/doc/C/jhbuild.xml
   trunk/jhbuild/config.py
   trunk/jhbuild/defaults.jhbuildrc
   trunk/jhbuild/frontends/terminal.py
   trunk/jhbuild/modtypes/__init__.py
   trunk/jhbuild/modtypes/autotools.py
   trunk/jhbuild/modtypes/cmake.py
   trunk/jhbuild/modtypes/distutils.py
   trunk/jhbuild/modtypes/linux.py
   trunk/jhbuild/modtypes/mesa.py
   trunk/jhbuild/modtypes/mozillamodule.py
   trunk/jhbuild/modtypes/perl.py
   trunk/jhbuild/modtypes/tarball.py

Modified: trunk/doc/C/jhbuild.xml
==============================================================================
--- trunk/doc/C/jhbuild.xml	(original)
+++ trunk/doc/C/jhbuild.xml	Sat Apr  5 14:55:53 2008
@@ -1290,6 +1290,15 @@
 	  </listitem>
 	</varlistentry>
 	<varlistentry>
+	  <term><varname>module_extra_env</varname></term>
+	  <listitem>
+	    <simpara>A dictionary mapping module names to dictionaries
+	    with extra environment variables to pass when executing commands
+	    for the module.
+	    </simpara>
+	  </listitem>
+	</varlistentry>
+	<varlistentry>
 	  <term><varname>modules</varname></term>
 	  <listitem>
 	    <simpara>A list of module names to build.  This list will

Modified: trunk/jhbuild/config.py
==============================================================================
--- trunk/jhbuild/config.py	(original)
+++ trunk/jhbuild/config.py	Sat Apr  5 14:55:53 2008
@@ -41,7 +41,7 @@
                 'checkout_mode', 'copy_dir', 'module_checkout_mode',
                 'build_policy', 'trycheckout',
                 'nopoison', 'makecheck_advisory',
-                'quiet_mode', 'progress_bar']
+                'quiet_mode', 'progress_bar', 'module_extra_env']
 
 env_prepends = {}
 def prependpath(envvar, path):

Modified: trunk/jhbuild/defaults.jhbuildrc
==============================================================================
--- trunk/jhbuild/defaults.jhbuildrc	(original)
+++ trunk/jhbuild/defaults.jhbuildrc	Sat Apr  5 14:55:53 2008
@@ -48,6 +48,7 @@
 branches = {}
 module_autogenargs = {}
 module_makeargs = {}
+module_extra_env = {}
 
 # control parts of the build process
 nonetwork     = False  # never touch the network

Modified: trunk/jhbuild/frontends/terminal.py
==============================================================================
--- trunk/jhbuild/frontends/terminal.py	(original)
+++ trunk/jhbuild/frontends/terminal.py	Sat Apr  5 14:55:53 2008
@@ -162,6 +162,7 @@
             kws['cwd'] = cwd
 
         if extra_env is not None:
+            print 'XXX: environment:', extra_env
             kws['env'] = os.environ.copy()
             kws['env'].update(extra_env)
 

Modified: trunk/jhbuild/modtypes/__init__.py
==============================================================================
--- trunk/jhbuild/modtypes/__init__.py	(original)
+++ trunk/jhbuild/modtypes/__init__.py	Sat Apr  5 14:55:53 2008
@@ -117,13 +117,15 @@
     type = 'base'
     STATE_START = 'start'
     STATE_DONE  = 'done'
-    def __init__(self, name, dependencies=[], after=[], suggests=[]):
+    def __init__(self, name, dependencies = [], after = [], suggests = [],
+            extra_env = None):
         self.name = name
         self.dependencies = dependencies
         self.after = after
         self.suggests = suggests
         self.tags = []
         self.moduleset_name = None
+        self.extra_env = extra_env
 
     def __repr__(self):
         return "<%s '%s'>" % (self.__class__.__name__, self.name)

Modified: trunk/jhbuild/modtypes/autotools.py
==============================================================================
--- trunk/jhbuild/modtypes/autotools.py	(original)
+++ trunk/jhbuild/modtypes/autotools.py	Sat Apr  5 14:55:53 2008
@@ -52,8 +52,9 @@
                  supports_non_srcdir_builds=True,
                  skip_autogen=False,
                  autogen_sh='autogen.sh',
-                 makefile='Makefile'):
-        Package.__init__(self, name, dependencies, after, suggests)
+                 makefile='Makefile',
+                 extra_env = None):
+        Package.__init__(self, name, dependencies, after, suggests, extra_env)
         self.branch = branch
         self.autogenargs = autogenargs
         self.makeargs    = makeargs
@@ -135,7 +136,8 @@
         cmd += ' %s' % self.autogenargs
 
         if self.autogen_sh == 'autoreconf':
-            buildscript.execute(['autoreconf', '-i'], cwd=builddir)
+            buildscript.execute(['autoreconf', '-i'], cwd = builddir,
+                    extra_env = self.extra_env)
             cmd = cmd.replace('autoreconf', 'configure')
             cmd = cmd.replace('--enable-maintainer-mode', '')
 
@@ -157,7 +159,7 @@
                        (buildscript.config.prefix, "'\${exec_prefix}/lib64'"))
                 cmd = p.sub(r'\1\4-- \2\3', cmd)
 
-        buildscript.execute(cmd, cwd=builddir)
+        buildscript.execute(cmd, cwd = builddir, extra_env = self.extra_env)
     do_configure.next_state = STATE_CLEAN
     do_configure.error_states = [STATE_FORCE_CHECKOUT,
             STATE_FORCE_CLEAN, STATE_FORCE_DISTCLEAN]
@@ -169,7 +171,8 @@
     def do_clean(self, buildscript):
         buildscript.set_action('Cleaning', self)
         cmd = '%s %s clean' % (os.environ.get('MAKE', 'make'), self.makeargs)
-        buildscript.execute(cmd, cwd=self.get_builddir(buildscript))
+        buildscript.execute(cmd, cwd = self.get_builddir(buildscript),
+                extra_env = self.extra_env)
     do_clean.next_state = STATE_BUILD
     do_clean.error_states = [STATE_FORCE_CHECKOUT, STATE_CONFIGURE]
 
@@ -179,7 +182,8 @@
     def do_build(self, buildscript):
         buildscript.set_action('Building', self)
         cmd = '%s %s' % (os.environ.get('MAKE', 'make'), self.makeargs)
-        buildscript.execute(cmd, cwd=self.get_builddir(buildscript))
+        buildscript.execute(cmd, cwd = self.get_builddir(buildscript),
+                extra_env = self.extra_env)
     do_build.next_state = STATE_CHECK
     do_build.error_states = [STATE_FORCE_CHECKOUT, STATE_CONFIGURE,
             STATE_FORCE_CLEAN, STATE_FORCE_DISTCLEAN]
@@ -192,7 +196,8 @@
         buildscript.set_action('Checking', self)
         cmd = '%s %s check' % (os.environ.get('MAKE', 'make'), self.makeargs)
         try:
-            buildscript.execute(cmd, cwd=self.get_builddir(buildscript))
+            buildscript.execute(cmd, cwd = self.get_builddir(buildscript),
+                    extra_env = self.extra_env)
         except CommandError:
             if not buildscript.config.makecheck_advisory:
                 raise
@@ -208,7 +213,8 @@
             cmd = '%s %s distcheck' % (os.environ.get('MAKE', 'make'), self.makeargs)
         else:
             cmd = '%s %s dist' % (os.environ.get('MAKE', 'make'), self.makeargs)
-        buildscript.execute(cmd, cwd=self.get_builddir(buildscript))
+        buildscript.execute(cmd, cwd = self.get_builddir(buildscript),
+                    extra_env = self.extra_env)
     do_dist.next_state = STATE_INSTALL
     do_dist.error_states = [STATE_FORCE_CHECKOUT, STATE_CONFIGURE]
 
@@ -222,7 +228,8 @@
         else:
             cmd = '%s %s install' % (os.environ.get('MAKE', 'make'), self.makeargs)
 
-        buildscript.execute(cmd, cwd=self.get_builddir(buildscript))
+        buildscript.execute(cmd, cwd = self.get_builddir(buildscript),
+                    extra_env = self.extra_env)
         buildscript.packagedb.add(self.name, self.get_revision() or '')
     do_install.next_state = Package.STATE_DONE
     do_install.error_states = []
@@ -241,7 +248,8 @@
     def do_force_distclean(self, buildscript):
         buildscript.set_action('Distcleaning', self)
         cmd = '%s %s distclean' % (os.environ.get('MAKE', 'make'), self.makeargs)
-        buildscript.execute(cmd, cwd=self.get_builddir(buildscript))
+        buildscript.execute(cmd, cwd = self.get_builddir(buildscript),
+                    extra_env = self.extra_env)
     do_force_distclean.next_state = STATE_CONFIGURE
     do_force_distclean.error_states = []
 
@@ -285,9 +293,9 @@
     makeargs        = p.sub(config.prefix + libsubdir, makeargs)
     makeinstallargs = p.sub(config.prefix + libsubdir, makeinstallargs)
 
-    # override revision tag if requested.
     autogenargs += ' ' + config.module_autogenargs.get(id, config.autogenargs)
     makeargs += ' ' + config.module_makeargs.get(id, config.makeargs)
+    extra_env = config.module_extra_env.get(id)
 
     dependencies, after, suggests = get_dependencies(node)
     branch = get_branch(node, repositories, default_repo)
@@ -302,7 +310,8 @@
                          supports_non_srcdir_builds=supports_non_srcdir_builds,
                          skip_autogen=skip_autogen,
                          autogen_sh=autogen_sh,
-                         makefile=makefile)
+                         makefile=makefile,
+                         extra_env=extra_env)
 register_module_type('autotools', parse_autotools)
 
 
@@ -332,9 +341,9 @@
     if not id:
         id = checkoutdir or module
 
-    # override revision tag if requested.
     autogenargs += ' ' + config.module_autogenargs.get(id, config.autogenargs)
     makeargs += ' ' + config.module_makeargs.get(id, config.makeargs)
+    extra_env = config.module_extra_env.get(id)
 
     dependencies, after, suggests = get_dependencies(node)
 
@@ -356,7 +365,8 @@
     return AutogenModule(id, branch, autogenargs, makeargs,
                          dependencies=dependencies,
                          after=after, suggests=suggests,
-                         supports_non_srcdir_builds=supports_non_srcdir_builds)
+                         supports_non_srcdir_builds=supports_non_srcdir_builds,
+                         extra_env=extra_env)
 register_module_type('cvsmodule', parse_cvsmodule)
 
 def parse_svnmodule(node, config, uri, repositories, default_repo):
@@ -381,9 +391,9 @@
     if not id:
         id = checkoutdir or os.path.basename(module)
 
-    # override revision tag if requested.
     autogenargs += ' ' + config.module_autogenargs.get(id, config.autogenargs)
     makeargs += ' ' + config.module_makeargs.get(id, config.makeargs)
+    extra_env = config.module_extra_env.get(id)
 
     dependencies, after, suggests = get_dependencies(node)
 
@@ -396,7 +406,8 @@
     return AutogenModule(id, branch, autogenargs, makeargs,
                          dependencies=dependencies,
                          after=after, suggests=suggests,
-                         supports_non_srcdir_builds=supports_non_srcdir_builds)
+                         supports_non_srcdir_builds=supports_non_srcdir_builds,
+                         extra_env=extra_env)
 register_module_type('svnmodule', parse_svnmodule)
 
 def parse_archmodule(node, config, uri, repositories, default_repo):
@@ -423,6 +434,7 @@
 
     autogenargs += ' ' + config.module_autogenargs.get(id, config.autogenargs)
     makeargs += ' ' + config.module_makeargs.get(id, makeargs)
+    extra_env = config.module_extra_env.get(id)
 
     dependencies, after, suggests = get_dependencies(node)
 
@@ -435,5 +447,6 @@
     return AutogenModule(id, branch, autogenargs, makeargs,
                          dependencies=dependencies,
                          after=after, suggests=suggests,
-                         supports_non_srcdir_builds=supports_non_srcdir_builds)
+                         supports_non_srcdir_builds=supports_non_srcdir_builds,
+                         extra_env=extra_env)
 register_module_type('archmodule', parse_archmodule)

Modified: trunk/jhbuild/modtypes/cmake.py
==============================================================================
--- trunk/jhbuild/modtypes/cmake.py	(original)
+++ trunk/jhbuild/modtypes/cmake.py	Sat Apr  5 14:55:53 2008
@@ -38,8 +38,9 @@
     STATE_DIST = 'dist'
     STATE_INSTALL = 'install'
 
-    def __init__(self, name, branch, dependencies=[], after=[], suggests=[]):
-        Package.__init__(self, name, dependencies, after, suggests)
+    def __init__(self, name, branch, dependencies=[], after=[], suggests=[],
+                extra_env=None):
+        Package.__init__(self, name, dependencies, after, suggests, extra_env)
         self.branch = branch
 
     def get_srcdir(self, buildscript):
@@ -86,7 +87,7 @@
             os.mkdir(builddir)
         prefix = os.path.expanduser(buildscript.config.prefix)
         cmd = ['cmake', '-DCMAKE_INSTALL_PREFIX=%s' % prefix, srcdir]
-        buildscript.execute(cmd, cwd=builddir)
+        buildscript.execute(cmd, cwd = builddir, extra_env = self.extra_env)
     do_configure.next_state = STATE_BUILD
     do_configure.error_states = [STATE_FORCE_CHECKOUT]
 
@@ -96,7 +97,8 @@
     def do_build(self, buildscript):
         buildscript.set_action('Building', self)
         builddir = self.get_builddir(buildscript)
-        buildscript.execute(os.environ.get('MAKE', 'make'), cwd=builddir)
+        buildscript.execute(os.environ.get('MAKE', 'make'), cwd = builddir,
+                extra_env = self.extra_env)
     do_build.next_state = STATE_DIST
     do_build.error_states = [STATE_FORCE_CHECKOUT]
 
@@ -106,7 +108,8 @@
     def do_dist(self, buildscript):
         buildscript.set_action('Creating tarball for', self)
         cmd = '%s package_source' % os.environ.get('MAKE', 'make')
-        buildscript.execute(cmd, cwd=self.get_builddir(buildscript))
+        buildscript.execute(cmd, cwd = self.get_builddir(buildscript),
+                extra_env = self.extra_env)
     do_dist.next_state = STATE_INSTALL
     do_dist.error_states = [STATE_FORCE_CHECKOUT, STATE_CONFIGURE]
 
@@ -116,7 +119,9 @@
     def do_install(self, buildscript):
         buildscript.set_action('Installing', self)
         builddir = self.get_builddir(buildscript)
-        buildscript.execute([os.environ.get('MAKE', 'make'), "install"], cwd=builddir)
+        buildscript.execute([os.environ.get('MAKE', 'make'), 'install'],
+                cwd = builddir,
+                extra_env = self.extra_env)
         buildscript.packagedb.add(self.name, self.get_revision() or '')
     do_install.next_state = Package.STATE_DONE
     do_install.error_states = []
@@ -125,12 +130,14 @@
 def parse_cmake(node, config, uri, repositories, default_repo):
     id = node.getAttribute('id')
     dependencies, after, suggests = get_dependencies(node)
+    extra_env = config.module_extra_env.get(id)
     branch = get_branch(node, repositories, default_repo)
 
     if config.module_checkout_mode.get(id):
         branch.checkout_mode = config.module_checkout_mode[id]
 
-    return CMakeModule(id, branch, dependencies=dependencies, after=after, suggests=suggests)
+    return CMakeModule(id, branch, dependencies = dependencies, after = after,
+            suggests = suggests, extra_env = extra_env)
 
 register_module_type('cmake', parse_cmake)
 

Modified: trunk/jhbuild/modtypes/distutils.py
==============================================================================
--- trunk/jhbuild/modtypes/distutils.py	(original)
+++ trunk/jhbuild/modtypes/distutils.py	Sat Apr  5 14:55:53 2008
@@ -38,9 +38,9 @@
     STATE_INSTALL = 'install'
 
     def __init__(self, name, branch,
-                 dependencies=[], after=[], suggests=[],
-                 supports_non_srcdir_builds=True):
-        Package.__init__(self, name, dependencies, after, suggests)
+                 dependencies = [], after = [], suggests = [],
+                 supports_non_srcdir_builds = True, extra_env = None):
+        Package.__init__(self, name, dependencies, after, suggests, extra_env)
         self.branch = branch
         self.supports_non_srcdir_builds = supports_non_srcdir_builds
 
@@ -88,7 +88,7 @@
         cmd = [python, 'setup.py', 'build']
         if srcdir != builddir:
             cmd.extend(['--build-base', builddir])
-        buildscript.execute(cmd, cwd=srcdir)
+        buildscript.execute(cmd, cwd = srcdir, extra_env = self.extra_env)
     do_build.next_state = STATE_INSTALL
     do_build.error_states = [STATE_FORCE_CHECKOUT]
 
@@ -104,7 +104,7 @@
         if srcdir != builddir:
             cmd.extend(['build', '--build-base', builddir])
         cmd.extend(['install', '--prefix', buildscript.config.prefix])
-        buildscript.execute(cmd, cwd=srcdir)
+        buildscript.execute(cmd, cwd = srcdir, extra_env = self.extra_env)
         buildscript.packagedb.add(self.name, self.get_revision() or '')
     do_install.next_state = Package.STATE_DONE
     do_install.error_states = []
@@ -118,13 +118,15 @@
         supports_non_srcdir_builds = \
             (node.getAttribute('supports-non-srcdir-builds') != 'no')
     dependencies, after, suggests = get_dependencies(node)
+    extra_env = config.module_extra_env.get(id)
     branch = get_branch(node, repositories, default_repo)
     if config.module_checkout_mode.get(id):
         branch.checkout_mode = config.module_checkout_mode[id]
 
     return DistutilsModule(id, branch,
-                           dependencies=dependencies, after=after,
-                           suggests=suggests,
-                           supports_non_srcdir_builds=supports_non_srcdir_builds)
+            dependencies = dependencies, after = after,
+            suggests = suggests,
+            supports_non_srcdir_builds = supports_non_srcdir_builds,
+            extra_env = extra_env)
 register_module_type('distutils', parse_distutils)
 

Modified: trunk/jhbuild/modtypes/linux.py
==============================================================================
--- trunk/jhbuild/modtypes/linux.py	(original)
+++ trunk/jhbuild/modtypes/linux.py	Sat Apr  5 14:55:53 2008
@@ -44,8 +44,9 @@
     STATE_INSTALL         = 'install'
     STATE_MODULES_INSTALL = 'modules_install'
 
-    def __init__(self, name, branch, kconfigs, makeargs, dependencies, after, suggests):
-        Package.__init__(self, name, dependencies, after, suggests)
+    def __init__(self, name, branch, kconfigs, makeargs,
+            dependencies, after, suggests, extra_env = None):
+        Package.__init__(self, name, dependencies, after, suggests, extra_env)
         self.branch = branch
         self.kconfigs = kconfigs
         self.makeargs = makeargs
@@ -104,11 +105,13 @@
                 if e != errno.EEXIST:
                     raise
 
-            cmd = '%s oldconfig EXTRAVERSION=%s O=%s' % (os.environ.get('MAKE', 'make'),
-                                                         kconfig.version,
-                                                         'build-' + kconfig.version)
+            cmd = '%s oldconfig EXTRAVERSION=%s O=%s' % (
+                    os.environ.get('MAKE', 'make'),
+                    kconfig.version,
+                    'build-' + kconfig.version)
 
-            buildscript.execute(cmd, cwd=self.branch.srcdir)
+            buildscript.execute(cmd, cwd = self.branch.srcdir,
+                    extra_env = self.extra_env)
 
             os.remove(os.path.join(self.branch.srcdir, ".config"))
 
@@ -122,11 +125,13 @@
     def do_clean(self, buildscript):
         buildscript.set_action('Cleaning', self)
         for kconfig in self.kconfigs:
-            cmd = '%s %s clean EXTRAVERSION=%s O=%s' % (os.environ.get('MAKE', 'make'),
-                                                        self.makeargs,
-                                                        kconfig.version,
-                                                        'build-' + kconfig.version)
-            buildscript.execute(cmd, cwd=self.branch.srcdir)
+            cmd = '%s %s clean EXTRAVERSION=%s O=%s' % (
+                    os.environ.get('MAKE', 'make'),
+                    self.makeargs,
+                    kconfig.version,
+                    'build-' + kconfig.version)
+            buildscript.execute(cmd, cwd = self.branch.srcdir,
+                    extra_env = self.extra_env)
 
     do_clean.next_state = STATE_BUILD
     do_clean.error_states = [STATE_FORCE_CHECKOUT, STATE_CONFIGURE]
@@ -141,7 +146,8 @@
                                                   self.makeargs,
                                                   kconfig.version,
                                                   'build-' + kconfig.version)
-            buildscript.execute(cmd, cwd=self.branch.srcdir)
+            buildscript.execute(cmd, cwd = self.branch.srcdir,
+                    extra_env = self.extra_env)
 
     do_build.next_state = STATE_INSTALL
     do_build.error_states = [STATE_FORCE_CHECKOUT, STATE_CONFIGURE]
@@ -152,12 +158,14 @@
     def do_install(self, buildscript):
         buildscript.set_action('Installing', self)
         for kconfig in self.kconfigs:
-            cmd = '%s %s install EXTRAVERSION=%s O=%s INSTALL_PATH=%s/boot' % (os.environ.get('MAKE', 'make'),
-                                                                               self.makeargs,
-                                                                               kconfig.version,
-                                                                               'build-' + kconfig.version,
-                                                                               buildscript.config.prefix)
-            buildscript.execute(cmd, cwd=self.branch.srcdir)
+            cmd = '%s %s install EXTRAVERSION=%s O=%s INSTALL_PATH=%s/boot' % (
+                    os.environ.get('MAKE', 'make'),
+                    self.makeargs,
+                    kconfig.version,
+                    'build-' + kconfig.version,
+                    buildscript.config.prefix)
+            buildscript.execute(cmd, cwd = self.branch.srcdir,
+                    extra_env = self.extra_env)
 
     do_install.next_state = STATE_MODULES_INSTALL
     do_install.error_states = [STATE_FORCE_CHECKOUT, STATE_CONFIGURE]
@@ -168,12 +176,14 @@
     def do_modules_install(self, buildscript):
         buildscript.set_action('Installing modules', self)
         for kconfig in self.kconfigs:
-            cmd = '%s %s modules_install EXTRAVERSION=%s O=%s INSTALL_MOD_PATH=%s' % (os.environ.get('MAKE', 'make'),
-                                                                                      self.makeargs,
-                                                                                      kconfig.version,
-                                                                                      'build-' + kconfig.version,
-                                                                                      buildscript.config.prefix)
-            buildscript.execute(cmd, cwd=self.branch.srcdir)
+            cmd = '%s %s modules_install EXTRAVERSION=%s O=%s INSTALL_MOD_PATH=%s' % (
+                    os.environ.get('MAKE', 'make'),
+                    self.makeargs,
+                    kconfig.version,
+                    'build-' + kconfig.version,
+                    buildscript.config.prefix)
+            buildscript.execute(cmd, cwd = self.branch.srcdir,
+                    extra_env = self.extra_env)
         buildscript.packagedb.add(self.name, self.get_revision() or '')
 
     do_install.next_state = Package.STATE_DONE
@@ -228,12 +238,14 @@
     makeargs += ' ' + config.module_makeargs.get(id, config.makeargs)
 
     dependencies, after, suggests = get_dependencies(node)
+    extra_env = config.module_extra_env.get(id)
     branch = get_branch(node, repositories, default_repo)
     if config.module_checkout_mode.get(id):
         branch.checkout_mode = config.module_checkout_mode[id]
     kconfigs = get_kconfigs(node, repositories, default_repo)
 
     return LinuxModule(id, branch, kconfigs,
-                       makeargs, dependencies, after, suggests)
+                       makeargs, dependencies, after, suggests,
+                       extra_env = extra_env)
 
 register_module_type('linux', parse_linux)

Modified: trunk/jhbuild/modtypes/mesa.py
==============================================================================
--- trunk/jhbuild/modtypes/mesa.py	(original)
+++ trunk/jhbuild/modtypes/mesa.py	Sat Apr  5 14:55:53 2008
@@ -40,8 +40,8 @@
     STATE_INSTALL = 'install'
 
     def __init__(self, name, branch, makeargs='',
-                 dependencies=[], after=[], suggests=[]):
-        Package.__init__(self, name, dependencies, after, suggests)
+                 dependencies=[], after=[], suggests=[], extra_env = None):
+        Package.__init__(self, name, dependencies, after, suggests, extra_env)
         self.branch = branch
         self.makeargs = makeargs
 
@@ -99,9 +99,11 @@
         builddir = self.get_builddir(buildscript)
         make = os.environ.get('MAKE', 'make')
 	if (os.path.exists(builddir + '/configs/current')):
-	    buildscript.execute([make], cwd=builddir)
+	    buildscript.execute([make], cwd = builddir,
+                    extra_env = self.extra_env)
 	else:
-	    buildscript.execute([make, self.get_mesa_config()], cwd=builddir)
+	    buildscript.execute([make, self.get_mesa_config()], cwd = builddir,
+                    extra_env = self.extra_env)
     do_build.next_state = STATE_INSTALL
     do_build.error_states = [STATE_FORCE_CHECKOUT]
 
@@ -113,24 +115,17 @@
         builddir = self.get_builddir(buildscript)
         prefix = buildscript.config.prefix
 
-        buildscript.execute(['mkdir', '-p',
-			     prefix + '/lib/dri'],
-                             cwd=builddir)
+        buildscript.execute(
+                ['mkdir', '-p', prefix + '/lib/dri'], cwd = builddir)
         for x in glob.glob(builddir + '/lib/libGL*'):
-            buildscript.execute(['cp',
-                                 x,
-                                 prefix + '/lib'],
-                                cwd=builddir)
+            buildscript.execute(
+                    ['cp', x, prefix + '/lib'], cwd = builddir)
         for x in glob.glob(builddir + '/lib/*_dri.so'):
-            buildscript.execute(['cp',
-                                 x,
-                                 prefix + '/lib/dri'],
-                                cwd=builddir)
+            buildscript.execute(
+                    ['cp', x, prefix + '/lib/dri'], cwd = builddir)
         for x in glob.glob(builddir + '/include/GL/*.h'):
-            buildscript.execute(['cp',
-                                 x,
-                                 prefix + '/include/GL'],
-                                cwd=builddir)
+            buildscript.execute(
+                    ['cp', x, prefix + '/include/GL'], cwd = builddir)
         buildscript.packagedb.add(self.name, self.get_revision() or '')
     do_install.next_state = Package.STATE_DONE
     do_install.error_states = []
@@ -146,11 +141,12 @@
     makeargs += ' ' + config.module_makeargs.get(id, config.makeargs)
 
     dependencies, after, suggests = get_dependencies(node)
+    extra_env = config.module_extra_env.get(id)
     branch = get_branch(node, repositories, default_repo)
     if config.module_checkout_mode.get(id):
         branch.checkout_mode = config.module_checkout_mode[id]
 
     return MesaModule(id, branch, makeargs,
-                         dependencies=dependencies, after=after,
-                         suggests=suggests)
+                         dependencies = dependencies, after = after,
+                         suggests = suggests, extra_env = extra_env)
 register_module_type('mesa', parse_mesa)

Modified: trunk/jhbuild/modtypes/mozillamodule.py
==============================================================================
--- trunk/jhbuild/modtypes/mozillamodule.py	(original)
+++ trunk/jhbuild/modtypes/mozillamodule.py	Sat Apr  5 14:55:53 2008
@@ -30,14 +30,15 @@
 class MozillaModule(AutogenModule):
     def __init__(self, name, projects, revision, autogenargs='',
 		 makeargs='', dependencies=[], after=[], suggests=[],
-                 repository=None):
+                 repository = None, extra_env = extra_env):
         AutogenModule.__init__(self, name, branch=None,
                                autogenargs=autogenargs,
                                makeargs=makeargs,
                                dependencies=dependencies,
                                after=after,
                                suggests=suggests,
-                               supports_non_srcdir_builds=False)
+                               supports_non_srcdir_builds=False,
+                               extra_env = extra_env)
         self.repository = repository
         self.revision = revision
 	self.projects = projects
@@ -80,11 +81,12 @@
         if buildscript.config.sticky_date:
             cmd.extend(['-D', buildscript.config.sticky_date])
         cmd.append('mozilla/client.mk')
-        buildscript.execute(cmd, cwd=buildscript.config.checkoutroot)
+        buildscript.execute(cmd, cwd = buildscript.config.checkoutroot)
         
         make = os.environ.get('MAKE', 'make')
         buildscript.execute([make, '-f', 'client.mk', 'checkout'],
-                            cwd=self.get_builddir(buildscript))
+                cwd = self.get_builddir(buildscript),
+                extra_env = self.extra_env)
 
     def do_checkout(self, buildscript):
         checkoutdir = self.get_builddir(buildscript)
@@ -96,7 +98,8 @@
             buildscript.set_action('Updating', self)
             make = os.environ.get('MAKE', 'make')
             buildscript.execute([make, '-f', 'client.mk', 'fast-update'],
-                                cwd=checkoutdir)
+                    cwd = checkoutdir,
+                    extra_env = self.extra_env)
 
         # did the checkout succeed?
         if not os.path.exists(checkoutdir):
@@ -135,7 +138,8 @@
 
         if self.projects:
             cmd += ' --enable-application=%s' % self.projects
-        buildscript.execute(cmd, cwd=checkoutdir)
+        buildscript.execute(cmd, cwd = checkoutdir,
+                extra_env = self.extra_env)
     do_configure.next_state = AutogenModule.STATE_BUILD
     do_configure.error_states = [AutogenModule.STATE_FORCE_CHECKOUT]
 
@@ -144,7 +148,8 @@
         make = os.environ.get('MAKE', 'make')
         cmd = '%s %s %s install' % (make, buildscript.config.makeargs,
                                       self.makeargs)
-        buildscript.execute(cmd, cwd=self.get_builddir(buildscript))
+        buildscript.execute(cmd, cwd = self.get_builddir(buildscript),
+                extra_env = self.extra_env)
         nssdir = '%s/include/%s-%s/nss' % (
             buildscript.config.prefix,
             self.get_mozilla_app(),
@@ -176,10 +181,11 @@
 
     # override revision tag if requested.
     revision = config.branches.get(name, revision)
-    autogenargs += ' ' + config.module_autogenargs.get(name,
-                                                       config.autogenargs)
+
+    autogenargs += ' ' + config.module_autogenargs.get(name, config.autogenargs)
     makeargs += ' ' + config.module_makeargs.get(name, config.makeargs)
 
+    extra_env = config.module_extra_env.get(id)
     dependencies, after, suggests = get_dependencies(node)
 
     for attrname in ['cvsroot', 'root']:
@@ -190,6 +196,7 @@
         repo = repositories.get(default_repo, None)
 
     return MozillaModule(name, projects, revision, autogenargs, makeargs,
-                         dependencies, after, suggests, repo)
+                         dependencies, after, suggests, repo,
+                         extra_env = extra_env)
 
 register_module_type('mozillamodule', parse_mozillamodule)

Modified: trunk/jhbuild/modtypes/perl.py
==============================================================================
--- trunk/jhbuild/modtypes/perl.py	(original)
+++ trunk/jhbuild/modtypes/perl.py	Sat Apr  5 14:55:53 2008
@@ -39,8 +39,8 @@
     STATE_INSTALL = 'install'
 
     def __init__(self, name, branch, makeargs='',
-                 dependencies=[], after=[], suggests=[]):
-        Package.__init__(self, name, dependencies, after, suggests)
+                 dependencies=[], after=[], suggests=[], extra_env = None):
+        Package.__init__(self, name, dependencies, after, suggests, extra_env)
         self.branch = branch
         self.makeargs = makeargs
 
@@ -82,8 +82,9 @@
         perl = os.environ.get('PERL', 'perl')
         make = os.environ.get('MAKE', 'make')
         cmd = '%s Makefile.PL INSTALLDIRS=vendor PREFIX=%s %s' % (perl, buildscript.config.prefix, self.makeargs)
-        buildscript.execute(cmd, cwd=builddir)
-        buildscript.execute([make, 'LD_RUN_PATH='], cwd=builddir)
+        buildscript.execute(cmd, cwd=builddir, extra_env = self.extra_env)
+        buildscript.execute([make, 'LD_RUN_PATH='], cwd=builddir,
+                extra_env = self.extra_env)
     do_build.next_state = STATE_INSTALL
     do_build.error_states = [STATE_FORCE_CHECKOUT]
 
@@ -94,9 +95,9 @@
         buildscript.set_action('Installing', self)
         builddir = self.get_builddir(buildscript)
         make = os.environ.get('MAKE', 'make')
-        buildscript.execute([make, 'install',
-                             'PREFIX=%s' % buildscript.config.prefix],
-                            cwd=builddir)
+        buildscript.execute(
+                [make, 'install', 'PREFIX=%s' % buildscript.config.prefix],
+                cwd = builddir, extra_env = self.extra_env)
         buildscript.packagedb.add(self.name, self.get_revision() or '')
     do_install.next_state = Package.STATE_DONE
     do_install.error_states = []
@@ -116,12 +117,13 @@
     makeargs = p.sub(config.prefix, makeargs)
     
     dependencies, after, suggests = get_dependencies(node)
+    extra_env = config.module_extra_env.get(id)
     branch = get_branch(node, repositories, default_repo)
     if config.module_checkout_mode.get(id):
         branch.checkout_mode = config.module_checkout_mode[id]
 
     return PerlModule(id, branch, makeargs,
             dependencies=dependencies, after=after,
-            suggests=suggests)
+            suggests=suggests, extra_env = extra_env)
 register_module_type('perl', parse_perl)
 

Modified: trunk/jhbuild/modtypes/tarball.py
==============================================================================
--- trunk/jhbuild/modtypes/tarball.py	(original)
+++ trunk/jhbuild/modtypes/tarball.py	Sat Apr  5 14:55:53 2008
@@ -68,6 +68,7 @@
     autogenargs = autogenargs.replace('--enable-maintainer-mode', '')
 
     dependencies, after, suggests = get_dependencies(node)
+    extra_env = config.module_extra_env.get(id)
 
     from autotools import AutogenModule
     from jhbuild.versioncontrol.tarball import TarballBranch, TarballRepository
@@ -84,6 +85,7 @@
             autogenargs, makeargs, '',
             dependencies, after, suggests,
             supports_non_srcdir_builds = supports_non_srcdir_builds,
-            skip_autogen = False, autogen_sh = 'configure')
+            skip_autogen = False, autogen_sh = 'configure',
+            extra_env = extra_env)
 
 register_module_type('tarball', parse_tarball)



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