[jhbuild] base: also try for meson on autogenerated modules



commit 2cc433db003c054b6a081047c48ef995f440d645
Author: Diego Escalante Urrelo <diegoe gnome org>
Date:   Wed Jul 1 19:49:33 2020 -0500

    base: also try for meson on autogenerated modules
    
    When creating a non existant module from the default repository, don't
    just try for autotools, but also for meson.
    
    This is a copy-paste of the code for this same situation used in
    `jhbuild make`.
    
    This solves the annoyance of jhbuild'ing a GNOME module that is not in
    the moduleset, but is on the default repo and already checked out. While
    `jhbuild make` works fine, it requires you to be in the module's
    directory, and the only workaround is to create your own custom
    moduleset.

 jhbuild/commands/base.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/commands/base.py b/jhbuild/commands/base.py
index 94acb85f..f7d0682f 100644
--- a/jhbuild/commands/base.py
+++ b/jhbuild/commands/base.py
@@ -327,8 +327,15 @@ class cmd_buildone(BuildCommand):
                 default_repo = jhbuild.moduleset.get_default_repo()
                 if not default_repo:
                     continue
-                from jhbuild.modtypes.autotools import AutogenModule
-                module = AutogenModule(modname, default_repo.branch(modname))
+
+                # Try meson first, then autotools
+                if os.path.exists(os.path.join(self.get_cwd(), 'meson.build')):
+                    from jhbuild.modtypes.meson import MesonModule
+                    module = MesonModule(modname, default_repo.branch(modname))
+                else:
+                    from jhbuild.modtypes.autotools import AutogenModule
+                    module = AutogenModule(modname, default_repo.branch(modname))
+
                 module.config = config
                 logging.info(_('module "%(modname)s" does not exist, created automatically using repository 
"%(reponame)s"') % \
                              {'modname': modname, 'reponame': default_repo.name})


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