[jhbuild] cmake: collect args from cmakeargs and makeargs tags



commit ae68cb8aa47321be53a76f7731c40b14c9e25eef
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Mon Aug 3 04:01:08 2015 +0800

    cmake: collect args from cmakeargs and makeargs tags
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753190

 jhbuild/modtypes/cmake.py |    8 ++++----
 modulesets/moduleset.dtd  |    5 ++++-
 modulesets/moduleset.rnc  |    5 ++++-
 3 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/jhbuild/modtypes/cmake.py b/jhbuild/modtypes/cmake.py
index 0c572d7..0a168a9 100644
--- a/jhbuild/modtypes/cmake.py
+++ b/jhbuild/modtypes/cmake.py
@@ -24,6 +24,7 @@ import os
 from jhbuild.errors import BuildStateError, CommandError
 from jhbuild.modtypes import \
      Package, DownloadableModule, register_module_type, MakeModule
+from jhbuild.modtypes.autotools import collect_args
 from jhbuild.commands.sanitycheck import inpath
 
 __all__ = [ 'CMakeModule' ]
@@ -134,16 +135,15 @@ def parse_cmake(node, config, uri, repositories, default_repo):
 
     instance.dependencies += ['cmake', instance.get_makecmd(config)]
 
+    instance.cmakeargs = collect_args(instance, node, 'cmakeargs')
+    instance.makeargs = collect_args(instance, node, 'makeargs')
+
     if node.hasAttribute('supports-non-srcdir-builds'):
         instance.supports_non_srcdir_builds = \
                 (node.getAttribute('supports-non-srcdir-builds') != 'no')
     if node.hasAttribute('force-non-srcdir-builds'):
         instance.force_non_srcdir_builds = \
                 (node.getAttribute('force-non-srcdir-builds') != 'no')
-    if node.hasAttribute('cmakeargs'):
-        instance.cmakeargs = node.getAttribute('cmakeargs')
-    if node.hasAttribute('makeargs'):
-        instance.makeargs = node.getAttribute('makeargs')
     return instance
 
 register_module_type('cmake', parse_cmake)
diff --git a/modulesets/moduleset.dtd b/modulesets/moduleset.dtd
index ae2af01..33e8f1f 100644
--- a/modulesets/moduleset.dtd
+++ b/modulesets/moduleset.dtd
@@ -102,13 +102,16 @@
        id      ID      #REQUIRED
        supports-non-srcdir-builds (yes|no) "yes">
 
-<!ELEMENT cmake (pkg-config?,branch?,dependencies?,suggests?,after?)>
+<!ELEMENT cmake (if*,cmakeargs*,makeargs*,pkg-config?,branch?,dependencies?,suggests?,after?)>
 <!ATTLIST cmake
        id              CDATA   #REQUIRED
        cmakeargs       CDATA   #IMPLIED
        makeargs        CDATA   #IMPLIED
        supports-non-srcdir-builds (yes|no) "yes">
 
+<!ELEMENT cmakeargs EMPTY>
+<!ATTLIST cmakeargs value CDATA #REQUIRED>
+
 <!ELEMENT perl (pkg-config?,branch?,dependencies?,after?)>
 <!ATTLIST perl
        id              CDATA   #REQUIRED
diff --git a/modulesets/moduleset.rnc b/modulesets/moduleset.rnc
index b7bac99..b767be2 100644
--- a/modulesets/moduleset.rnc
+++ b/modulesets/moduleset.rnc
@@ -145,11 +145,14 @@ attlist.distutils &=
   attribute id { xsd:ID },
   [ a:defaultValue = "yes" ]
   attribute supports-non-srcdir-builds { "yes" | "no" }?
-cmake = element cmake { attlist.cmake, pkg-config?, branch?, dependencieselements }
+cmakeargsif = element if { attlist.if, cmakeargsif*, cmakeargs*, makeargs* }
+cmake = element cmake { attlist.cmake, cmakeargsif*, cmakeargs*, makeargs*, pkg-config?, branch?, 
dependencieselements }
 attlist.cmake &=
   attribute id { text },
   attribute cmakeargs { text }?,
   attribute makeargs { text }?
+cmakeargs = element cmakeargs { attlist.cmakeargs }
+attlist.cmakeargs &= attribute value { text }
 perl = element perl { attlist.perl, branch?, dependencies?, after? }
 attlist.perl &=
   attribute id { text },


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