[jhbuild] Allow expressing arguments for Ninja



commit 57d00a93f50610043ffc6caff36c9ca2fde8d748
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Apr 5 16:12:25 2018 +0100

    Allow expressing arguments for Ninja
    
    Ninja-based modules, like MesonModule and CMakeModule, need a way to
    control the arguments passed to Ninja — mostly, the ability to set the
    `-j 1` argument to disable parallel builds.
    
    We tried with commit f8c0519693 to overload makeargs for that, but it
    had to be reverted because, unsurprisingly, make and ninja have
    different ideas about what arguments are valid, and jhbuild has global
    options for Make arguments.
    
    Let's try again, this time introducing a NinjaModule base class, in
    parallel to the existing MakeModule one; the NinjaModule class can do
    all the Ninja discovery and execution, and control the configuration
    options — both global and per module.
    
    The MesonModule class can inherit straight from NinjaModule, thus
    removing all the ad hoc code that used MakeModule for the set up, but
    then ignored its `make()` method.
    
    The CMakeModule is a bit of a nasty case, as CMake can have both a Make
    and a Ninja backend, which means we need to inherit from MakeModule and
    NinjaModule; luckily, both MakeModule and NinjaModule inherit from the
    shared Package class, so we don't have conflicting initializations.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782320

 doc/C/index.docbook          |   45 ++++++++++++++++++++++++++++++++++++-
 jhbuild/config.py            |    8 +++---
 jhbuild/defaults.jhbuildrc   |    2 +
 jhbuild/modtypes/__init__.py |   50 +++++++++++++++++++++++++++++++++++++++++-
 jhbuild/modtypes/cmake.py    |   39 ++++++++++++--------------------
 jhbuild/modtypes/meson.py    |   46 +++++++++++---------------------------
 modulesets/moduleset.dtd     |    8 ++++--
 modulesets/moduleset.rnc     |    8 ++++--
 8 files changed, 137 insertions(+), 69 deletions(-)
---
diff --git a/doc/C/index.docbook b/doc/C/index.docbook
index 7a92596..f47eb79 100644
--- a/doc/C/index.docbook
+++ b/doc/C/index.docbook
@@ -283,6 +283,15 @@
               <varname>module_mesonargs</varname></link> dictionary.</simpara>
           </listitem>
         </varlistentry>
+        <varlistentry>
+          <term>
+            <link linkend="cfg-ninjaargs"><varname>ninjaargs</varname></link>
+          </term>
+          <listitem>
+            <simpara>A string listing additional arguments to be passed to
+              <command>ninja</command>. Defaults to <literal>''</literal>.</simpara>
+          </listitem>
+        </varlistentry>
       </variablelist>
     </section>
 
@@ -2025,6 +2034,19 @@ Optional packages: (JHBuild will build the missing packages)
               used.</simpara>
           </listitem>
         </varlistentry>
+        <varlistentry id="cfg-module-ninjaargs">
+          <term>
+            <varname>module_ninjaargs</varname>
+          </term>
+          <listitem>
+            <simpara>A dictionary mapping module names to strings specifying
+              the arguments to pass to <command>ninja</command>. The setting in
+              <varname>module_ninjaargs</varname> replaces the value of
+              <varname>ninjaargs</varname>. If a particular module isn't listed
+              in the dictionary, the global <varname>ninjaargs</varname> will be
+              used.</simpara>
+          </listitem>
+        </varlistentry>
         <varlistentry id="cfg-module-makecheck">
           <term>
             <varname>module_makecheck</varname>
@@ -3066,8 +3088,11 @@ Optional packages: (JHBuild will build the missing packages)
 <programlisting>
   &lt;cmake id="<replaceable>modulename</replaceable>"
             [ cmakeargs="<replaceable>cmakeargs</replaceable>" ]
+            [ ninjaargs="<replaceable>ninjaargs</replaceable>" ]
+            [ makeargs="<replaceable>makeargs</replaceable>" ]
             [ skip-install="<replaceable>skip-install</replaceable>" ]
             [ cmakedir="<replaceable>cmakedir</replaceable>" ]
+            [ use-ninja="<replaceable>use-ninja</replaceable>" ]
             [ force-non-srcdir-builds="<replaceable>force-non-srcdir-builds</replaceable>" ]&gt;
   &lt;branch [ ... ] &gt;
     [...]
@@ -3087,6 +3112,14 @@ Optional packages: (JHBuild will build the missing packages)
           used to specify additional arguments to pass to
           <command>cmake</command>.</para>
 
