[packages/gstreamer0.10-gnonlin] - added gstreamer-common-gtkdoc patch to fix apidocs build with current gtk-doc; noarch subpackage
qboosh
qboosh at pld-linux.org
Wed Mar 10 21:33:44 CET 2021
commit 3cc391bec2b8fdc28721c77c5cc7729d36ac8438
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Mar 10 21:34:46 2021 +0100
- added gstreamer-common-gtkdoc patch to fix apidocs build with current gtk-doc; noarch subpackage
gstreamer-common-gtkdoc.patch | 411 ++++++++++++++++++++++++++++++++++++++++++
gstreamer0.10-gnonlin.spec | 14 ++
2 files changed, 425 insertions(+)
---
diff --git a/gstreamer0.10-gnonlin.spec b/gstreamer0.10-gnonlin.spec
index f8dfc27..b0322e8 100644
--- a/gstreamer0.10-gnonlin.spec
+++ b/gstreamer0.10-gnonlin.spec
@@ -14,14 +14,19 @@ License: LGPL v2+
Group: Applications/Multimedia
Source0: http://gstreamer.freedesktop.org/src/gnonlin/gnonlin-%{version}.tar.bz2
# Source0-md5: 0c9e5a8f771b087fac9afa459399112e
+Patch0: gstreamer-common-gtkdoc.patch
URL: http://gnonlin.sourceforge.net/
+BuildRequires: autoconf >= 2.60
+BuildRequires: automake >= 1:1.10
BuildRequires: docbook-dtd412-xml
BuildRequires: glib2-devel >= 1:2.22
BuildRequires: gstreamer0.10-devel >= %{gst_req_ver}
BuildRequires: gstreamer0.10-plugins-base-devel >= %{gstpb_req_ver}
%{?with_apidocs:BuildRequires: gtk-doc >= 1.8}
+BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: python >= 2.1
+BuildRequires: rpm-build >= 4.6
Requires: glib2 >= 1:2.22
Requires: gstreamer0.10 >= %{gst_req_ver}
Requires: gstreamer0.10-plugins-base >= %{gstpb_req_ver}
@@ -41,6 +46,7 @@ Summary: Gnonlin API documentation
Summary(pl.UTF-8): Dokumentacja API Gnonlin
Group: Documentation
Requires: gtk-doc-common
+BuildArch: noarch
%description apidocs
Gnonlin API documentation.
@@ -50,8 +56,16 @@ Dokumentacja API Gnonlin.
%prep
%setup -q -n gnonlin-%{version}
+cd common
+%patch0 -p1
%build
+%{__gtkdocize}
+%{__libtoolize}
+%{__aclocal} -I m4 -I common/m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
%configure \
--disable-silent-rules \
--disable-static \
diff --git a/gstreamer-common-gtkdoc.patch b/gstreamer-common-gtkdoc.patch
new file mode 100644
index 0000000..27a0ca9
--- /dev/null
+++ b/gstreamer-common-gtkdoc.patch
@@ -0,0 +1,411 @@
+From c3cafe123f3a363d337a29ad32fdd6d3631f52c0 Mon Sep 17 00:00:00 2001
+From: Stefan Kost <ensonic at users.sf.net>
+Date: Mon, 4 Apr 2011 15:36:58 +0300
+Subject: gtk-doc-plugins.mak: don't cat the ununsed symbols
+
+This is very noisy, we can check this during make check and anyway this list is
+avavilable in the report file. Was introduced with commit 9a5025a2.
+---
+ gtk-doc-plugins.mak | 1 -
+ 1 file changed, 1 deletion(-)
+
+(limited to 'gtk-doc-plugins.mak')
+
+diff --git a/gtk-doc-plugins.mak b/gtk-doc-plugins.mak
+index c0ff7b3..ca6a351 100644
+--- a/gtk-doc-plugins.mak
++++ b/gtk-doc-plugins.mak
+@@ -161,7 +161,6 @@ tmpl-build.stamp:
+ @echo ' DOC Building template files'
+ $(PYTHON) \
+ $(top_srcdir)/common/mangle-tmpl.py $(srcdir)/inspect tmpl
+- @cat $(DOC_MODULE)-unused.txt
+ rm -f tmpl-build.log
+ touch tmpl-build.stamp
+
+From 2de221ce94b657f9c9a75aa3cc0cb84dbb5da78b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete at collabora.co.uk>
+Date: Mon, 28 Jan 2013 20:28:09 +0100
+Subject: [PATCH] gtk-doc*.mak: Put the API version in the html book name
+
+This causes devhelp2 files to get a version. Due to that devhelp can show it
+along with the 0.10 version.
+---
+ gtk-doc-plugins.mak | 11 ++++-------
+ gtk-doc.mak | 11 ++++-------
+ 2 files changed, 8 insertions(+), 14 deletions(-)
+
+diff --git a/gtk-doc-plugins.mak b/gtk-doc-plugins.mak
+index f69d9d7..f19e7d7 100644
+--- a/gtk-doc-plugins.mak
++++ b/gtk-doc-plugins.mak
+@@ -216,10 +210,7 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_
+ @for f in $(content_files); do cp $(srcdir)/$$f html; done
+ cp -pr xml html
+ cp ../version.entities html
+- cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
+- mv html/index.sgml html/index.sgml.bak
+- $(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)- at GST_MAJORMINOR@\//g" html/index.sgml.bak >html/index.sgml
+- rm -f html/index.sgml.bak
++ cd html && gtkdoc-mkhtml $(DOC_MODULE)- at GST_MAJORMINOR@ $(DOC_MAIN_SGML_FILE)
+ rm -f html/$(DOC_MAIN_SGML_FILE)
+ rm -rf html/xml
+ rm -f html/version.entities
+@@ -268,11 +259,11 @@ install-data-local:
+ $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
+ done; \
+ fi; \
+- echo '-- Installing $(builddir)/html/$(DOC_MODULE).devhelp' ; \
+- $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp \
++ echo '-- Installing $(builddir)/html/$(DOC_MODULE)- at GST_MAJORMINOR@.devhelp' ; \
++ $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)- at GST_MAJORMINOR@.devhelp \
+ $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)- at GST_MAJORMINOR@.devhelp; \
+- if test -e $(builddir)/html/$(DOC_MODULE).devhelp2; then \
+- $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp2 \
++ if test -e $(builddir)/html/$(DOC_MODULE)- at GST_MAJORMINOR@.devhelp2; then \
++ $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)- at GST_MAJORMINOR@.devhelp2 \
+ $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)- at GST_MAJORMINOR@.devhelp2; \
+ fi; \
+ (which gtkdoc-rebase >/dev/null && \
+diff --git a/gtk-doc.mak b/gtk-doc.mak
+index 17cee71..9d76889 100644
+--- a/gtk-doc.mak
++++ b/gtk-doc.mak
+@@ -132,10 +132,7 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_
+ if test "$(?)" = "0"; then \
+ mkhtml_options=--path="$(abs_srcdir)"; \
+ fi; \
+- cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+- mv html/index.sgml html/index.sgml.bak
+- $(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)- at GST_MAJORMINOR@\//g" html/index.sgml.bak >html/index.sgml
+- rm -f html/index.sgml.bak
++ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE)- at GST_MAJORMINOR@ ../$(DOC_MAIN_SGML_FILE)
+ rm -rf html/xml
+ rm -f version.entities
+ test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html )
+@@ -190,11 +187,11 @@ install-data-local:
+ echo '-- Installing '$$i ; \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
+ done; \
+- echo '-- Installing $(builddir)/html/$(DOC_MODULE).devhelp' ; \
+- $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp \
++ echo '-- Installing $(builddir)/html/$(DOC_MODULE)- at GST_MAJORMINOR@.devhelp' ; \
++ $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)- at GST_MAJORMINOR@.devhelp \
+ $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)- at GST_MAJORMINOR@.devhelp; \
+- if test -e $(builddir)/html/$(DOC_MODULE).devhelp2; then \
+- $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp2 \
++ if test -e $(builddir)/html/$(DOC_MODULE)- at GST_MAJORMINOR@.devhelp2; then \
++ $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)- at GST_MAJORMINOR@.devhelp2 \
+ $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)- at GST_MAJORMINOR@.devhelp2; \
+ fi; \
+ (which gtkdoc-rebase >/dev/null && \
+From d37af32e2d6d1b546af72978f8441a84996ab3ea Mon Sep 17 00:00:00 2001
+From: Stefan Sauer <ensonic at users.sf.net>
+Date: Sun, 7 Jun 2015 20:12:05 +0200
+Subject: [PATCH] mangle-tmpl.py: generate tmpl files instead of merging
+
+We don't have any hand-written docs in tmpl files. Stop generating them with
+gtkdoc and just write the minimal files ourself.
+---
+ gtk-doc-plugins.mak | 15 +++--------
+ mangle-tmpl.py | 72 ++++++++++++-----------------------------------------
+ 2 files changed, 19 insertions(+), 68 deletions(-)
+
+diff --git a/gtk-doc-plugins.mak b/gtk-doc-plugins.mak
+index 5d9b2f9..767e55a 100644
+--- a/gtk-doc-plugins.mak
++++ b/gtk-doc-plugins.mak
+@@ -154,20 +154,10 @@ scan-build.stamp: $(HFILE_GLOB) $(EXTRA_
+ --ignore-headers="$(IGNORE_HFILES)"; \
+ touch scan-build.stamp
+
+-#### update templates; done on every build ####
++#### generate templates; done on every build ####
+
+-### FIXME: make this error out again when docs are fixed for 0.9
+-# in a non-srcdir build, we need to copy files from the previous step
+-# and the files from previous runs of this step
+-tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
+- @echo '*** Rebuilding template files ***'
+- if test x"$(srcdir)" != x. ; then \
+- for f in $(SCANOBJ_FILES) $(SCAN_FILES); \
+- do \
+- if test -e $(srcdir)/$$f; then cp $(srcdir)/$$f . ; fi; \
+- done; \
+- fi
+- gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
++tmpl-build.stamp:
++ @echo ' DOC Building template files'
+ $(PYTHON) \
+ $(top_srcdir)/common/mangle-tmpl.py $(srcdir)/inspect tmpl
+ @rm -f tmpl-build.log
+diff --git a/mangle-tmpl.py b/mangle-tmpl.py
+index 51ea8c2..7a92d04 100644
+--- a/mangle-tmpl.py
++++ b/mangle-tmpl.py
+@@ -2,21 +2,12 @@
+ # vi:si:et:sw=4:sts=4:ts=4
+
+ """
+-use the output from gst-xmlinspect.py to mangle tmpl/*.sgml and
+-insert/overwrite Short Description and Long Description
++use the files from inspect/*.xml to create mininal tmpl/*.sgml files containing
++'Short Description' and 'Long Description' to inject element details into the
++docbook files produced by gtkdoc-mkdb
+ """
+
+-# FIXME: right now it uses pygst and scans on its own;
+-# we really should use inspect/*.xml instead since the result of
+-# gst-xmlinspect.py is commited by the docs maintainer, who can be
+-# expected to have pygst, but this step should be done for every docs build,
+-# so no pygst allowed
+-
+-# read in inspect/*.xml
+-# for every tmpl/element-(name).xml: mangle with details from element
+-
+ import glob
+-import re
+ import sys
+ import os
+
+@@ -28,37 +19,12 @@ def __init__(self, filename):
+ self._sectionids = []
+ self._sections = {}
+
+- def read(self):
+- """
+- Read and parse the sections from the given file.
+- """
+- lines = open(self.filename).readlines()
+- matcher = re.compile("<!-- ##### SECTION (\S+) ##### -->\n")
+- id = None
+-
+- for line in lines:
+- match = matcher.search(line)
+- if match:
+- id = match.expand("\\1")
+- self._sectionids.append(id)
+- self._sections[id] = []
+- else:
+- if not id:
+- sys.stderr.write(
+- "WARNING: line before a SECTION header: %s" % line)
+- else:
+- self._sections[id].append(line)
+-
+- def get_section(self, id):
+- """
+- Get the content from the given section.
+- """
+- return self._sections[id]
+-
+ def set_section(self, id, content):
+ """
+ Replace the given section id with the given content.
+ """
++ if not id in self._sectionids:
++ self._sectionids.append(id)
+ self._sections[id] = content
+
+ def output(self):
+@@ -73,14 +39,10 @@ def output(self):
+
+ return "".join(lines)
+
+- def write(self, backup=False):
++ def write(self):
+ """
+ Write out the template file again, backing up the previous one.
+ """
+- if backup:
+- target = self.filename + ".mangle.bak"
+- os.rename(self.filename, target)
+-
+ handle = open(self.filename, "w")
+ handle.write(self.output())
+ handle.close()
+@@ -136,30 +98,28 @@ def main():
+ inspectdir = sys.argv[1]
+ tmpldir = sys.argv[2]
+
++ if not os.path.exists (tmpldir):
++ os.mkdir(tmpldir)
++
+ # parse all .xml files; build map of element name -> short desc
+ #for file in glob.glob("inspect/plugin-*.xml"):
+ elements = {}
+ for file in glob.glob("%s/plugin-*.xml" % inspectdir):
+ elements.update(get_elements(file))
+
+- for file in glob.glob("%s/element-*.sgml" % tmpldir):
+- base = os.path.basename(file)
+- element = base[len("element-"):-len(".sgml")]
++ for element in elements.keys():
++ file = "%s/element-%s.sgml" % (tmpldir, element)
+ tmpl = Tmpl(file)
+- tmpl.read()
+- if element in elements.keys():
+- description = elements[element]['description']
+- tmpl.set_section("Short_Description", "%s\n\n" % description)
+
+- # put in an include if not yet there
++ description = elements[element]['description']
++ tmpl.set_section("Short_Description", "%s\n" % description)
++
++ # add include for details
+ line = '<include xmlns="http://www.w3.org/2003/XInclude" href="' + \
+ 'element-' + element + '-details.xml">' + \
+ '<fallback xmlns="http://www.w3.org/2003/XInclude" />' + \
+ '</include>\n'
+- section = tmpl.get_section("Long_Description")
+- if not section[0] == line:
+- section.insert(0, line)
+- tmpl.set_section("Long_Description", section)
++ tmpl.set_section("Long_Description", line)
+ tmpl.write()
+
+ main()
+From f363b3205658a38e84fa77f19dee218cd4445275 Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne at collabora.com>
+Date: Mon, 20 Jun 2016 15:38:01 -0400
+Subject: [PATCH] Fix handling of DOC_SOURCE_DIR list
+
+As some places we where assuming a single directory. This caused some
+plugins documentation to be ignored.
+---
+ gtk-doc-plugins.mak | 8 ++++++--
+ gtk-doc.mak | 6 +++++-
+ 2 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/gtk-doc-plugins.mak b/gtk-doc-plugins.mak
+index fe0977c..4b5dd1b 100644
+--- a/gtk-doc-plugins.mak
++++ b/gtk-doc-plugins.mak
+@@ -178,9 +178,13 @@ sgml-build.stamp: tmpl.stamp scan-build.
+ $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done
+ @for f in $(EXAMPLE_CFILES); do \
+ $(PYTHON) $(top_srcdir)/common/c-to-xml.py $$f > xml/element-`basename $$f .c`.xml; done
++ @_source_dir='' ; \
++ for i in $(DOC_SOURCE_DIR) ; do \
++ _source_dir="$${_source_dir} --source-dir=$$i" ; \
++ done ; \
+ gtkdoc-mkdb \
+ --module=$(DOC_MODULE) \
+- --source-dir=$(DOC_SOURCE_DIR) \
++ $${_source_dir} \
+ --expand-content-files="$(expand_content_files)" \
+ --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \
+ --output-format=xml \
+diff --git a/gtk-doc.mak b/gtk-doc.mak
+index 2aab3a9..4beebcf 100644
+--- a/gtk-doc.mak
++++ b/gtk-doc.mak
+@@ -110,7 +110,11 @@ $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES)
+ ### FIXME: make this error out again when docs are complete
+ sgml-build.stamp: setup.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(expand_content_files)
+ @echo '*** Building XML ***'
+- gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) | tee sgml-build.log
++ @_source_dir='' ; \
++ for i in $(DOC_SOURCE_DIR) ; do \
++ _source_dir="$${_source_dir} --source-dir=$$i" ; \
++ done ; \
++ gtkdoc-mkdb --module=$(DOC_MODULE) $${_source_dir} --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) | tee sgml-build.log
+ @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
+ cp ../version.entities xml
+ rm sgml-build.log
+From 3f4aa969cbe39584a649d98d4cf321d78bd73092 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
+Date: Wed, 16 Aug 2017 11:23:18 +0200
+Subject: gstdoc-scangobj: Fix for gtk-doc >= 1.26
+
+gtk-doc 1.26 was converted to Python and the file was removed.
+Copy the needed function and remove the require gtkdoc-common.pl
+
+https://bugzilla.gnome.org/show_bug.cgi?id=786361
+---
+ gstdoc-scangobj | 63 ++++++++++++++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 53 insertions(+), 10 deletions(-)
+
+(limited to 'gstdoc-scangobj')
+
+diff --git a/gstdoc-scangobj b/gstdoc-scangobj
+index 906857c..2e84775 100755
+--- common/gstdoc-scangobj.orig 2011-01-20 20:51:24.000000000 +0100
++++ common/gstdoc-scangobj 2021-03-10 19:36:22.712196501 +0100
+@@ -30,16 +30,6 @@
+
+ use Getopt::Long;
+
+-my $GTK_DOC_PREFIX=`pkg-config --variable prefix gtk-doc`;
+-if ($GTK_DOC_PREFIX) {
+- chomp $GTK_DOC_PREFIX;
+- #print "Adding $GTK_DOC_PREFIX/share/gtk-doc/data to \@INC\n";
+- unshift @INC, "$GTK_DOC_PREFIX/share/gtk-doc/data";
+-} else {
+- unshift @INC, '/usr/share/gtk-doc/data';
+-}
+-require "gtkdoc-common.pl";
+-
+ # Options
+
+ # name of documentation module
+@@ -1798,6 +1788,59 @@ if (!defined($ENV{"GTK_DOC_KEEP_INTERMED
+ unlink "./$MODULE-scan.c", "./$MODULE-scan.o", "./$MODULE-scan.lo", "./$MODULE-scan";
+ }
+
++# Copied from gtk-doc 1db161bd708cdfb88b362ea0b5d047034d9c3272
++#############################################################################
++# Function : UpdateFileIfChanged
++# Description : Compares the old version of the file with the new version and
++# if the file has changed it moves the new version into the old
++# versions place. This is used so we only change files if
++# needed, so we can do proper dependency tracking and we don't
++# needlessly check files into version control systems that haven't
++# changed.
++# It returns 0 if the file hasn't changed, and 1 if it has.
++# Arguments : $old_file - the pathname of the old file.
++# $new_file - the pathname of the new version of the file.
++# $make_backup - 1 if a backup of the old file should be kept.
++# It will have the .bak suffix added to the file name.
++#############################################################################
++
++sub UpdateFileIfChanged {
++ my ($old_file, $new_file, $make_backup) = @_;
++
++ #@TRACE@("Comparing $old_file with $new_file...");
++
++ # If the old file doesn't exist we want this to default to 1.
++ my $exit_code = 1;
++
++ if (-e $old_file) {
++ `cmp -s "$old_file" "$new_file"`;
++ $exit_code = $? >> 8;
++ #@TRACE@(" cmp exit code: $exit_code ($?)");
++ }
++
++ if ($exit_code > 1) {
++ die "Error running 'cmp $old_file $new_file'";
++ }
++
++ if ($exit_code == 1) {
++ #@TRACE@(" files changed - replacing old version with new version.");
++ if ($make_backup && -e $old_file) {
++ rename ($old_file, "$old_file.bak")
++ || die "Can't move $old_file to $old_file.bak: $!";
++ }
++ rename ($new_file, $old_file)
++ || die "Can't move $new_file to $old_file: $!";
++
++ return 1;
++ } else {
++ #@TRACE@(" files the same - deleting new version.");
++ unlink ("$new_file")
++ || die "Can't delete file: $new_file: $!";
++
++ return 0;
++ }
++}
++
+ #&UpdateFileIfChanged ($old_signals_filename, $new_signals_filename, 0);
+ &UpdateFileIfChanged ($old_hierarchy_filename, $new_hierarchy_filename, 0);
+ &UpdateFileIfChanged ($old_interfaces_filename, $new_interfaces_filename, 0);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/gstreamer0.10-gnonlin.git/commitdiff/3cc391bec2b8fdc28721c77c5cc7729d36ac8438
More information about the pld-cvs-commit
mailing list