From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QyLAk-0002FU-GA for garchives@archives.gentoo.org; Tue, 30 Aug 2011 10:03:58 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7A2AC21C195; Tue, 30 Aug 2011 10:03:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2A72B21C195 for ; Tue, 30 Aug 2011 10:03:49 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1404A1B417E for ; Tue, 30 Aug 2011 10:03:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 6C29780040 for ; Tue, 30 Aug 2011 10:03:48 +0000 (UTC) From: "Alexandre Restovtsev" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alexandre Restovtsev" Message-ID: <059cf1665a99c6d65ad836a65464ec38a8b3d4b9.tetromino@gentoo> Subject: [gentoo-commits] proj/gnome:gnome-next commit in: dev-libs/gobject-introspection/files/, dev-libs/gobject-introspection/ X-VCS-Repository: proj/gnome X-VCS-Files: dev-libs/gobject-introspection/files/1.29.17-docbookdescription.py dev-libs/gobject-introspection/files/gobject-introspection-0.10.8-make-check.patch dev-libs/gobject-introspection/gobject-introspection-1.29.16.ebuild dev-libs/gobject-introspection/gobject-introspection-1.29.17.ebuild dev-libs/gobject-introspection/gobject-introspection-9999.ebuild X-VCS-Directories: dev-libs/gobject-introspection/files/ dev-libs/gobject-introspection/ X-VCS-Committer: tetromino X-VCS-Committer-Name: Alexandre Restovtsev X-VCS-Revision: 059cf1665a99c6d65ad836a65464ec38a8b3d4b9 Date: Tue, 30 Aug 2011 10:03:48 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 7dcf605a4f27fd4265fdb31d4bdcd480 commit: 059cf1665a99c6d65ad836a65464ec38a8b3d4b9 Author: Alexandre Rostovtsev gmail com> AuthorDate: Tue Aug 30 09:36:35 2011 +0000 Commit: Alexandre Restovtsev gmail com> CommitDate: Tue Aug 30 10:02:03 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gnome.git;a=3D= commit;h=3D059cf166 dev-libs/gobject-introspection: 1.29.16 =E2=86=92 1.29.17 Version bump with numerous changes, including a new documentation generator tool. Tests patch was applied upstream. For some reason, the docbookdescription.py file is missing from the tarball, so we have to ship it in FILESDIR. See upstream bug 657686. --- .../files/1.29.17-docbookdescription.py | 185 ++++++++++++++= ++++++ .../gobject-introspection-0.10.8-make-check.patch | 110 ------------ ...ebuild =3D> gobject-introspection-1.29.17.ebuild} | 16 +- .../gobject-introspection-9999.ebuild | 8 +- 4 files changed, 197 insertions(+), 122 deletions(-) diff --git a/dev-libs/gobject-introspection/files/1.29.17-docbookdescript= ion.py b/dev-libs/gobject-introspection/files/1.29.17-docbookdescription.= py new file mode 100644 index 0000000..9ec7219 --- /dev/null +++ b/dev-libs/gobject-introspection/files/1.29.17-docbookdescription.py @@ -0,0 +1,185 @@ + +TAG_PROGRAM_LISTING =3D '', ''} + +def get_formatted_description(description): + desc =3D description.replace("|[", "") \ + .replace("]|", "") + + desc =3D "%s" % desc + +# we still need to handle this case +# # Handle "#include " +# $text =3D~ s/#include(\s+)<([^>]+)>/#include$1<$2>/g; + + formatted_desc =3D "" + + inside_tags =3D [] + last_offset =3D 0 + for start, end, tag in _find_xml_tag_matches(desc): + if len(inside_tags) =3D=3D 0: + new_desc =3D "\n\n\n".join(desc[last_offset:sta= rt].split('\n\n')) + else: + new_desc =3D desc[last_offset:start] + + if TAG_CDATA not in inside_tags: + new_desc =3D _escape_non_cdata_section(new_desc) + + formatted_desc +=3D new_desc + formatted_desc +=3D tag + if tag =3D=3D TAG_PROGRAM_LISTING: + formatted_desc +=3D '>' + + if tag in (TAG_CDATA, TAG_PROGRAM_LISTING): + inside_tags.append(tag) + else: + try: + inside_tags.pop() + except IndexError: + print "Error: mismatched tag:", tag + last_offset =3D end + + formatted_desc +=3D _escape_non_cdata_section(desc[last_offset:]) + return formatted_desc + +def _find_xml_tag_matches(string): + offset =3D 0 + while True: + indexes =3D [] + for tag in TAGS: + pos =3D string.find(tag, offset) + if pos !=3D -1: + indexes.append((tag, pos)) + + if indexes: + tag, first =3D min(indexes, key=3Dlambda x: x[1]) + if tag =3D=3D TAG_PROGRAM_LISTING: + end =3D string.find('>', first + len(tag) - 1) + 1 + else: + end =3D first + len(tag) + offset =3D end + yield first, end, tag + else: + return + +def _escape_non_cdata_section(string): + string =3D _escape_ampersand_not_in_entity(string) + string =3D _escape_lt_not_in_xml_tag(string) + return _escape_gt_not_in_xml_tag(string) + +def _escape_ampersand_not_in_entity(string): + parts =3D string.split('&') + + output =3D parts[0] + for part in parts[1:]: + end =3D part.find(';') + if end =3D=3D -1 or not part[:end].isalpha(): + output +=3D "&" + else: + output +=3D "&" + output +=3D part + + return output + +def _is_valid_xml_tag_name(name): + if len(name) < 1: + return False + elif name.isalpha() or (name[0].isalpha() and name[1:].isalnum()): + return True + +def _is_valid_xml_tag(string): + # handle case where line end is between tag name and first argument. + # ie. My Link + string =3D string.replace('\n', ' ') + + if string[-1] =3D=3D '/': + string =3D string[:-1] + + # string is the inner part of the tag, without < and > + if string[0] =3D=3D '/' and _is_valid_xml_tag_name(string[1:]): + #valid end tag + return True + elif _is_valid_xml_tag_name(string): + #valid start tag with not params + return True + elif " " in string: + # we are looking for: + # TODO: handle spaces in values (between quotations) + tagname, rest =3D string.split(" ", 1) + if not _is_valid_xml_tag_name(tagname): + return False + + while rest.strip(): + rest =3D rest.lstrip() + + if not '=3D' in rest: + return False + argname, rest =3D rest.split('=3D', 1) + if not _is_valid_xml_tag_name(argname): + return False + if rest[0] !=3D '"': + return False + value, rest =3D rest[1:].split('"', 1) + + return True + +def _escape_lt_not_in_xml_tag(string): + parts =3D string.split('<') + + output =3D parts[0] + for part in parts[1:]: + end =3D part.find('>') + if end =3D=3D -1 or not _is_valid_xml_tag(part[:end]): + output +=3D "<" + else: + output +=3D "<" + output +=3D part + + return output + +def _escape_gt_not_in_xml_tag(string): + parts =3D string.split('>') + + output =3D parts[0] + for part in parts[1:]: + start =3D output.rfind('<') + if start =3D=3D -1 or not _is_valid_xml_tag(output[start+1:]): + output +=3D ">" + else: + output +=3D ">" + output +=3D part + + return output + + +def test(): + assert _is_valid_xml_tag_name('a') + assert _is_valid_xml_tag_name('refsect1') + assert not _is_valid_xml_tag_name('1refsect') + assert not _is_valid_xml_tag_name('1') + + assert _is_valid_xml_tag('/a') + assert _is_valid_xml_tag('/refsect1') + assert not _is_valid_xml_tag('/1') + assert _is_valid_xml_tag('link') + assert _is_valid_xml_tag('link linkend=3D"value"') + assert _is_valid_xml_tag('link linkend=3D"value"') + assert _is_valid_xml_tag('link/') + assert _is_valid_xml_tag('link linkend=3D"value"/') + assert _is_valid_xml_tag('link linkend=3D"value" arg23=3D"anotherval= ue"') + assert _is_valid_xml_tag('link linkend=3D"value" arg23=3D"anotherval= ue with spaces"') + assert not _is_valid_xml_tag('link linkend=3D"value arg23=3D"another= value with spaces"') + assert not _is_valid_xml_tag('link linkend') + assert _is_valid_xml_tag('link\nlinkend=3D"link-id"') + assert _is_valid_xml_tag('xref linkend=3D"gtkstylecontext-classes"/'= ) + + assert _is_valid_xml_tag('a href=3D"http://www.gtk.org" title=3D"<= ;i>Our</i> website"') + assert _is_valid_xml_tag('ulink \nurl=3D"http://www.freedesktop.org/= Standards/wm-spec"') + + string =3D 'gtk_label_set_markup (label, "Go to the GTK+ website for= more...");' + assert _escape_lt_not_in_xml_tag(string) =3D=3D string + +if __name__ =3D=3D '__main__': + test() diff --git a/dev-libs/gobject-introspection/files/gobject-introspection-0= .10.8-make-check.patch b/dev-libs/gobject-introspection/files/gobject-int= rospection-0.10.8-make-check.patch deleted file mode 100644 index 546c9c6..0000000 --- a/dev-libs/gobject-introspection/files/gobject-introspection-0.10.8-m= ake-check.patch +++ /dev/null @@ -1,110 +0,0 @@ -From a71d73bf633d83c6a7f457c1f0acba378289f4c8 Mon Sep 17 00:00:00 2001 -From: Alexandre Rostovtsev -Date: Mon, 22 Aug 2011 02:49:51 -0400 -Subject: [PATCH] tests: build tests only on make check - -Use automake's check_ prefix and avoid putting anything nontrivial in -BUILT_SOURCES so that tests are build only on make check. - -The dummy -rpath in AM_LDFLAGS in tests/scanner/Makefile.am is needed to -force libtool to build shared libraries for check_LTLIBRARIESS targets -(automake builds check_LTLIBRARIES as static by default); see -http://lists.gnu.org/archive/html/automake/2005-10/msg00107.html - -Addresses https://bugzilla.gnome.org/show_bug.cgi?id=3D657066 ---- - tests/Makefile.am | 6 ++---- - tests/repository/Makefile.am | 2 +- - tests/scanner/Makefile.am | 16 ++++++---------- - 3 files changed, 9 insertions(+), 15 deletions(-) - -diff --git a/tests/Makefile.am b/tests/Makefile.am -index 20ecc17..2d395a3 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -16,16 +16,14 @@ tests_DATA =3D \ - gimarshallingtests.c \ - gimarshallingtests.h -=20 --testlib_LTLIBRARIES =3D libeverything-1.0.la libgimarshallingtests-1.0.= la --testlibdir=3D$(prefix)/unused --install-testlibLTLIBRARIES: # prevent it from being installed -+check_LTLIBRARIES =3D libeverything-1.0.la libgimarshallingtests-1.0.la -=20 - libeverything_1_0_la_SOURCES =3D everything.c - libgimarshallingtests_1_0_la_SOURCES =3D gimarshallingtests.c -=20 - EXTRA_DIST +=3D gimarshallingtests.h -=20 --BUILT_SOURCES +=3D everything.c everything.h Everything-1.0.gir GIMarsh= allingTests-1.0.gir -+BUILT_SOURCES +=3D everything.c everything.h -=20 - CLEANFILES +=3D \ - $(BUILT_SOURCES) \ -diff --git a/tests/repository/Makefile.am b/tests/repository/Makefile.am -index 268d9f9..ffc635f 100644 ---- a/tests/repository/Makefile.am -+++ b/tests/repository/Makefile.am -@@ -2,7 +2,7 @@ AM_CFLAGS =3D $(GOBJECT_CFLAGS) - AM_LDFLAGS =3D -module -avoid-version - LIBS =3D $(GOBJECT_LIBS) -=20 --noinst_PROGRAMS =3D gitestrepo gitestthrows gitypelibtest -+check_PROGRAMS =3D gitestrepo gitestthrows gitypelibtest -=20 - gitestrepo_SOURCES =3D $(srcdir)/gitestrepo.c - gitestrepo_CPPFLAGS =3D $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository -diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am -index 6b78ee7..fc2e260 100644 ---- a/tests/scanner/Makefile.am -+++ b/tests/scanner/Makefile.am -@@ -3,24 +3,21 @@ include $(top_srcdir)/Makefile.introspection -=20 - INTROSPECTION_SCANNER_ARGS +=3D --warn-all --warn-error -I. -=20 --# We need to build a shared library, which can be dlopened --# it does not work with noinst_LTLIBRARIES --testlib_LTLIBRARIES =3D \ -+check_LTLIBRARIES =3D \ - libannotation.la \ - libtestinherit.la \ - libfoo.la \ - libutility.la \ - libgtkfrob.la - if HAVE_CAIRO --testlib_LTLIBRARIES +=3D libregress.la -+check_LTLIBRARIES +=3D libregress.la - endif -=20 --testlibdir =3D $(prefix)/unused --install-testlibLTLIBRARIES: # prevent it from being installed -- - AM_CPPFLAGS =3D -I$(top_srcdir)/girepository - AM_CFLAGS =3D $(GIO_CFLAGS) $(GOBJECT_CFLAGS) $(GTHREAD_CFLAGS) --AM_LDFLAGS =3D -avoid-version -+# -rpath needed to force libtool to build a shared library for a check_= LTLIBRARIES -+# target. See http://lists.gnu.org/archive/html/automake/2005-10/msg001= 07.html -+AM_LDFLAGS =3D -rpath /unused -avoid-version - LIBS =3D $(GOBJECT_LIBS) $(GTHREAD_LIBS) -=20 - libannotation_la_SOURCES =3D $(srcdir)/annotation.c $(srcdir)/annotatio= n.h -@@ -49,7 +46,6 @@ CHECKGIRS =3D $(GIRS:.gir=3D.gir.check) - EXPECTEDGIRS =3D $(GIRS:.gir=3D-expected.gir) - INTROSPECTION_GIRS =3D $(GIRS) - CLEANFILES =3D $(TYPELIBS) $(GIRS) --BUILT_SOURCES =3D $(TYPELIBS) $(GIRS) - EXTRA_DIST =3D $(EXPECTEDGIRS) -=20 - Regress-1.0.gir: $(top_builddir)/Gio-2.0.gir libregress.la -@@ -102,7 +98,7 @@ GtkFrob_1_0_gir_FILES =3D $(libgtkfrob_la_SOURCES) - GtkFrob_1_0_gir_SCANNERFLAGS =3D --identifier-prefix=3DGtk --symbol-pre= fix=3Dgtk_frob - GIRS +=3D GtkFrob-1.0.gir -=20 --noinst_PROGRAMS =3D barapp -+check_PROGRAMS =3D barapp -=20 - barapp_SOURCES =3D $(srcdir)/barapp.c $(srcdir)/barapp.h - barapp_LDADD =3D $(top_builddir)/libgirepository-1.0.la ---=20 -1.7.6 - diff --git a/dev-libs/gobject-introspection/gobject-introspection-1.29.16= .ebuild b/dev-libs/gobject-introspection/gobject-introspection-1.29.17.eb= uild similarity index 81% rename from dev-libs/gobject-introspection/gobject-introspection-1.29.16.= ebuild rename to dev-libs/gobject-introspection/gobject-introspection-1.29.17.eb= uild index 2b3aa4b..0346999 100644 --- a/dev-libs/gobject-introspection/gobject-introspection-1.29.16.ebuild +++ b/dev-libs/gobject-introspection/gobject-introspection-1.29.17.ebuild @@ -8,7 +8,7 @@ GNOME_TARBALL_SUFFIX=3D"xz" GNOME2_LA_PUNT=3D"yes" PYTHON_DEPEND=3D"2:2.5" =20 -inherit autotools eutils gnome2 python +inherit gnome2 python if [[ ${PV} =3D 9999 ]]; then inherit gnome2-live fi @@ -32,7 +32,7 @@ DEPEND=3D"${RDEPEND} dev-util/pkgconfig sys-devel/bison sys-devel/flex - doc? ( >=3Ddev-util/gtk-doc-1.12 ) + doc? ( >=3Ddev-util/gtk-doc-1.15 ) test? ( x11-libs/cairo )" =20 pkg_setup() { @@ -50,18 +50,18 @@ src_prepare() { =20 # Don't pre-compile .py ln -sf $(type -P true) py-compile - - # Don't build tests when FEATURES=3D-test; bug #379929 - epatch "${FILESDIR}/${PN}-0.10.8-make-check.patch" - eautoreconf + ln -sf $(type -P true) build-aux/py-compile =20 gnome2_src_prepare } =20 src_install() { gnome2_src_install - python_convert_shebangs 2 "${ED}"usr/bin/g-ir-scanner - python_convert_shebangs 2 "${ED}"usr/bin/g-ir-annotation-tool + python_convert_shebangs 2 "${ED}"usr/bin/g-ir-{annotation-tool,doc-tool= ,scanner} + + # https://bugzilla.gnome.org/show_bug.cgi?id=3D657686 + insinto /usr/$(get_libdir)/${PN}/giscanner + newins "${FILESDIR}/${PV}-docbookdescription.py" docbookdescription.py } =20 pkg_postinst() { diff --git a/dev-libs/gobject-introspection/gobject-introspection-9999.eb= uild b/dev-libs/gobject-introspection/gobject-introspection-9999.ebuild index 70739cc..423d424 100644 --- a/dev-libs/gobject-introspection/gobject-introspection-9999.ebuild +++ b/dev-libs/gobject-introspection/gobject-introspection-9999.ebuild @@ -8,7 +8,7 @@ GNOME_TARBALL_SUFFIX=3D"xz" GNOME2_LA_PUNT=3D"yes" PYTHON_DEPEND=3D"2:2.5" =20 -inherit gnome2 python libtool +inherit gnome2 python if [[ ${PV} =3D 9999 ]]; then inherit gnome2-live fi @@ -32,7 +32,7 @@ DEPEND=3D"${RDEPEND} dev-util/pkgconfig sys-devel/bison sys-devel/flex - doc? ( >=3Ddev-util/gtk-doc-1.12 ) + doc? ( >=3Ddev-util/gtk-doc-1.15 ) test? ( x11-libs/cairo )" =20 pkg_setup() { @@ -50,14 +50,14 @@ src_prepare() { =20 # Don't pre-compile .py ln -sf $(type -P true) py-compile + ln -sf $(type -P true) build-aux/py-compile =20 gnome2_src_prepare } =20 src_install() { gnome2_src_install - python_convert_shebangs 2 "${ED}"usr/bin/g-ir-scanner - python_convert_shebangs 2 "${ED}"usr/bin/g-ir-annotation-tool + python_convert_shebangs 2 "${ED}"usr/bin/g-ir-{annotation-tool,doc-tool= ,scanner} } =20 pkg_postinst() {