[jhbuild] meson: Implement rudimentary dist and check support



commit 27912b80898c6e0385dc7118bcfd3df99f9ddd18
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Mon Jul 17 11:34:57 2017 -0500

    meson: Implement rudimentary dist and check support
    
    These commands seem to be pretty fragile and fail often, but it's not
    clear to me if JHBuild is to blame for that. At any rate, this is a good
    starting point.

 jhbuild/modtypes/meson.py |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/jhbuild/modtypes/meson.py b/jhbuild/modtypes/meson.py
index 7b54061..071c912 100644
--- a/jhbuild/modtypes/meson.py
+++ b/jhbuild/modtypes/meson.py
@@ -41,6 +41,8 @@ class MesonModule(MakeModule, DownloadableModule):
     PHASE_CLEAN = 'clean'
     PHASE_CONFIGURE = 'configure'
     PHASE_BUILD = 'build'
+    PHASE_CHECK = 'check'
+    PHASE_DIST = 'dist'
     PHASE_INSTALL = 'install'
 
     def __init__(self, name, branch=None,
@@ -143,6 +145,22 @@ class MesonModule(MakeModule, DownloadableModule):
     do_build.depends = [PHASE_CONFIGURE]
     do_build.error_phases = [PHASE_FORCE_CHECKOUT, PHASE_CONFIGURE]
 
+    def do_check(self, buildscript):
+        buildscript.set_action(_('Checking'), self)
+        builddir = self.get_builddir(buildscript)
+        self.ensure_ninja_binary()
+        buildscript.execute(self.ninja_binary + ' test', cwd=builddir, extra_env=self.extra_env)
+    do_check.depends = [PHASE_BUILD]
+    do_check.error_phases = [PHASE_FORCE_CHECKOUT, PHASE_CONFIGURE]
+
+    def do_dist(self, buildscript):
+        buildscript.set_action(_('Creating tarball for'), self)
+        builddir = self.get_builddir(buildscript)
+        self.ensure_ninja_binary()
+        buildscript.execute(self.ninja_binary + ' dist', cwd=builddir, extra_env=self.extra_env)
+    do_dist.depends = [PHASE_CONFIGURE]
+    do_dist.error_phases = [PHASE_FORCE_CHECKOUT, PHASE_CONFIGURE]
+
     def skip_install(self, buildscript, last_phase):
         return self.config.noinstall or self.skip_install_phase
 


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