[jhbuild] MakeModule: add needs_gmake flag
- From: Ryan Lortie <desrt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jhbuild] MakeModule: add needs_gmake flag
- Date: Sun, 1 Feb 2015 11:36:52 +0000 (UTC)
commit c597287c651844bd215124c18b16ea45a1116fd4
Author: Ryan Lortie <desrt desrt ca>
Date: Sun Jan 4 11:37:27 2015 -0500
MakeModule: add needs_gmake flag
Add a needs_gmake flag for MakeModule.
If this is set to True (which is the default for autotools) and the
'gmake' condition is set then the 'gmake' command will be used instead
of 'make'.
This helps with systems where the system 'make' is not GNU make.
This patch effectively establishes an assumption that all autotools
packages will require gmake. In the unlikely event that this proves to
cause trouble for someone, we could easily add a needs-gmake attribute
to the XML to allow people to set it back to 'false'.
Since the make command might now be 'gmake', make sure we take the
correct one for the creation of virtual sysdeps.
https://bugzilla.gnome.org/show_bug.cgi?id=742292
jhbuild/modtypes/__init__.py | 11 +++++++++--
jhbuild/modtypes/autotools.py | 7 ++++---
jhbuild/modtypes/cmake.py | 2 +-
jhbuild/moduleset.py | 1 +
4 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/jhbuild/modtypes/__init__.py b/jhbuild/modtypes/__init__.py
index e46d2f1..8aee702 100644
--- a/jhbuild/modtypes/__init__.py
+++ b/jhbuild/modtypes/__init__.py
@@ -499,11 +499,12 @@ class MakeModule(Package):
'''A base class for modules that use the command 'make' within the build
process.'''
def __init__(self, name, branch=None, makeargs='', makeinstallargs='',
- makefile='Makefile'):
+ makefile='Makefile', needs_gmake=False):
Package.__init__(self, name, branch=branch)
self.makeargs = makeargs
self.makeinstallargs = makeinstallargs
self.makefile = makefile
+ self.needs_gmake = needs_gmake
def get_makeargs(self, buildscript, add_parallel=True):
makeargs = ' %s %s' % (self.makeargs,
@@ -518,8 +519,14 @@ class MakeModule(Package):
makeargs = re.sub(r'-j\w*\d+', '', makeargs) + ' -j 1'
return self.eval_args(makeargs).strip()
+ def get_makecmd(self, config):
+ if self.needs_gmake and 'gmake' in config.conditions:
+ return 'gmake'
+ else:
+ return 'make'
+
def make(self, buildscript, target='', pre='', makeargs=None):
- makecmd = os.environ.get('MAKE', 'make')
+ makecmd = os.environ.get('MAKE', self.get_makecmd(buildscript.config))
if makeargs is None:
makeargs = self.get_makeargs(self, buildscript)
diff --git a/jhbuild/modtypes/autotools.py b/jhbuild/modtypes/autotools.py
index 8f03585..df40cfb 100644
--- a/jhbuild/modtypes/autotools.py
+++ b/jhbuild/modtypes/autotools.py
@@ -61,9 +61,10 @@ class AutogenModule(MakeModule, DownloadableModule):
makefile='Makefile',
autogen_template=None,
check_target=True,
- supports_static_analyzer=True):
+ supports_static_analyzer=True,
+ needs_gmake=True):
MakeModule.__init__(self, name, branch=branch, makeargs=makeargs,
- makeinstallargs=makeinstallargs, makefile=makefile)
+ makeinstallargs=makeinstallargs, makefile=makefile, needs_gmake=needs_gmake)
self.autogenargs = autogenargs
self.supports_non_srcdir_builds = supports_non_srcdir_builds
self.skip_autogen = skip_autogen
@@ -361,7 +362,7 @@ def collect_args(instance, node, argtype):
def parse_autotools(node, config, uri, repositories, default_repo):
instance = AutogenModule.parse_from_xml(node, config, uri, repositories, default_repo)
- instance.dependencies += ['automake', 'libtool', 'make']
+ instance.dependencies += ['automake', 'libtool', instance.get_makecmd(config)]
instance.autogenargs = collect_args (instance, node, 'autogenargs')
instance.makeargs = collect_args (instance, node, 'makeargs')
diff --git a/jhbuild/modtypes/cmake.py b/jhbuild/modtypes/cmake.py
index 799fe2a..0c572d7 100644
--- a/jhbuild/modtypes/cmake.py
+++ b/jhbuild/modtypes/cmake.py
@@ -132,7 +132,7 @@ class CMakeModule(MakeModule, DownloadableModule):
def parse_cmake(node, config, uri, repositories, default_repo):
instance = CMakeModule.parse_from_xml(node, config, uri, repositories, default_repo)
- instance.dependencies += ['cmake', 'make']
+ instance.dependencies += ['cmake', instance.get_makecmd(config)]
if node.hasAttribute('supports-non-srcdir-builds'):
instance.supports_non_srcdir_builds = \
diff --git a/jhbuild/moduleset.py b/jhbuild/moduleset.py
index 695b3fa..caa212b 100644
--- a/jhbuild/moduleset.py
+++ b/jhbuild/moduleset.py
@@ -52,6 +52,7 @@ virtual_sysdeps = [
'cmake',
'cvs',
'git',
+ 'gmake',
'hg',
'libtool',
'make',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]