[jhbuild] autotools: collect args from elements as well



commit de708b206ff1872f43d55b3d3e3ec4991b7c7184
Author: Ryan Lortie <desrt desrt ca>
Date:   Fri Dec 20 18:14:30 2013 -0500

    autotools: collect args from elements as well
    
    The autotools modtype has support for specifying autogenargs, makeargs
    and makeinstallargs as attributes on the <autotools/> tag.
    
    Add support for specifying additional arguments via the elements
    <autogenargs/>, <makeargs/> and <makeinstallargs/>.  The additional
    arguments are concatenated to the list.
    
    This is intended to be used with <conditional> to provide a way to
    customise the arguments based on the condition set.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720839

 jhbuild/modtypes/autotools.py |    6 ++++++
 modulesets/moduleset.dtd      |    9 ++++++++-
 modulesets/moduleset.rnc      |    8 +++++++-
 3 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/modtypes/autotools.py b/jhbuild/modtypes/autotools.py
index 583cf44..b8e7eea 100644
--- a/jhbuild/modtypes/autotools.py
+++ b/jhbuild/modtypes/autotools.py
@@ -399,6 +399,12 @@ def collect_args(instance, node, argtype):
     else:
         args = ''
 
+    for child in node.childNodes:
+        if child.nodeType == child.ELEMENT_NODE and child.nodeName == argtype:
+            if not child.hasAttribute('value'):
+                raise FatalError(_("<%s/> tag must contain value=''"), argtype)
+            args += ' ' + child.getAttribute('value')
+
     return instance.eval_args(args)
 
 def parse_autotools(node, config, uri, repositories, default_repo):
diff --git a/modulesets/moduleset.dtd b/modulesets/moduleset.dtd
index 8a97e57..bc9eed6 100644
--- a/modulesets/moduleset.dtd
+++ b/modulesets/moduleset.dtd
@@ -34,7 +34,7 @@
 <!ELEMENT include EMPTY>
 <!ATTLIST include href CDATA #REQUIRED>
 
-<!ELEMENT autotools (pkg-config?,branch,dependencies?,suggests?,after?)>
+<!ELEMENT autotools 
(autogenargs*,makeargs*,makeinstallargs*,pkg-config?,branch,dependencies?,suggests?,after?)>
 <!-- Note: Here the ID type is not used as some existing IDs in modsets are not
      valid XML ID types - instead CDATA is used -->
 <!ATTLIST autotools
@@ -50,6 +50,13 @@
        autogen-template CDATA  #IMPLIED
        check-target    (true|false) "true">
 
+<!ELEMENT autogenargs EMPTY>
+<!ATTLIST autogenargs value CDATA #REQUIRED>
+<!ELEMENT makeargs EMPTY>
+<!ATTLIST makeargs value CDATA #REQUIRED>
+<!ELEMENT makeinstallargs EMPTY>
+<!ATTLIST makeinstallargs value CDATA #REQUIRED>
+
 <!ELEMENT waf (pkg-config?,branch,dependencies?,suggests?,after?)>
 <!-- Note: Here the ID type is not used as some existing IDs in modsets are not
      valid XML ID types - instead CDATA is used -->
diff --git a/modulesets/moduleset.rnc b/modulesets/moduleset.rnc
index bedfd38..bb2b4a7 100644
--- a/modulesets/moduleset.rnc
+++ b/modulesets/moduleset.rnc
@@ -74,7 +74,7 @@ attlist.include &= attribute href { text }
 dependencieselements = dependencies?, suggests?, after?, systemdependencies?
 autotools =
   element autotools {
-    attlist.autotools, pkg-config?, branch, dependencieselements
+    attlist.autotools, autogenargs*, makeargs*, makeinstallargs*, pkg-config?, branch, dependencieselements
   }
 # Note: Here the ID type is not used as some existing IDs in modsets are not
 # valid XML ID types - instead CDATA is used
@@ -93,6 +93,12 @@ attlist.autotools &=
   attribute autogen-template { text }?,
   [ a:defaultValue = "true" ]
   attribute check-target { "true" | "false" }?
+autogenargs = element autogenargs { attlist.autogenargs }
+attlist.autogenargs &= attribute value { text }
+makeargs = element makeargs { attlist.makeargs }
+attlist.makeargs &= attribute value { text }
+makeinstallargs = element makeinstallargs { attlist.autogenargs }
+attlist.makeinstallargs &= attribute value { text }
 waf =
   element waf { attlist.waf, branch, dependencieselements }
 # Note: Here the ID type is not used as some existing IDs in modsets are not


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