+        <para>The <sgmltag class="attribute">ninjaargs</sgmltag> attribute is
+          used to specify additional arguments to pass to
+          <command>ninja</command>.</para>
+
+        <para>The <sgmltag class="attribute">makeargs</sgmltag> attribute is
+          used to specify additional arguments to pass to
+          <command>make</command>.</para>
+
         <para>The <sgmltag class="attribute">cmakedir</sgmltag> attribute
           specifies the subdirectory where cmake will run in relation to srcdir.
         </para>
@@ -3094,17 +3127,24 @@ Optional packages: (JHBuild will build the missing packages)
         <para>The <sgmltag class="attribute">force-non-srcdir-builds</sgmltag>
           attribute is used to mark modules that can't be cleanly built from
           the source directory, but can be built from outside it.</para>
+
+        <para>The <sgmltag class="attribute">use-ninja</sgmltag>
+          attribute is used to mark modules should be built using the
+          Ninja backend for cmake, instead of the Make backend. The
+          default is to use the Ninja backend.</para>
       </section>
 
       <section id="moduleset-syntax-defs-meson">
         <title>Meson</title>
 
         <para>The <sgmltag class="element">meson</sgmltag> element is used to
-          define a module which is built using the Meson build system.</para>
+          define a module which is configured using the Meson build system and
+          built using the Ninja build tool.</para>
 
 <programlisting>
   &lt;meson id="<replaceable>modulename</replaceable>"
             [ mesonargs="<replaceable>mesonargs</replaceable>" ]
+            [ ninjaargs="<replaceable>ninjaargs</replaceable>" ]
             [ skip-install="<replaceable>skip-install</replaceable>" ]&gt;
   &lt;branch [ ... ] &gt;
     [...]
@@ -3123,6 +3163,9 @@ Optional packages: (JHBuild will build the missing packages)
         <para>The <sgmltag class="attribute">mesonargs</sgmltag> attribute is
           used to specify additional arguments to pass to
           <command>meson</command>.</para>
+        <para>The <sgmltag class="attribute">ninjaargs</sgmltag> attribute is
+          used to specify additional arguments to pass to
+          <command>ninja</command>.</para>
       </section>
 
       <section id="moduleset-syntax-defs-distutils">
