]> git.pld-linux.org Git - packages/farsight2.git/blob - gstreamer-common-gtkdoc.patch
- _source_dir fix
[packages/farsight2.git] / gstreamer-common-gtkdoc.patch
1 From 2de221ce94b657f9c9a75aa3cc0cb84dbb5da78b Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.co.uk>
3 Date: Mon, 28 Jan 2013 20:28:09 +0100
4 Subject: [PATCH] gtk-doc*.mak: Put the API version in the html book name
5
6 This causes devhelp2 files to get a version. Due to that devhelp can show it
7 along with the 0.10 version.
8 ---
9  gtk-doc-plugins.mak | 11 ++++-------
10  gtk-doc.mak         | 11 ++++-------
11  2 files changed, 8 insertions(+), 14 deletions(-)
12
13 diff --git a/gtk-doc-plugins.mak b/gtk-doc-plugins.mak
14 index f69d9d7..f19e7d7 100644
15 --- a/gtk-doc-plugins.mak
16 +++ b/gtk-doc-plugins.mak
17 @@ -215,10 +215,7 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_
18         @for f in $(content_files); do cp $(srcdir)/$$f html; done
19         cp -pr xml html
20         cp ../version.entities html
21 -       cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
22 -       mv html/index.sgml html/index.sgml.bak
23 -       $(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)-@GST_MAJORMINOR@\//g" html/index.sgml.bak >html/index.sgml
24 -       rm -f html/index.sgml.bak
25 +       cd html && gtkdoc-mkhtml $(DOC_MODULE)-@GST_MAJORMINOR@ $(DOC_MAIN_SGML_FILE)
26         rm -f html/$(DOC_MAIN_SGML_FILE)
27         rm -rf html/xml
28         rm -f html/version.entities
29 @@ -267,11 +264,11 @@ install-data-local:
30               $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
31             done; \
32           fi; \
33 -         echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
34 -         $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
35 +         echo '-- Installing $(srcdir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp' ; \
36 +         $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp \
37             $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
38 -         if test -e $(srcdir)/html/$(DOC_MODULE).devhelp2; then \
39 -                   $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp2 \
40 +         if test -e $(srcdir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; then \
41 +                   $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2 \
42                     $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \
43           fi; \
44           (which gtkdoc-rebase >/dev/null && \
45 diff --git a/gtk-doc.mak b/gtk-doc.mak
46 index 17cee71..9d76889 100644
47 --- a/gtk-doc.mak
48 +++ b/gtk-doc.mak
49 @@ -137,10 +137,7 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_
50         @for f in $(content_files); do cp $(srcdir)/$$f html; done
51         cp -pr xml html
52         cp ../version.entities html
53 -       cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
54 -       mv html/index.sgml html/index.sgml.bak
55 -       $(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)-@GST_MAJORMINOR@\//g" html/index.sgml.bak >html/index.sgml
56 -       rm -f html/index.sgml.bak
57 +       cd html && gtkdoc-mkhtml $(DOC_MODULE)-@GST_MAJORMINOR@ $(DOC_MAIN_SGML_FILE)
58         rm -f html/$(DOC_MAIN_SGML_FILE)
59         rm -rf html/xml
60         rm -f html/version.entities
61 @@ -200,11 +197,11 @@ install-data-local:
62             echo '-- Installing '$$i ; \
63             $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
64           done; \
65 -         echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
66 -         $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
67 +         echo '-- Installing $(srcdir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp' ; \
68 +         $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp \
69             $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
70 -         if test -e $(srcdir)/html/$(DOC_MODULE).devhelp2; then \
71 -                   $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp2 \
72 +         if test -e $(srcdir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; then \
73 +                   $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2 \
74                     $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \
75           fi; \
76           (which gtkdoc-rebase >/dev/null && \
77 From d37af32e2d6d1b546af72978f8441a84996ab3ea Mon Sep 17 00:00:00 2001
78 From: Stefan Sauer <ensonic@users.sf.net>
79 Date: Sun, 7 Jun 2015 20:12:05 +0200
80 Subject: [PATCH] mangle-tmpl.py: generate tmpl files instead of merging
81
82 We don't have any hand-written docs in tmpl files. Stop generating them with
83 gtkdoc and just write the minimal files ourself.
84 ---
85  gtk-doc-plugins.mak | 15 +++--------
86  mangle-tmpl.py      | 72 ++++++++++++-----------------------------------------
87  2 files changed, 19 insertions(+), 68 deletions(-)
88
89 diff --git a/gtk-doc-plugins.mak b/gtk-doc-plugins.mak
90 index 5d9b2f9..767e55a 100644
91 --- a/gtk-doc-plugins.mak
92 +++ b/gtk-doc-plugins.mak
93 @@ -154,20 +154,10 @@ scan-build.stamp: $(HFILE_GLOB) $(EXTRA_
94             --ignore-headers="$(IGNORE_HFILES)";                        \
95         touch scan-build.stamp
96  
97 -#### update templates; done on every build ####
98 +#### generate templates; done on every build ####
99  
100 -### FIXME: make this error out again when docs are fixed for 0.9
101 -# in a non-srcdir build, we need to copy files from the previous step
102 -# and the files from previous runs of this step
103 -tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
104 -       @echo '*** Rebuilding template files ***'
105 -       if test x"$(srcdir)" != x. ; then                               \
106 -           for f in $(SCANOBJ_FILES) $(SCAN_FILES);                    \
107 -           do                                                          \
108 -               if test -e $(srcdir)/$$f; then cp $(srcdir)/$$f . ; fi; \
109 -           done;                                                       \
110 -       fi
111 -       gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
112 +tmpl-build.stamp:
113 +       @echo '  DOC   Building template files'
114         $(PYTHON) \
115                 $(top_srcdir)/common/mangle-tmpl.py $(srcdir)/inspect tmpl
116         @cat $(DOC_MODULE)-unused.txt
117 diff --git a/mangle-tmpl.py b/mangle-tmpl.py
118 index 51ea8c2..7a92d04 100644
119 --- a/mangle-tmpl.py
120 +++ b/mangle-tmpl.py
121 @@ -2,21 +2,12 @@
122  # vi:si:et:sw=4:sts=4:ts=4
123  
124  """
125 -use the output from gst-xmlinspect.py to mangle tmpl/*.sgml and
126 -insert/overwrite Short Description and Long Description
127 +use the files from inspect/*.xml to create mininal tmpl/*.sgml files containing
128 +'Short Description' and 'Long Description' to inject element details into the
129 +docbook files produced by gtkdoc-mkdb
130  """
131  
132 -# FIXME: right now it uses pygst and scans on its own;
133 -# we really should use inspect/*.xml instead since the result of
134 -# gst-xmlinspect.py is commited by the docs maintainer, who can be
135 -# expected to have pygst, but this step should be done for every docs build,
136 -# so no pygst allowed
137 -
138 -# read in inspect/*.xml
139 -# for every tmpl/element-(name).xml: mangle with details from element
140 -
141  import glob
142 -import re
143  import sys
144  import os
145  
146 @@ -28,37 +19,12 @@ def __init__(self, filename):
147          self._sectionids = []
148          self._sections = {}
149  
150 -    def read(self):
151 -        """
152 -        Read and parse the sections from the given file.
153 -        """
154 -        lines = open(self.filename).readlines()
155 -        matcher = re.compile("<!-- ##### SECTION (\S+) ##### -->\n")
156 -        id = None
157 -
158 -        for line in lines:
159 -            match = matcher.search(line)
160 -            if match:
161 -                id = match.expand("\\1")
162 -                self._sectionids.append(id)
163 -                self._sections[id] = []
164 -            else:
165 -                if not id:
166 -                    sys.stderr.write(
167 -                        "WARNING: line before a SECTION header: %s" % line)
168 -                else:
169 -                    self._sections[id].append(line)
170 -
171 -    def get_section(self, id):
172 -        """
173 -        Get the content from the given section.
174 -        """
175 -        return self._sections[id]
176 -
177      def set_section(self, id, content):
178          """
179          Replace the given section id with the given content.
180          """
181 +        if not id in self._sectionids:
182 +            self._sectionids.append(id)
183          self._sections[id] = content
184  
185      def output(self):
186 @@ -73,14 +39,10 @@ def output(self):
187  
188          return "".join(lines)
189  
190 -    def write(self, backup=False):
191 +    def write(self):
192          """
193          Write out the template file again, backing up the previous one.
194          """
195 -        if backup:
196 -            target = self.filename + ".mangle.bak"
197 -            os.rename(self.filename, target)
198 -
199          handle = open(self.filename, "w")
200          handle.write(self.output())
201          handle.close()
202 @@ -136,30 +98,28 @@ def main():
203      inspectdir = sys.argv[1]
204      tmpldir = sys.argv[2]
205  
206 +    if not os.path.exists (tmpldir):
207 +        os.mkdir(tmpldir)
208 +
209      # parse all .xml files; build map of element name -> short desc
210      #for file in glob.glob("inspect/plugin-*.xml"):
211      elements = {}
212      for file in glob.glob("%s/plugin-*.xml" % inspectdir):
213          elements.update(get_elements(file))
214  
215 -    for file in glob.glob("%s/element-*.sgml" % tmpldir):
216 -        base = os.path.basename(file)
217 -        element = base[len("element-"):-len(".sgml")]
218 +    for element in elements.keys():
219 +        file = "%s/element-%s.sgml" % (tmpldir, element)
220          tmpl = Tmpl(file)
221 -        tmpl.read()
222 -        if element in elements.keys():
223 -            description = elements[element]['description']
224 -            tmpl.set_section("Short_Description", "%s\n\n" % description)
225  
226 -        # put in an include if not yet there
227 +        description = elements[element]['description']
228 +        tmpl.set_section("Short_Description", "%s\n" % description)
229 +
230 +        # add include for details
231          line = '<include xmlns="http://www.w3.org/2003/XInclude" href="' + \
232              'element-' + element + '-details.xml">' + \
233              '<fallback xmlns="http://www.w3.org/2003/XInclude" />' + \
234              '</include>\n'
235 -        section = tmpl.get_section("Long_Description")
236 -        if not section[0]  == line:
237 -            section.insert(0, line)
238 -        tmpl.set_section("Long_Description", section)
239 +        tmpl.set_section("Long_Description", line)
240          tmpl.write()
241  
242  main()
243 From f363b3205658a38e84fa77f19dee218cd4445275 Mon Sep 17 00:00:00 2001
244 From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
245 Date: Mon, 20 Jun 2016 15:38:01 -0400
246 Subject: [PATCH] Fix handling of DOC_SOURCE_DIR list
247
248 As some places we where assuming a single directory. This caused some
249 plugins documentation to be ignored.
250 ---
251  gtk-doc-plugins.mak | 8 ++++++--
252  gtk-doc.mak         | 6 +++++-
253  2 files changed, 11 insertions(+), 3 deletions(-)
254
255 diff --git a/gtk-doc-plugins.mak b/gtk-doc-plugins.mak
256 index fe0977c..4b5dd1b 100644
257 --- a/gtk-doc-plugins.mak
258 +++ b/gtk-doc-plugins.mak
259 @@ -178,9 +178,13 @@ sgml-build.stamp: tmpl.stamp scan-build.
260                 $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done
261         @for f in $(EXAMPLE_CFILES); do \
262                 $(PYTHON) $(top_srcdir)/common/c-to-xml.py $$f > xml/element-`basename $$f .c`.xml; done
263 +       @_source_dir='' ;                                               \
264 +       for i in $(DOC_SOURCE_DIR) ; do                                 \
265 +           _source_dir="$${_source_dir} --source-dir=$$i" ;            \
266 +       done ;                                                          \
267         gtkdoc-mkdb \
268                 --module=$(DOC_MODULE) \
269 -               --source-dir=$(DOC_SOURCE_DIR) \
270 +               $${_source_dir} \
271                  --expand-content-files="$(expand_content_files)" \
272                 --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \
273                 --output-format=xml \
274 diff --git a/gtk-doc.mak b/gtk-doc.mak
275 index 2aab3a9..4beebcf 100644
276 --- a/gtk-doc.mak
277 +++ b/gtk-doc.mak
278 @@ -118,7 +118,11 @@ tmpl.stamp: tmpl-build.stamp
279  ### FIXME: make this error out again when docs are complete
280  sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) $(expand_content_files)
281         @echo '*** Building XML ***'
282 -       gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR)  --expand-content-files="$(expand_content_files)" --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) | tee sgml-build.log
283 +       @_source_dir='' ;                                               \
284 +       for i in $(DOC_SOURCE_DIR) ; do                                 \
285 +           _source_dir="$${_source_dir} --source-dir=$$i" ;            \
286 +       done ;                                                          \
287 +       gtkdoc-mkdb --module=$(DOC_MODULE) $${_source_dir}  --expand-content-files="$(expand_content_files)" --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) | tee sgml-build.log
288         @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
289         cp ../version.entities xml
290         rm sgml-build.log
This page took 0.201019 seconds and 3 git commands to generate.