diff --git a/jhbuild/config.py b/jhbuild/config.py
index 1dcc144..3d99486 100644
--- a/jhbuild/config.py
+++ b/jhbuild/config.py
@@ -46,10 +46,10 @@ _known_keys = [ 'moduleset', 'modules', 'skip', 'tags', 'prefix',
                 'autogenargs', 'makeargs', 'nice_build', 'jobs',
                 'installprog', 'repos', 'branches', 'noxvfb', 'xvfbargs',
                 'builddir_pattern', 'module_autogenargs', 'module_makeargs',
-                'interact', 'buildscript', 'nonetwork', 'nobuild',
-                'alwaysautogen', 'noinstall', 'makeclean', 'makedistclean',
-                'makecheck', 'module_makecheck', 'system_libdirs',
-                'tinderbox_outputdir', 'sticky_date', 'tarballdir',
+                'module_ninjaargs', 'ninjaargs', 'interact', 'buildscript',
+                'nonetwork', 'nobuild', 'alwaysautogen', 'noinstall',
+                'makeclean', 'makedistclean', 'makecheck', 'module_makecheck',
+                'system_libdirs', 'tinderbox_outputdir', 'sticky_date', 'tarballdir',
                 'pretty_print', 'svn_program', 'makedist', 'makedistcheck',
                 'nonotify', 'notrayicon', 'cvs_program', 'checkout_mode',
                 'copy_dir', 'module_checkout_mode', 'build_policy',
diff --git a/jhbuild/defaults.jhbuildrc b/jhbuild/defaults.jhbuildrc
index c490d15..ca56e04 100644
--- a/jhbuild/defaults.jhbuildrc
+++ b/jhbuild/defaults.jhbuildrc
@@ -80,6 +80,7 @@ autogenargs = '--disable-static --disable-gtk-doc'
 cmakeargs = ''
 mesonargs = '--buildtype=debugoptimized -Dgtk_doc=false'
 makeargs = ''
+ninjaargs = ''
 cflags = ''
 
 # a alternative install program to use
@@ -94,6 +95,7 @@ module_autogenargs = {}
 module_cmakeargs = {}
 module_mesonargs = {}
 module_makeargs = {}
+module_ninjaargs = {}
 module_extra_env = {}
 module_makecheck = {}
 module_nopoison = {}
diff --git a/jhbuild/modtypes/__init__.py b/jhbuild/modtypes/__init__.py
index 60d10d9..f33307a 100644
--- a/jhbuild/modtypes/__init__.py
+++ b/jhbuild/modtypes/__init__.py
@@ -35,6 +35,7 @@ import logging
 from jhbuild.errors import FatalError, CommandError, BuildStateError, \
              SkipToEnd, UndefinedRepositoryError
 from jhbuild.utils.sxml import sxml
+from jhbuild.commands.sanitycheck import inpath
 import jhbuild.utils.fileutils as fileutils
 
 _module_types = {}
@@ -513,6 +514,53 @@ them into the prefix."""
         instance.dependencies += instance.branch.repository.get_sysdeps()
         return instance
 
+class NinjaModule(Package):
+    '''A base class for modules that use the command 'ninja' within the build
+    process.'''
+    def __init__(self, name, branch=None,
+                 ninjaargs='',
+                 ninjainstallargs='',
+                 ninjafile='build.ninja'):
+        Package.__init__(self, name, branch=branch)
+        self.ninjacmd = None
+        self.ninjaargs = ninjaargs
+        self.ninjainstallargs = ninjainstallargs
+        self.ninjafile = ninjafile
+
+    def get_ninjaargs(self, buildscript):
+        ninjaargs = ' %s %s' % (self.ninjaargs,
+                                self.config.module_ninjaargs.get(
+                                  self.name, self.config.ninjaargs))
+        if not self.supports_parallel_build:
+            ninjaargs = re.sub(r'-j\w*\d+', '', ninjaargs) + ' -j 1'
+        return self.eval_args(ninjaargs).strip()
+
+    def get_ninjacmd(self, config):
+        if self.ninjacmd:
+            return self.ninjacmd
+        for cmd in ['ninja', 'ninja-build']:
+            if inpath(cmd, os.environ['PATH'].split(os.pathsep)):
+                self.ninjacmd = cmd
+                break
+        return self.ninjacmd
+
+    def ninja(self, buildscript, target='', ninjaargs=None, env=None):
+        ninjacmd = os.environ.get('NINJA', self.get_ninjacmd(buildscript.config))
+        if ninjacmd is None:
+            raise BuildStateError(_('ninja not found; use NINJA to point to a specific ninja binary'))
+
+        if ninjaargs is None:
+            ninjaargs = self.get_ninjaargs(buildscript)
+
+        extra_env = (self.extra_env or {}).copy()
+        for k in (env or {}):
+            extra_env[k] = env[k]
+
+        cmd = '{ninja} {ninjaargs} {target}'.format(ninja=ninjacmd,
+                                                    ninjaargs=ninjaargs,
+                                                    target=target)
+        buildscript.execute(cmd, cwd=self.get_builddir(buildscript), extra_env=extra_env)
+
 class MakeModule(Package):
     '''A base class for modules that use the command 'make' within the build
     process.'''
@@ -547,7 +595,7 @@ class MakeModule(Package):
         makecmd = os.environ.get('MAKE', self.get_makecmd(buildscript.config))
 
         if makeargs is None:
-            makeargs = self.get_makeargs(self, buildscript)
+            makeargs = self.get_makeargs(buildscript)
 
         cmd = '{pre}{make} {makeargs} {target}'.format(pre=pre,
                                                         make=makecmd,
diff --git a/jhbuild/modtypes/cmake.py b/jhbuild/modtypes/cmake.py
index d7868db..1df76bc 100644
--- a/jhbuild/modtypes/cmake.py
+++ b/jhbuild/modtypes/cmake.py
@@ -24,13 +24,13 @@ import shutil
 
 from jhbuild.errors import BuildStateError, CommandError
 from jhbuild.modtypes import \
-     Package, DownloadableModule, register_module_type, MakeModule
+     Package, DownloadableModule, register_module_type, MakeModule, NinjaModule
 from jhbuild.modtypes.autotools import collect_args
 from jhbuild.commands.sanitycheck import inpath
 
 __all__ = [ 'CMakeModule' ]
 
-class CMakeModule(MakeModule, DownloadableModule):
+class CMakeModule(MakeModule, NinjaModule, DownloadableModule):
     """Base type for modules that use CMake build system."""
     type = 'cmake'
 
@@ -42,9 +42,10 @@ class CMakeModule(MakeModule, DownloadableModule):
     PHASE_INSTALL = 'install'
 
     def __init__(self, name, branch=None,
-                 cmakeargs='', makeargs='',
+                 cmakeargs='', makeargs='', ninjaargs='',
                  skip_install_phase=False):
         MakeModule.__init__(self, name, branch=branch, makeargs=makeargs)
+        NinjaModule.__init__(self, name, branch=branch, ninjaargs=ninjaargs)
         self.cmakeargs = cmakeargs
         self.supports_non_srcdir_builds = True
         self.skip_install_phase = skip_install_phase
@@ -53,16 +54,6 @@ class CMakeModule(MakeModule, DownloadableModule):
         self.use_ninja = True
         self.cmakedir = None
 
-    def ensure_ninja_binary(self):
-        for f in ['ninja', 'ninja-build']:
-            if inpath(f, os.environ['PATH'].split(os.pathsep)):
-                self.ninja_binary = f
-                return
-
-        self.use_ninja = False
-
-        raise CommandError(_('%s not found') % 'ninja')
-
     def eval_args(self, args):
         args = Package.eval_args(self, args)
         args = args.replace('${libsuffix}', '')
@@ -122,8 +113,7 @@ class CMakeModule(MakeModule, DownloadableModule):
         buildscript.set_action(_('Cleaning'), self)
         builddir = self.get_builddir(buildscript)
         if self.use_ninja:
-            self.ensure_ninja_binary()
-            buildscript.execute(self.ninja_binary + ' clean', cwd=builddir, extra_env=self.extra_env)
+            self.ninja(buildscript, 'clean')
         else:
             self.make(buildscript, 'clean')
     do_clean.depends = [PHASE_CONFIGURE]
@@ -133,8 +123,7 @@ class CMakeModule(MakeModule, DownloadableModule):
         buildscript.set_action(_('Building'), self)
         builddir = self.get_builddir(buildscript)
         if self.use_ninja:
-            self.ensure_ninja_binary()
-            buildscript.execute(self.ninja_binary, cwd=builddir, extra_env=self.extra_env)
+            self.ninja(buildscript)
         else:
             self.make(buildscript)
     do_build.depends = [PHASE_CONFIGURE]
@@ -142,10 +131,10 @@ class CMakeModule(MakeModule, DownloadableModule):
 
     def do_dist(self, buildscript):
         buildscript.set_action(_('Creating tarball for'), self)
-        if not self.use_ninja:
+        if self.use_ninja:
             self.make(buildscript, 'package_source')
         else:
-            raise CommandError(_('%s does not support dist') % 'ninja')
+            self.ninja(buildscript, 'package_source')
     do_dist.depends = [PHASE_CONFIGURE]
     do_dist.error_phases = [PHASE_FORCE_CHECKOUT, PHASE_CONFIGURE]
 
@@ -157,10 +146,7 @@ class CMakeModule(MakeModule, DownloadableModule):
         builddir = self.get_builddir(buildscript)
         destdir = self.prepare_installroot(buildscript)
         if self.use_ninja:
-            self.ensure_ninja_binary()
-            extra_env = self.extra_env or {}
-            extra_env['DESTDIR'] = destdir
-            buildscript.execute(self.ninja_binary + ' install', cwd=builddir, extra_env=extra_env)
+            self.ninja(buildscript, 'install', env={'DESTDIR': destdir})
         else:
             self.make(buildscript, 'install DESTDIR={}'.format(destdir))
         self.process_install(buildscript, self.get_revision())
@@ -180,10 +166,15 @@ 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', instance.get_makecmd(config)]
+    instance.dependencies += [
+        'cmake',
+        instance.get_ninjacmd(config),
+        instance.get_makecmd(config),
+    ]
 
     instance.cmakeargs = collect_args(instance, node, 'cmakeargs')
     instance.makeargs = collect_args(instance, node, 'makeargs')
+    instance.ninjaargs = collect_args(instance, node, 'ninjaargs')
 
     if node.hasAttribute('skip-install'):
         skip_install = node.getAttribute('skip-install')
diff --git a/jhbuild/modtypes/meson.py b/jhbuild/modtypes/meson.py
index 071c912..59fedfb 100644
--- a/jhbuild/modtypes/meson.py
+++ b/jhbuild/modtypes/meson.py
@@ -24,17 +24,16 @@ import shutil
 
 from jhbuild.errors import BuildStateError, CommandError
 from jhbuild.modtypes import \
-     Package, DownloadableModule, register_module_type, MakeModule
+     Package, DownloadableModule, register_module_type, NinjaModule
 from jhbuild.modtypes.autotools import collect_args
 from jhbuild.commands.sanitycheck import inpath
 from jhbuild.utils import fileutils
 
 __all__ = [ 'MesonModule' ]
 
-class MesonModule(MakeModule, DownloadableModule):
+class MesonModule(NinjaModule, DownloadableModule):
     """Base type for modules that use Meson build system."""
     type = 'meson'
-    ninja_binary = ''
 
     PHASE_CHECKOUT = DownloadableModule.PHASE_CHECKOUT
     PHASE_FORCE_CHECKOUT = DownloadableModule.PHASE_FORCE_CHECKOUT
@@ -46,23 +45,15 @@ class MesonModule(MakeModule, DownloadableModule):
     PHASE_INSTALL = 'install'
 
     def __init__(self, name, branch=None,
-                 mesonargs='', makeargs='',
+                 mesonargs='', ninjaargs='',
                  skip_install_phase=False):
-        MakeModule.__init__(self, name, branch=branch, makeargs=makeargs)
+        NinjaModule.__init__(self, name, branch=branch, ninjaargs=ninjaargs)
         self.mesonargs = mesonargs
         self.supports_non_srcdir_builds = True
         self.skip_install_phase = skip_install_phase
         self.force_non_srcdir_builds = True
         self.supports_install_destdir = True
 
-    def ensure_ninja_binary(self):
-        for f in ['ninja', 'ninja-build']:
-            if inpath(f, os.environ['PATH'].split(os.pathsep)):
-                self.ninja_binary = f
-                return
-
-        raise CommandError(_('%s not found') % 'ninja')
-
     def eval_args(self, args):
         args = Package.eval_args(self, args)
         args = args.replace('${libsuffix}', '')
@@ -131,33 +122,26 @@ class MesonModule(MakeModule, DownloadableModule):
 
     def do_clean(self, buildscript):
         buildscript.set_action(_('Cleaning'), self)
-        builddir = self.get_builddir(buildscript)
-        self.ensure_ninja_binary()
-        buildscript.execute(self.ninja_binary + ' clean', cwd=builddir, extra_env=self.extra_env)
+        self.ninja(buildscript, 'clean')
     do_clean.depends = [PHASE_CONFIGURE]
     do_clean.error_phases = [PHASE_FORCE_CHECKOUT, PHASE_CONFIGURE]
 
     def do_build(self, buildscript):
         buildscript.set_action(_('Building'), self)
-        builddir = self.get_builddir(buildscript)
-        self.ensure_ninja_binary()
-        buildscript.execute(self.ninja_binary, cwd=builddir, extra_env=self.extra_env)
+        self.ninja(buildscript)
     do_build.depends = [PHASE_CONFIGURE]
-    do_build.error_phases = [PHASE_FORCE_CHECKOUT, PHASE_CONFIGURE]
+    do_build.error_phases = [PHASE_FORCE_CHECKOUT, PHASE_CONFIGURE,
+            PHASE_CLEAN]
 
     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)
+        self.ninja(buildscript, 'test')
     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)
+        self.ninja(buildscript, 'dist')
     do_dist.depends = [PHASE_CONFIGURE]
     do_dist.error_phases = [PHASE_FORCE_CHECKOUT, PHASE_CONFIGURE]
 
@@ -166,12 +150,8 @@ class MesonModule(MakeModule, DownloadableModule):
 
     def do_install(self, buildscript):
         buildscript.set_action(_('Installing'), self)
-        builddir = self.get_builddir(buildscript)
         destdir = self.prepare_installroot(buildscript)
-        extra_env = (self.extra_env or {}).copy()
-        extra_env['DESTDIR'] = destdir
-        self.ensure_ninja_binary()
-        buildscript.execute(self.ninja_binary + ' install', cwd=builddir, extra_env=extra_env)
+        self.ninja(buildscript, 'install', env={'DESTDIR': destdir})
         self.process_install(buildscript, self.get_revision())
     do_install.depends = [PHASE_BUILD]
 
@@ -183,10 +163,10 @@ class MesonModule(MakeModule, DownloadableModule):
 def parse_meson(node, config, uri, repositories, default_repo):
     instance = MesonModule.parse_from_xml(node, config, uri, repositories, default_repo)
 
-    instance.dependencies += ['meson', instance.get_makecmd(config)]
+    instance.dependencies += ['meson', instance.get_ninjacmd(config)]
 
     instance.mesonargs = collect_args(instance, node, 'mesonargs')
-    instance.makeargs = collect_args(instance, node, 'makeargs')
+    instance.ninjaargs = collect_args(instance, node, 'ninjaargs')
 
     if node.hasAttribute('skip-install'):
         skip_install = node.getAttribute('skip-install')
diff --git a/modulesets/moduleset.dtd b/modulesets/moduleset.dtd
index 09301fa..ee8c88e 100644
--- a/modulesets/moduleset.dtd
+++ b/modulesets/moduleset.dtd
@@ -10,7 +10,7 @@
      DTD also appears to be incapable of describing the fact that
      exactly one of condition-set='' and condition-unset='' is required.
 -->
-<!ELEMENT if (if|dep|autogenargs|cmakeargs|mesonargs|makeargs|makeinstallargs)+>
+<!ELEMENT if (if|dep|autogenargs|cmakeargs|mesonargs|makeargs|ninjaargs|makeinstallargs)+>
 <!ATTLIST if
        condition-set   CDATA   #IMPLIED
        condition-unset CDATA   #IMPLIED>
@@ -106,11 +106,13 @@
        python3 CDATA   #FIXED "1"
        supports-non-srcdir-builds (yes|no) "yes">
 
-<!ELEMENT cmake (if*,cmakeargs*,makeargs*,pkg-config?,branch?,dependencies?,suggests?,after?)>
+<!ELEMENT cmake (if*,cmakeargs*,makeargs*,ninjaargs*,pkg-config?,branch?,dependencies?,suggests?,after?)>
 <!ATTLIST cmake
        id              CDATA   #REQUIRED
        cmakeargs       CDATA   #IMPLIED
        makeargs        CDATA   #IMPLIED
+        ninjaargs       CDATA   #IMPLIED
+        use-ninja (yes|no) "yes"
        supports-non-srcdir-builds (yes|no) "yes"
        force-non-srcdir-builds (yes|no) "no">
 
@@ -121,7 +123,7 @@
 <!ATTLIST meson
        id              CDATA   #REQUIRED
        mesonargs       CDATA   #IMPLIED
-       makeargs        CDATA   #IMPLIED>
+       ninjaargs       CDATA   #IMPLIED>
 
 <!ELEMENT mesonargs EMPTY>
 <!ATTLIST mesonargs value CDATA #REQUIRED>
diff --git a/modulesets/moduleset.rnc b/modulesets/moduleset.rnc
index a16cde1..040da24 100644
--- a/modulesets/moduleset.rnc
+++ b/modulesets/moduleset.rnc
@@ -150,22 +150,24 @@ attlist.distutils &=
   [ a:defaultValue = "yes" ]
   attribute python3 { "1" }?,
   attribute supports-non-srcdir-builds { "yes" | "no" }?
-cmakeargsif = element if { attlist.if & cmakeargsif* & cmakeargs* & makeargs* }
+cmakeargsif = element if { attlist.if & cmakeargsif* & cmakeargs* & makeargs* & ninjaargs* }
 cmake = element cmake { attlist.cmake, cmakeargsif*, cmakeargs*, makeargs*, pkg-config?, branch?, 
dependencieselements }
 attlist.cmake &=
   attribute id { text },
   attribute cmakeargs { text }?,
   attribute makeargs { text }?,
+  attribute ninjaargs { text }?,
+  attribute use-ninja { "yes" | "no" }?,
   attribute supports-non-srcdir-builds { "yes" | "no" }?,
   attribute force-non-srcdir-builds { "yes" | "no" }?
 cmakeargs = element cmakeargs { attlist.cmakeargs }
 attlist.cmakeargs &= attribute value { text }
-mesonargsif = element if { attlist.if & mesonargsif* & mesonargs* & makeargs* }
+mesonargsif = element if { attlist.if & mesonargsif* & mesonargs* & ninjaargs* }
 meson = element meson { attlist.meson, mesonargsif*, mesonargs*, makeargs*, pkg-config?, branch?, 
dependencieselements }
 attlist.meson &=
   attribute id { text },
   attribute mesonargs { text }?,
-  attribute makeargs { text }?
+  attribute ninjaargs { text }?
 mesonargs = element mesonargs { attlist.mesonargs }
 attlist.mesonargs &= attribute value { text }
 perl = element perl { attlist.perl, branch?, dependencies?, after? }


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