diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:46:08 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:46:12 +0900 |
commit | 8f84035446a18a116660c366cc7980151788fadd (patch) | |
tree | 67ba8a8b28a627909ad5e0c20f695c2d5f2f14b5 | |
parent | bf771f934ed4458525881db5163079fb7caa2c9a (diff) | |
download | pygobject2-8f84035446a18a116660c366cc7980151788fadd.tar.gz pygobject2-8f84035446a18a116660c366cc7980151788fadd.tar.bz2 pygobject2-8f84035446a18a116660c366cc7980151788fadd.zip |
Imported Upstream version 3.24.0
Change-Id: I9b584c475691c42be680b39d0a6974e62f77a4e4
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
36 files changed, 1065 insertions, 743 deletions
@@ -1,3 +1,217 @@ +commit bffbb4b1f823de5035e51e013dc6da5a973045aa +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Mon Mar 20 14:23:59 2017 +0100 + + configure.ac: pre-release version bump to 3.24.0 + + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 78defd2ab5f1935a6226336eaa08727e7516fb02 +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Mon Mar 13 20:14:37 2017 +0100 + + release 3.23.92 + + NEWS | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 4ccabfec0cececba935339ea8449ec51b4aeef5e +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Mon Mar 13 20:13:13 2017 +0100 + + Version bump to 3.23.92 + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ebc245c477c36fa1f65f80d2e75792b82d837611 +Author: Fabian Orccon <cfoch.fabian@gmail.com> +Date: Tue Jan 24 00:00:12 2017 -0500 + + overrides: Update for Gdk-4.0 and Gtk+-4.0 + + Override Gdk.Color and Gdk.RGBA according version. + Use properly Gtk.init_check in Gtk+-4.0 + + https://bugzilla.gnome.org/show_bug.cgi?id=777680 + + gi/overrides/Gdk.py | 74 + ++++++++++++++++++++++++++++------------------------- + gi/overrides/Gtk.py | 7 +++-- + 2 files changed, 44 insertions(+), 37 deletions(-) + +commit d005df9645fd5fb2f19bd09384355f45591f1e58 +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Mon Jan 23 21:26:05 2017 +0100 + + Disable -Werror=missing-prototypes + + https://bugzilla.gnome.org/show_bug.cgi?id=760056 + added some code triggering "missing-prototype" which we by default + treat as an error. This disables that specific error by default. + + https://bugzilla.gnome.org/show_bug.cgi?id=777534 + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6695931a0dfb7d9db9ea14a128108342c3d0be89 +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Mon Jan 9 20:44:11 2017 +0100 + + Fix new PEP8 errors + + Two new errors popped up: + + * E305 expected 2 blank lines after class or function definition + * E741 ambiguous variable name + + https://bugzilla.gnome.org/show_bug.cgi?id=776009 + + examples/cairo-demo.py | 1 + + examples/properties.py | 1 + + gi/_option.py | 1 + + gi/overrides/GIMarshallingTests.py | 2 ++ + gi/overrides/GLib.py | 19 +++++++++++++++++++ + gi/overrides/GObject.py | 12 ++++++++++++ + gi/overrides/Gdk.py | 3 +++ + gi/overrides/Gio.py | 2 ++ + gi/overrides/Gtk.py | 35 + +++++++++++++++++++++++++++++++++++ + gi/overrides/Pango.py | 2 ++ + gi/types.py | 1 + + pygtkcompat/pygtkcompat.py | 1 + + tests/test_generictreemodel.py | 1 + + tests/test_interface.py | 4 ++++ + tests/test_iochannel.py | 1 + + tests/test_overrides_gtk.py | 10 +++++----- + tests/test_properties.py | 12 ++++++------ + tests/test_signal.py | 1 + + 18 files changed, 98 insertions(+), 11 deletions(-) + +commit 3f68e0a352abc12e1990e82e3134c48f0be2b3c9 +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Wed Mar 23 17:07:53 2016 +0100 + + Move pep8/pyflakes tests from 'make check' to 'make check.quality' + + The current behaviour is problematic because new versions of + pep8/pyflakes + add new warnings or get more picky. This makes testing + hard in case newly added code is developed on an older version + or when testing old branches/releases. + + This moves the pep8/pyflakes tests to a new "make check.quality" + command. + + This also removes the SKIP_PEP8 flag which was added in + 25d12afd06863ce + to speed up make check. + + https://bugzilla.gnome.org/show_bug.cgi?id=764087 + + HACKING | 2 +- + Makefile.am | 12 +++++------- + 2 files changed, 6 insertions(+), 8 deletions(-) + +commit 222f5581c38551bdd5c6c9ca4e895d1f44397ad1 +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Fri Oct 21 13:59:54 2016 +0200 + + overrides: Update for Gtk-4.0 + + Skip things which are gone since 4.0. + This only fixes importing and doesn't add any tests for now. + + https://bugzilla.gnome.org/show_bug.cgi?id=773315 + + gi/overrides/Gtk.py | 482 + ++++++++++++++++++++++++++-------------------------- + 1 file changed, 242 insertions(+), 240 deletions(-) + +commit 8694e4dd42565f07b6f9ba1221fb03146be333a0 +Author: Dan Nicholson <nicholson@endlessm.com> +Date: Wed Dec 21 12:02:14 2016 -0600 + + Handle exception unreffing Variant at exit + + Calling unref will cause gi and gi.repository.GLib to be imported. + However, if the program is exiting, then these modules have likely + been + removed from sys.modules and will raise an exception. Assume + that's the + case for ImportError and ignore the exception since everything will be + cleaned up, anyways. + + This can be triggered with the following trivial program: + + $ python3 -c 'from gi.repository import GLib; v = GLib.Variant("s", + "foo")' + Exception ignored in: + + Adding some debug code to show the full exception revealed this: + + Traceback (most recent call last): + File "/home/dan/src/pygobject/build3/gi/overrides/GLib.py", line + 265, in __del__ + self.unref() + ImportError: import of 'gi.repository.GLib' halted; None in + sys.modules + + https://bugzilla.gnome.org/show_bug.cgi?id=776092 + + gi/overrides/GLib.py | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +commit 54c623ba639654716ca475f75c92cc8ed673d9f5 +Author: Dan Nicholson <nicholson@endlessm.com> +Date: Wed Dec 21 11:50:08 2016 -0600 + + Handle multiple deinit of callable cache + + In python3, it seems that the callable cache deinit can be called + multiple times when the program is exiting. Make that safer by + clearing + the various pointers in the structure using g_clear_pointer and + Py_CLEAR. A subsequent call will skip all the deinit by seeing NULL + pointers for the members. + + This was causing a critical warning when destroying the arg name hash + table multiple times with the following trivial program: + + $ python3 -c 'from gi.repository import GLib; v = GLib.Variant("s", + "foo")' + + (process:32378): GLib-CRITICAL **: g_hash_table_destroy: assertion + 'hash_table != NULL' failed + + (process:32378): GLib-CRITICAL **: g_hash_table_destroy: assertion + 'hash_table != NULL' failed + + https://bugzilla.gnome.org/show_bug.cgi?id=776092 + + gi/pygi-cache.c | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +commit 94226b8eb63dd985def8501168572ee16e02acad +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Mon Sep 19 15:31:57 2016 +0200 + + configure.ac: post-release version bump to 3.23.0 + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fb1b8fa8a67f2c7ea7ad4b53076496a8f2b4afdb +Author: Christoph Reiter <creiter@src.gnome.org> +Date: Mon Sep 19 15:27:35 2016 +0200 + + release 3.22.0 + + NEWS | 3 +++ + 1 file changed, 3 insertions(+) + commit b93523fcdb6bc04b42709ecd30b8cd11de80f0c5 Author: Christoph Reiter <creiter@src.gnome.org> Date: Mon Sep 19 15:24:35 2016 +0200 @@ -21247,14 +21461,14 @@ Date: Mon Jul 18 10:56:36 2011 -0400 3 files changed, 1 insertion(+), 1050 deletions(-) commit 2937cfe5bb7122dd3783c7919294d6a34a3dfc05 -Merge: 519e556 917ea2d +Merge: 519e556d 917ea2df Author: John (J5) Palmieri <johnp@redhat.com> Date: Mon Jul 18 10:45:18 2011 -0400 Merge branch 'master' into invoke-rewrite commit 519e556dc1e5874e1668bad93043fb9258c7ee79 -Merge: bab7e88 38cca3c +Merge: bab7e882 38cca3c1 Author: John (J5) Palmieri <johnp@redhat.com> Date: Mon Jul 18 10:37:20 2011 -0400 @@ -21787,14 +22001,14 @@ Date: Tue Jun 14 16:12:43 2011 -0400 1 file changed, 16 insertions(+), 8 deletions(-) commit fbf5382fbc1aed49ed491d2255d616a1643a45fc -Merge: 499b68d 1491f62 +Merge: 499b68d6 1491f622 Author: John (J5) Palmieri <johnp@redhat.com> Date: Mon Jun 13 17:28:23 2011 -0400 Merge branch 'master' into invoke-rewrite commit 499b68d6c9040cffc6e43dc87789d68446564a92 -Merge: 4c9bced 426c710 +Merge: 4c9bcedb 426c7109 Author: John (J5) Palmieri <johnp@redhat.com> Date: Mon Jun 13 17:26:37 2011 -0400 @@ -22697,7 +22911,7 @@ Date: Tue Mar 22 14:46:29 2011 -0400 2 files changed, 337 insertions(+), 267 deletions(-) commit 17cb714cfdaf45b6d7dd627b0189bd24e6578f74 -Merge: 7332a1b 01596a9 +Merge: 7332a1b9 01596a9b Author: John (J5) Palmieri <johnp@redhat.com> Date: Tue Mar 22 13:34:36 2011 -0400 @@ -24714,7 +24928,7 @@ Date: Fri Jan 21 09:54:14 2011 +0100 2 files changed, 43 insertions(+), 1 deletion(-) commit 71dd03261fc06b8180c14cd31b54d8e4b200be3a -Merge: bc29600 bd002c7 +Merge: bc29600a bd002c72 Author: Dieter Verfaillie <dieterv@optionexplicit.be> Date: Fri Jan 21 09:33:16 2011 +0100 @@ -25458,7 +25672,7 @@ Date: Tue Jan 18 07:16:40 2011 -0500 1 file changed, 24 insertions(+), 18 deletions(-) commit f56d85a7f39c2088bf9fd50b1b1e5b67c03104d3 -Merge: 84d6142 7d997b6 +Merge: 84d6142c 7d997b6f Author: Sebastian Pölsterl <sebp@k-d-w.org> Date: Tue Jan 18 13:14:45 2011 +0100 @@ -27497,7 +27711,7 @@ Date: Thu Nov 4 12:00:14 2010 -0400 7 files changed, 84 insertions(+), 12 deletions(-) commit 878b8f630acd2146bee364054acd45cd33eea37a -Merge: cdacaa9 e317838 +Merge: cdacaa95 e3178381 Author: John Stowers <john.stowers@gmail.com> Date: Fri Nov 5 11:40:22 2010 +1300 @@ -30206,7 +30420,7 @@ Date: Tue Jun 22 14:45:48 2010 -0400 1 file changed, 3 insertions(+), 2 deletions(-) commit fb1ee243493616d7a7e4f6924c574db39f5a423d -Merge: acf7b43 5f9cb91 +Merge: acf7b43a 5f9cb91c Author: Tomeu Vizoso <tomeu.vizoso@collabora.co.uk> Date: Wed Jun 23 12:53:05 2010 +0200 @@ -30424,7 +30638,7 @@ Date: Sun Jun 20 11:09:57 2010 -0300 39 files changed, 75 insertions(+), 137 deletions(-) commit 597bd64319d7966045b5b8613ca6fc85668c3f56 -Merge: ec8d148 fa91dfd +Merge: ec8d148e fa91dfd3 Author: Johan Dahlin <johan@gnome.org> Date: Sun Jun 20 10:53:46 2010 -0300 diff --git a/Makefile.am b/Makefile.am index 186cfd7..6171e18 100644 --- a/Makefile.am +++ b/Makefile.am @@ -176,18 +176,16 @@ dist-hook: $(BUILT_EXTRA_DIST) # pycheck_subdirs = -check-local: +check.quality: @echo " CHECK Pyflakes" $(pycheck_dirs) @if type pyflakes >/dev/null 2>&1; then \ (cd $(abs_top_srcdir) && pyflakes $(pycheck_dirs) ); \ else echo "skipped, pyflakes not installed"; \ fi - @if test -z "$$SKIP_PEP8"; then \ - echo " CHECK PEP8"; \ - if type pep8 >/dev/null 2>&1; then \ - (cd $(abs_top_srcdir) && pep8 --ignore=E501,E123,E124,E402,E731 --repeat --show-source $(pycheck_dirs) ); \ - else echo "skipped, pep8 not installed"; \ - fi; \ + @echo " CHECK PEP8"; + @if type pep8 >/dev/null 2>&1; then \ + (cd $(abs_top_srcdir) && pep8 --ignore=E501,E123,E124,E402,E731 --repeat --show-source $(pycheck_dirs) ); \ + else echo "skipped, pep8 not installed"; \ fi check.gdb: diff --git a/Makefile.in b/Makefile.in index 9e3a948..94c17bd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -268,6 +268,7 @@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -1197,18 +1198,16 @@ dist-hook: $(BUILT_EXTRA_DIST) # pycheck_subdirs = -check-local: +check.quality: @echo " CHECK Pyflakes" $(pycheck_dirs) @if type pyflakes >/dev/null 2>&1; then \ (cd $(abs_top_srcdir) && pyflakes $(pycheck_dirs) ); \ else echo "skipped, pyflakes not installed"; \ fi - @if test -z "$$SKIP_PEP8"; then \ - echo " CHECK PEP8"; \ - if type pep8 >/dev/null 2>&1; then \ - (cd $(abs_top_srcdir) && pep8 --ignore=E501,E123,E124,E402,E731 --repeat --show-source $(pycheck_dirs) ); \ - else echo "skipped, pep8 not installed"; \ - fi; \ + @echo " CHECK PEP8"; + @if type pep8 >/dev/null 2>&1; then \ + (cd $(abs_top_srcdir) && pep8 --ignore=E501,E123,E124,E402,E731 --repeat --show-source $(pycheck_dirs) ); \ + else echo "skipped, pep8 not installed"; \ fi check.gdb: @@ -1,3 +1,16 @@ +3.24.0 20-Mar-2017 + - configure.ac: pre-release version bump to 3.24.0 (Christoph Reiter) + +3.23.92 13-Mar-2017 + - overrides: Update for Gdk-4.0 and Gtk+-4.0 (Fabian Orccon) (#777680) + - Disable -Werror=missing-prototypes (Christoph Reiter) (#777534) + - Fix new PEP8 errors (Christoph Reiter) (#776009) + - Move pep8/pyflakes tests from 'make check' to 'make check.quality' (Christoph Reiter) (#764087) + - overrides: Update for Gtk-4.0 (Christoph Reiter) (#773315) + - Handle exception unreffing Variant at exit (Dan Nicholson) (#776092) + - Handle multiple deinit of callable cache (Dan Nicholson) (#776092) + - configure.ac: post-release version bump to 3.23.0 (Christoph Reiter) + 3.22.0 19-Sep-2016 - configure.ac: pre-release version bump to 3.22.0 (Christoph Reiter) @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: PyGObject -Version: 3.22.0 +Version: 3.24.0 Summary: Python bindings for GObject Home-page: http://www.pygtk.org/ Author: James Henstridge @@ -8,7 +8,7 @@ Author-email: james@daa.com.au Maintainer: Simon Feltman Maintainer-email: sfeltman@src.gnome.org License: GNU LGPL -Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.22/pygobject-3.22.0.tar.gz +Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.24/pygobject-3.24.0.tar.gz Description: Python bindings for GLib and GObject Platform: POSIX, Windows Classifier: Development Status :: 5 - Production/Stable @@ -20,6 +20,282 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) +dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +dnl serial 11 (pkg-config-0.29) +dnl +dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. +dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])dnl PKG_PROG_PKG_CONFIG + +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])dnl _PKG_CONFIG + +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])dnl _PKG_SHORT_ERRORS_SUPPORTED + + +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])dnl PKG_CHECK_MODULES + + +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_INSTALLDIR + + +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_NOARCH_INSTALLDIR + + +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])dnl PKG_CHECK_VAR + # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html # =========================================================================== @@ -31,9 +307,9 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # DESCRIPTION # # Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS, -# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LDFLAGS which should be -# included in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LDFLAGS variables of -# every build target (program or library) which should be built with code +# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included +# in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every +# build target (program or library) which should be built with code # coverage support. Also defines CODE_COVERAGE_RULES which should be # substituted in your Makefile; and $enable_code_coverage which can be # used in subsequent configure output. CODE_COVERAGE_ENABLED is defined @@ -55,7 +331,7 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # Makefile.am: # # @CODE_COVERAGE_RULES@ -# my_program_LIBS = ... $(CODE_COVERAGE_LDFLAGS) ... +# my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ... # my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ... # my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... # my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ... @@ -67,6 +343,11 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # (`make check`) and build a code coverage report detailing the code which # was touched, then print the URI for the report. # +# In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined +# instead of CODE_COVERAGE_LIBS. They are both still defined, but use of +# CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is +# deprecated. They have the same value. +# # This code was derived from Makefile.decl in GLib, originally licenced # under LGPLv2.1+. # @@ -92,7 +373,7 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -#serial 15 +#serial 20 AC_DEFUN([AX_CODE_COVERAGE],[ dnl Check for --enable-code-coverage @@ -128,49 +409,56 @@ AC_DEFUN([AX_CODE_COVERAGE],[ AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage]) ]) - # List of supported lcov versions. - lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12" - AC_CHECK_PROG([LCOV], [lcov], [lcov]) AC_CHECK_PROG([GENHTML], [genhtml], [genhtml]) - AS_IF([ test "$LCOV" ], [ - AC_CACHE_CHECK([for lcov version], ax_cv_lcov_version, [ - ax_cv_lcov_version=invalid - lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'` - for lcov_check_version in $lcov_version_list; do - if test "$lcov_version" = "$lcov_check_version"; then - ax_cv_lcov_version="$lcov_check_version (ok)" - fi - done - ]) - ], [ - lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list" - AC_MSG_ERROR([$lcov_msg]) + AS_IF([ test -z "$LCOV" ], [ + AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed]) ]) - case $ax_cv_lcov_version in - ""|invalid[)] - lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)." - AC_MSG_ERROR([$lcov_msg]) - LCOV="exit 0;" - ;; - esac - AS_IF([ test -z "$GENHTML" ], [ AC_MSG_ERROR([Could not find genhtml from the lcov package]) ]) dnl Build the code coverage flags + dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility CODE_COVERAGE_CPPFLAGS="-DNDEBUG" CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_LDFLAGS="-lgcov" + CODE_COVERAGE_LIBS="-lgcov" + CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" AC_SUBST([CODE_COVERAGE_CPPFLAGS]) AC_SUBST([CODE_COVERAGE_CFLAGS]) AC_SUBST([CODE_COVERAGE_CXXFLAGS]) + AC_SUBST([CODE_COVERAGE_LIBS]) AC_SUBST([CODE_COVERAGE_LDFLAGS]) + + [CODE_COVERAGE_RULES_CHECK=' + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture +'] + [CODE_COVERAGE_RULES_CAPTURE=' + $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) + $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp + $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) + @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" +'] + [CODE_COVERAGE_RULES_CLEAN=' +clean: code-coverage-clean +distclean: code-coverage-clean +code-coverage-clean: + -$(LCOV) --directory $(top_builddir) -z + -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete +'] + ], [ + [CODE_COVERAGE_RULES_CHECK=' + @echo "Need to reconfigure with --enable-code-coverage" +'] + CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" + CODE_COVERAGE_RULES_CLEAN='' ]) [CODE_COVERAGE_RULES=' @@ -250,36 +538,15 @@ code_coverage_quiet_0 = --quiet code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) # Use recursive makes in order to ignore errors during check -check-code-coverage: -ifeq ($(CODE_COVERAGE_ENABLED),yes) - -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check - $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture -else - @echo "Need to reconfigure with --enable-code-coverage" -endif +check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' # Capture code coverage data -code-coverage-capture: code-coverage-capture-hook -ifeq ($(CODE_COVERAGE_ENABLED),yes) - $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) - $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) - -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp - $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) - @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" -else - @echo "Need to reconfigure with --enable-code-coverage" -endif +code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' # Hook rule executed before code-coverage-capture, overridable by the user code-coverage-capture-hook: -ifeq ($(CODE_COVERAGE_ENABLED),yes) -clean: code-coverage-clean -code-coverage-clean: - -$(LCOV) --directory $(top_builddir) -z - -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -find . -name "*.gcda" -o -name "*.gcov" -delete -endif +'"$CODE_COVERAGE_RULES_CLEAN"' GITIGNOREFILES ?= GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) @@ -733,282 +1000,6 @@ AU_DEFUN([GNOME_CXX_WARNINGS],[ eliminate use of --enable-iso-cxx. See: http://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html#ax_compiler_flags]]) -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29) -dnl -dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. -dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but -dnl WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -dnl 02111-1307, USA. -dnl -dnl As a special exception to the GNU General Public License, if you -dnl distribute this file as part of a program that contains a -dnl configuration script generated by Autoconf, you may include it under -dnl the same distribution terms that you use for the rest of that -dnl program. - -dnl PKG_PREREQ(MIN-VERSION) -dnl ----------------------- -dnl Since: 0.29 -dnl -dnl Verify that the version of the pkg-config macros are at least -dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's -dnl installed version of pkg-config, this checks the developer's version -dnl of pkg.m4 when generating configure. -dnl -dnl To ensure that this macro is defined, also add: -dnl m4_ifndef([PKG_PREREQ], -dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) -dnl -dnl See the "Since" comment for each macro you use to see what version -dnl of the macros you require. -m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29]) -m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, - [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) -])dnl PKG_PREREQ - -dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) -dnl ---------------------------------- -dnl Since: 0.16 -dnl -dnl Search for the pkg-config tool and set the PKG_CONFIG variable to -dnl first found in the path. Checks that the version of pkg-config found -dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is -dnl used since that's the first version where most current features of -dnl pkg-config existed. -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) -m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi -fi[]dnl -])dnl PKG_PROG_PKG_CONFIG - -dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------------------------------- -dnl Since: 0.18 -dnl -dnl Check to see whether a particular set of modules exists. Similar to -dnl PKG_CHECK_MODULES(), but does not set variables or print errors. -dnl -dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -dnl only at the first occurence in configure.ac, so if the first place -dnl it's called might be skipped (such as if it is within an "if", you -dnl have to call PKG_CHECK_EXISTS manually -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_default([$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - -dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -dnl --------------------------------------------- -dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting -dnl pkg_failed based on the result. -m4_define([_PKG_CONFIG], -[if test -n "$$1"; then - pkg_cv_[]$1="$$1" - elif test -n "$PKG_CONFIG"; then - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes ], - [pkg_failed=yes]) - else - pkg_failed=untried -fi[]dnl -])dnl _PKG_CONFIG - -dnl _PKG_SHORT_ERRORS_SUPPORTED -dnl --------------------------- -dnl Internal check to see if pkg-config supports short errors. -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])dnl _PKG_SHORT_ERRORS_SUPPORTED - - -dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl -------------------------------------------------------------- -dnl Since: 0.4.0 -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES might not happen, you should be sure to include an -dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - m4_default([$4], [AC_MSG_ERROR( -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT])[]dnl - ]) -elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl - ]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - $3 -fi[]dnl -])dnl PKG_CHECK_MODULES - - -dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl --------------------------------------------------------------------- -dnl Since: 0.29 -dnl -dnl Checks for existence of MODULES and gathers its build flags with -dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags -dnl and VARIABLE-PREFIX_LIBS from --libs. -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to -dnl include an explicit call to PKG_PROG_PKG_CONFIG in your -dnl configure.ac. -AC_DEFUN([PKG_CHECK_MODULES_STATIC], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -_save_PKG_CONFIG=$PKG_CONFIG -PKG_CONFIG="$PKG_CONFIG --static" -PKG_CHECK_MODULES($@) -PKG_CONFIG=$_save_PKG_CONFIG[]dnl -])dnl PKG_CHECK_MODULES_STATIC - - -dnl PKG_INSTALLDIR([DIRECTORY]) -dnl ------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable pkgconfigdir as the location where a module -dnl should install pkg-config .pc files. By default the directory is -dnl $libdir/pkgconfig, but the default can be changed by passing -dnl DIRECTORY. The user can override through the --with-pkgconfigdir -dnl parameter. -AC_DEFUN([PKG_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([pkgconfigdir], - [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, - [with_pkgconfigdir=]pkg_default) -AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -])dnl PKG_INSTALLDIR - - -dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) -dnl -------------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable noarch_pkgconfigdir as the location where a -dnl module should install arch-independent pkg-config .pc files. By -dnl default the directory is $datadir/pkgconfig, but the default can be -dnl changed by passing DIRECTORY. The user can override through the -dnl --with-noarch-pkgconfigdir parameter. -AC_DEFUN([PKG_NOARCH_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([noarch-pkgconfigdir], - [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, - [with_noarch_pkgconfigdir=]pkg_default) -AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -])dnl PKG_NOARCH_INSTALLDIR - - -dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------- -dnl Since: 0.28 -dnl -dnl Retrieves the value of the pkg-config variable for the given module. -AC_DEFUN([PKG_CHECK_VAR], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl - -_PKG_CONFIG([$1], [variable="][$3]["], [$2]) -AS_VAR_COPY([$1], [pkg_cv_][$1]) - -AS_VAR_IF([$1], [""], [$5], [$4])dnl -])dnl PKG_CHECK_VAR - # Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation diff --git a/config.guess b/config.guess index 0967f2a..2e9ad7f 100755 --- a/config.guess +++ b/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2016-04-02' +timestamp='2016-10-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -186,9 +186,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. + # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in - arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -997,6 +1000,9 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; @@ -1029,6 +1035,9 @@ EOF ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; @@ -1408,18 +1417,17 @@ esac cat >&2 <<EOF $0: unable to guess system type -This script, last modified $timestamp, has failed to recognize -the operating system you are using. It is advised that you -download the most up to date version of the config scripts from +This script (version $timestamp), has failed to recognize the +operating system you are using. If your script is old, overwrite +config.guess and config.sub with the latest versions from: http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess and http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub -If the version you run ($0) is already up to date, please -send the following data and any information you think might be -pertinent to <config-patches@gnu.org> in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2016-03-30' +timestamp='2016-11-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -117,7 +117,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -301,6 +301,7 @@ case $basic_machine in | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ @@ -428,6 +429,7 @@ case $basic_machine in | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ @@ -643,6 +645,14 @@ case $basic_machine in basic_machine=m68k-bull os=-sysv3 ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; ebmon29k) basic_machine=a29k-amd os=-ebmon @@ -1022,7 +1032,7 @@ case $basic_machine in ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) @@ -1032,7 +1042,7 @@ case $basic_machine in ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) @@ -1389,7 +1399,7 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ @@ -1399,7 +1409,7 @@ case $os in | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos*) + | -onefs* | -tirtos* | -phoenix* | -fuchsia*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for pygobject 3.22.0. +# Generated by GNU Autoconf 2.69 for pygobject 3.24.0. # # Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject>. # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='pygobject' PACKAGE_TARNAME='pygobject' -PACKAGE_VERSION='3.22.0' -PACKAGE_STRING='pygobject 3.22.0' +PACKAGE_VERSION='3.24.0' +PACKAGE_STRING='pygobject 3.24.0' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject' PACKAGE_URL='https://wiki.gnome.org/Projects/PyGObject/' @@ -640,6 +640,7 @@ LIBOBJS GNOME_CODE_COVERAGE_RULES CODE_COVERAGE_RULES CODE_COVERAGE_LDFLAGS +CODE_COVERAGE_LIBS CODE_COVERAGE_CXXFLAGS CODE_COVERAGE_CFLAGS CODE_COVERAGE_CPPFLAGS @@ -1413,7 +1414,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures pygobject 3.22.0 to adapt to many kinds of systems. +\`configure' configures pygobject 3.24.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1484,7 +1485,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pygobject 3.22.0:";; + short | recursive ) echo "Configuration of pygobject 3.24.0:";; esac cat <<\_ACEOF @@ -1628,7 +1629,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pygobject configure 3.22.0 +pygobject configure 3.24.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1906,7 +1907,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pygobject $as_me 3.22.0, which was +It was created by pygobject $as_me 3.24.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2265,9 +2266,9 @@ $as_echo "#define PYGOBJECT_MAJOR_VERSION 3" >>confdefs.h PYGOBJECT_MAJOR_VERSION=3 -$as_echo "#define PYGOBJECT_MINOR_VERSION 22" >>confdefs.h +$as_echo "#define PYGOBJECT_MINOR_VERSION 24" >>confdefs.h -PYGOBJECT_MINOR_VERSION=22 +PYGOBJECT_MINOR_VERSION=24 $as_echo "#define PYGOBJECT_MICRO_VERSION 0" >>confdefs.h @@ -2794,7 +2795,7 @@ fi # Define the identity of the package. PACKAGE='pygobject' - VERSION='3.22.0' + VERSION='3.24.0' cat >>confdefs.h <<_ACEOF @@ -14866,7 +14867,7 @@ fi -Werror=return-type \ " - additional_flags="" + additional_flags="-Wno-error=missing-prototypes" case "$enable_compile_warnings" in no) @@ -15101,9 +15102,6 @@ fi fi - # List of supported lcov versions. - lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12" - # Extract the first word of "lcov", so it can be a program name with args. set dummy lcov; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -15179,56 +15177,57 @@ fi - if test "$LCOV" ; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lcov version" >&5 -$as_echo_n "checking for lcov version... " >&6; } -if ${ax_cv_lcov_version+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_cv_lcov_version=invalid - lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'` - for lcov_check_version in $lcov_version_list; do - if test "$lcov_version" = "$lcov_check_version"; then - ax_cv_lcov_version="$lcov_check_version (ok)" - fi - done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lcov_version" >&5 -$as_echo "$ax_cv_lcov_version" >&6; } - -else + if test -z "$LCOV" ; then : - lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list" - as_fn_error $? "$lcov_msg" "$LINENO" 5 + as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5 fi - case $ax_cv_lcov_version in - ""|invalid) - lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)." - as_fn_error $? "$lcov_msg" "$LINENO" 5 - LCOV="exit 0;" - ;; - esac - if test -z "$GENHTML" ; then : as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5 fi - CODE_COVERAGE_CPPFLAGS="-DNDEBUG" + CODE_COVERAGE_CPPFLAGS="-DNDEBUG" CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_LDFLAGS="-lgcov" + CODE_COVERAGE_LIBS="-lgcov" + CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" + + + CODE_COVERAGE_RULES_CHECK=' + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture +' + CODE_COVERAGE_RULES_CAPTURE=' + $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) + $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp + $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) + @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" +' + CODE_COVERAGE_RULES_CLEAN=' +clean: code-coverage-clean +distclean: code-coverage-clean +code-coverage-clean: + -$(LCOV) --directory $(top_builddir) -z + -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete +' + +else + + CODE_COVERAGE_RULES_CHECK=' + @echo "Need to reconfigure with --enable-code-coverage" +' + CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" + CODE_COVERAGE_RULES_CLEAN='' fi @@ -15309,36 +15308,15 @@ code_coverage_quiet_0 = --quiet code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) # Use recursive makes in order to ignore errors during check -check-code-coverage: -ifeq ($(CODE_COVERAGE_ENABLED),yes) - -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check - $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture -else - @echo "Need to reconfigure with --enable-code-coverage" -endif +check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' # Capture code coverage data -code-coverage-capture: code-coverage-capture-hook -ifeq ($(CODE_COVERAGE_ENABLED),yes) - $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) - $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) - -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp - $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) - @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" -else - @echo "Need to reconfigure with --enable-code-coverage" -endif +code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' # Hook rule executed before code-coverage-capture, overridable by the user code-coverage-capture-hook: -ifeq ($(CODE_COVERAGE_ENABLED),yes) -clean: code-coverage-clean -code-coverage-clean: - -$(LCOV) --directory $(top_builddir) -z - -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -find . -name "*.gcda" -o -name "*.gcov" -delete -endif +'"$CODE_COVERAGE_RULES_CLEAN"' GITIGNOREFILES ?= GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) @@ -16048,7 +16026,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by pygobject $as_me 3.22.0, which was +This file was extended by pygobject $as_me 3.24.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16115,7 +16093,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -pygobject config.status 3.22.0 +pygobject config.status 3.24.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 7ab11e3..44c3709 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ m4_define(python3_min_ver, 3.1) dnl the pygobject version number m4_define(pygobject_major_version, 3) -m4_define(pygobject_minor_version, 22) +m4_define(pygobject_minor_version, 24) m4_define(pygobject_micro_version, 0) m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version) @@ -228,7 +228,7 @@ AC_SUBST(INTROSPECTION_SCANNER) AC_SUBST(INTROSPECTION_COMPILER) # compiler warnings, errors, required cflags, and code coverage support -GNOME_COMPILE_WARNINGS([maximum]) +GNOME_COMPILE_WARNINGS([maximum], [-Wno-error=missing-prototypes]) AC_MSG_CHECKING(for Gnome code coverage support) m4_ifdef([GNOME_CODE_COVERAGE], [AC_MSG_RESULT(yes) diff --git a/examples/Makefile.in b/examples/Makefile.in index 1cec31f..3a897b1 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -143,6 +143,7 @@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/examples/cairo-demo.py b/examples/cairo-demo.py index 7b90ec3..ee33cdd 100755 --- a/examples/cairo-demo.py +++ b/examples/cairo-demo.py @@ -126,5 +126,6 @@ def main(): win.show_all() Gtk.main() + if __name__ == '__main__': main() diff --git a/examples/properties.py b/examples/properties.py index 4c8a20c..257e80a 100644 --- a/examples/properties.py +++ b/examples/properties.py @@ -13,6 +13,7 @@ class MyObject(GObject.GObject): def readonly(self): return 'readonly' + GObject.type_register(MyObject) print("MyObject properties: ", list(MyObject.props)) diff --git a/gi/Makefile.in b/gi/Makefile.in index 934b1c9..328eaaa 100644 --- a/gi/Makefile.in +++ b/gi/Makefile.in @@ -303,6 +303,7 @@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/gi/_gobject/Makefile.in b/gi/_gobject/Makefile.in index e7e9e78..3c41e5c 100644 --- a/gi/_gobject/Makefile.in +++ b/gi/_gobject/Makefile.in @@ -176,6 +176,7 @@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/gi/_option.py b/gi/_option.py index 2d30abf..eb711e1 100644 --- a/gi/_option.py +++ b/gi/_option.py @@ -368,4 +368,5 @@ class OptionParser(optparse.OptionParser): args = args[2:-len(old_args)] return options, args + make_option = Option diff --git a/gi/overrides/GIMarshallingTests.py b/gi/overrides/GIMarshallingTests.py index b675adf..e9f8e33 100644 --- a/gi/overrides/GIMarshallingTests.py +++ b/gi/overrides/GIMarshallingTests.py @@ -41,6 +41,7 @@ class OverridesStruct(GIMarshallingTests.OverridesStruct): def method(self): return GIMarshallingTests.OverridesStruct.method(self) / 7 + OverridesStruct = override(OverridesStruct) __all__.append('OverridesStruct') @@ -66,5 +67,6 @@ class OverridesObject(GIMarshallingTests.OverridesObject): """Overridden doc string.""" return GIMarshallingTests.OverridesObject.method(self) / 7 + OverridesObject = override(OverridesObject) __all__.append('OverridesObject') diff --git a/gi/overrides/GLib.py b/gi/overrides/GLib.py index 5a7792d..ab0e83a 100644 --- a/gi/overrides/GLib.py +++ b/gi/overrides/GLib.py @@ -251,7 +251,16 @@ class Variant(GLib.Variant): return GLib.Variant.new_tuple(elements) def __del__(self): - self.unref() + try: + self.unref() + except ImportError: + # Calling unref will cause gi and gi.repository.GLib to be + # imported. However, if the program is exiting, then these + # modules have likely been removed from sys.modules and will + # raise an exception. Assume that's the case for ImportError + # and ignore the exception since everything will be cleaned + # up, anyways. + pass def __str__(self): return self.print_(True) @@ -468,6 +477,7 @@ def get_string(self): value, length = GLib.Variant.get_string(self) return value + setattr(Variant, 'get_string', get_string) __all__.append('Variant') @@ -478,6 +488,8 @@ def markup_escape_text(text, length=-1): return GLib.markup_escape_text(text.decode('UTF-8'), length) else: return GLib.markup_escape_text(text, length) + + __all__.append('markup_escape_text') @@ -576,6 +588,7 @@ class MainLoop(GLib.MainLoop): # caught by _main_loop_sigint_handler() raise KeyboardInterrupt + MainLoop = override(MainLoop) __all__.append('MainLoop') @@ -585,6 +598,7 @@ class MainContext(GLib.MainContext): def iteration(self, may_block=True): return super(MainContext, self).iteration(may_block) + MainContext = override(MainContext) __all__.append('MainContext') @@ -634,6 +648,7 @@ class Source(GLib.Source): can_recurse = property(__get_can_recurse, __set_can_recurse) + Source = override(Source) __all__.append('Source') @@ -649,6 +664,7 @@ class Idle(Source): if priority != GLib.PRIORITY_DEFAULT: self.set_priority(priority) + __all__.append('Idle') @@ -662,6 +678,7 @@ class Timeout(Source): if priority != GLib.PRIORITY_DEFAULT: self.set_priority(priority) + __all__.append('Timeout') @@ -670,6 +687,7 @@ def idle_add(function, *user_data, **kwargs): priority = kwargs.get('priority', GLib.PRIORITY_DEFAULT_IDLE) return GLib.idle_add(priority, function, *user_data) + __all__.append('idle_add') @@ -677,6 +695,7 @@ def timeout_add(interval, function, *user_data, **kwargs): priority = kwargs.get('priority', GLib.PRIORITY_DEFAULT) return GLib.timeout_add(priority, interval, function, *user_data) + __all__.append('timeout_add') @@ -684,6 +703,7 @@ def timeout_add_seconds(interval, function, *user_data, **kwargs): priority = kwargs.get('priority', GLib.PRIORITY_DEFAULT) return GLib.timeout_add_seconds(priority, interval, function, *user_data) + __all__.append('timeout_add_seconds') @@ -741,6 +761,7 @@ def _io_add_watch_get_args(channel, priority_, condition, *cb_and_user_data, **k return real_channel, priority_, condition, func_fdtransform, user_data + __all__.append('_io_add_watch_get_args') @@ -749,6 +770,7 @@ def io_add_watch(*args, **kwargs): channel, priority, condition, func, user_data = _io_add_watch_get_args(*args, **kwargs) return GLib.io_add_watch(channel, priority, condition, func, *user_data) + __all__.append('io_add_watch') @@ -830,6 +852,7 @@ class IOChannel(GLib.IOChannel): # Python 2.x compatibility next = __next__ + IOChannel = override(IOChannel) __all__.append('IOChannel') @@ -844,6 +867,7 @@ class PollFD(GLib.PollFD): self.fd = fd self.events = events + PollFD = override(PollFD) __all__.append('PollFD') @@ -891,6 +915,7 @@ def _child_watch_add_get_args(priority_or_pid, pid_or_callback, *args, **kwargs) return priority, pid, callback, user_data + # we need this to be accessible for unit testing __all__.append('_child_watch_add_get_args') @@ -900,12 +925,14 @@ def child_watch_add(*args, **kwargs): priority, pid, function, data = _child_watch_add_get_args(*args, **kwargs) return GLib.child_watch_add(priority, pid, function, *data) + __all__.append('child_watch_add') def get_current_time(): return GLib.get_real_time() * 0.000001 + get_current_time = deprecated(get_current_time, 'GLib.get_real_time()') __all__.append('get_current_time') @@ -916,6 +943,7 @@ __all__.append('get_current_time') def filename_from_utf8(utf8string, len=-1): return GLib.filename_from_utf8(utf8string, len)[0] + __all__.append('filename_from_utf8') diff --git a/gi/overrides/GObject.py b/gi/overrides/GObject.py index 28408b2..2e8f755 100644 --- a/gi/overrides/GObject.py +++ b/gi/overrides/GObject.py @@ -351,6 +351,7 @@ class Value(GObjectModule.Value): def __repr__(self): return '<Value (%s) %s>' % (self.g_type.name, self.get_value()) + Value = override(Value) __all__.append('Value') @@ -361,6 +362,7 @@ def type_from_name(name): raise RuntimeError('unknown type name: %s' % name) return type_ + __all__.append('type_from_name') @@ -370,6 +372,7 @@ def type_parent(type_): raise RuntimeError('no parent for type') return parent + __all__.append('type_parent') @@ -384,6 +387,7 @@ def signal_list_ids(type_): _validate_type_for_signal_method(type_) return GObjectModule.signal_list_ids(type_) + __all__.append('signal_list_ids') @@ -391,6 +395,7 @@ def signal_list_names(type_): ids = signal_list_ids(type_) return tuple(GObjectModule.signal_name(i) for i in ids) + __all__.append('signal_list_names') @@ -398,6 +403,7 @@ def signal_lookup(name, type_): _validate_type_for_signal_method(type_) return GObjectModule.signal_lookup(name, type_) + __all__.append('signal_lookup') @@ -430,6 +436,7 @@ def signal_query(id_or_name, type_=None): res.signal_flags, res.return_type, tuple(res.param_types)) + __all__.append('signal_query') @@ -465,6 +472,7 @@ def signal_handler_block(obj, handler_id): GObjectModule.signal_handler_block(obj, handler_id) return _HandlerBlockManager(obj, handler_id) + __all__.append('signal_handler_block') @@ -486,6 +494,7 @@ def signal_parse_name(detailed_signal, itype, force_detail_quark): else: raise ValueError('%s: unknown signal name: %s' % (itype, detailed_signal)) + __all__.append('signal_parse_name') @@ -493,6 +502,7 @@ def remove_emission_hook(obj, detailed_signal, hook_id): signal_id, detail = signal_parse_name(detailed_signal, obj, True) GObjectModule.signal_remove_emission_hook(signal_id, hook_id) + __all__.append('remove_emission_hook') @@ -503,6 +513,7 @@ def signal_accumulator_first_wins(ihint, return_accu, handler_return, user_data= # Stop emission but return the result of the last handler return (False, handler_return) + __all__.append('signal_accumulator_first_wins') @@ -510,6 +521,7 @@ def signal_accumulator_true_handled(ihint, return_accu, handler_return, user_dat # Stop emission if the last handler returns True return (not handler_return, handler_return) + __all__.append('signal_accumulator_true_handled') diff --git a/gi/overrides/Gdk.py b/gi/overrides/Gdk.py index baa8449..c5b9a39 100644 --- a/gi/overrides/Gdk.py +++ b/gi/overrides/Gdk.py @@ -39,48 +39,51 @@ try: except (ValueError, ImportError): pass +if hasattr(Gdk, 'Color'): + # Gdk.Color was deprecated since 3.14 and dropped in Gtk+-4.0 + class Color(Gdk.Color): + MAX_VALUE = 65535 -class Color(Gdk.Color): - MAX_VALUE = 65535 + def __init__(self, red, green, blue): + Gdk.Color.__init__(self) + self.red = red + self.green = green + self.blue = blue - def __init__(self, red, green, blue): - Gdk.Color.__init__(self) - self.red = red - self.green = green - self.blue = blue + def __eq__(self, other): + return self.equal(other) - def __eq__(self, other): - return self.equal(other) + def __repr__(self): + return 'Gdk.Color(red=%d, green=%d, blue=%d)' % (self.red, self.green, self.blue) - def __repr__(self): - return 'Gdk.Color(red=%d, green=%d, blue=%d)' % (self.red, self.green, self.blue) + red_float = property(fget=lambda self: self.red / float(self.MAX_VALUE), + fset=lambda self, v: setattr(self, 'red', int(v * self.MAX_VALUE))) - red_float = property(fget=lambda self: self.red / float(self.MAX_VALUE), - fset=lambda self, v: setattr(self, 'red', int(v * self.MAX_VALUE))) + green_float = property(fget=lambda self: self.green / float(self.MAX_VALUE), + fset=lambda self, v: setattr(self, 'green', int(v * self.MAX_VALUE))) - green_float = property(fget=lambda self: self.green / float(self.MAX_VALUE), - fset=lambda self, v: setattr(self, 'green', int(v * self.MAX_VALUE))) + blue_float = property(fget=lambda self: self.blue / float(self.MAX_VALUE), + fset=lambda self, v: setattr(self, 'blue', int(v * self.MAX_VALUE))) - blue_float = property(fget=lambda self: self.blue / float(self.MAX_VALUE), - fset=lambda self, v: setattr(self, 'blue', int(v * self.MAX_VALUE))) + def to_floats(self): + """Return (red_float, green_float, blue_float) triple.""" - def to_floats(self): - """Return (red_float, green_float, blue_float) triple.""" + return (self.red_float, self.green_float, self.blue_float) - return (self.red_float, self.green_float, self.blue_float) + @staticmethod + def from_floats(red, green, blue): + """Return a new Color object from red/green/blue values from 0.0 to 1.0.""" - @staticmethod - def from_floats(red, green, blue): - """Return a new Color object from red/green/blue values from 0.0 to 1.0.""" + return Color(int(red * Color.MAX_VALUE), + int(green * Color.MAX_VALUE), + int(blue * Color.MAX_VALUE)) - return Color(int(red * Color.MAX_VALUE), - int(green * Color.MAX_VALUE), - int(blue * Color.MAX_VALUE)) -Color = override(Color) -__all__.append('Color') + Color = override(Color) + __all__.append('Color') -if Gdk._version == '3.0': +if hasattr(Gdk, 'RGBA'): + # Introduced since Gtk+-3.0 class RGBA(Gdk.RGBA): def __init__(self, red=1.0, green=1.0, blue=1.0, alpha=1.0): Gdk.RGBA.__init__(self) @@ -243,6 +246,7 @@ class Event(Gdk.Event): base_repr = Gdk.Event.__repr__(self).strip("><") return "<%s type=%r>" % (base_repr, self.type) + Event = override(Event) __all__.append('Event') @@ -312,6 +316,7 @@ class DragContext(Gdk.DragContext): Gtk = get_introspection_module('Gtk') Gtk.drag_finish(self, success, del_, time) + DragContext = override(DragContext) __all__.append('DragContext') @@ -360,8 +365,10 @@ class Cursor(Gdk.Cursor): Cursor = override(Cursor) __all__.append('Cursor') -color_parse = strip_boolean_result(Gdk.color_parse) -__all__.append('color_parse') +if hasattr(Gdk, 'color_parse'): + # Gdk.Color was deprecated since 3.14 and dropped in Gtk+-4.0 + color_parse = strip_boolean_result(Gdk.color_parse) + __all__.append('color_parse') # Note, we cannot override the entire class as Gdk.Atom has no gtype, so just @@ -436,6 +443,6 @@ if Gdk._version >= '3.0': SELECTION_TYPE_STRING = Gdk.atom_intern('STRING', True) __all__.append('SELECTION_TYPE_STRING') -import sys - -initialized, argv = Gdk.init_check(sys.argv) +if Gdk._version in ('2.0', '3.0'): + import sys + initialized, argv = Gdk.init_check(sys.argv) diff --git a/gi/overrides/Gio.py b/gi/overrides/Gio.py index e646821..bb320a5 100644 --- a/gi/overrides/Gio.py +++ b/gi/overrides/Gio.py @@ -116,6 +116,7 @@ class Settings(Gio.Settings): def keys(self): return self.list_keys() + Settings = override(Settings) __all__.append('Settings') @@ -235,5 +236,6 @@ class DBusProxy(Gio.DBusProxy): def __getattr__(self, name): return _DBusProxyMethodCall(self, name) + DBusProxy = override(DBusProxy) __all__.append('DBusProxy') diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py index 831401c..2c0e870 100644 --- a/gi/overrides/Gtk.py +++ b/gi/overrides/Gtk.py @@ -53,6 +53,7 @@ python module to use with Gtk 2.0" class PyGTKDeprecationWarning(PyGIDeprecationWarning): pass + __all__.append('PyGTKDeprecationWarning') @@ -69,6 +70,7 @@ def _construct_target_list(targets): target_entries.append(entry) return target_entries + __all__.append('_construct_target_list') @@ -202,210 +204,209 @@ Editable = override(Editable) __all__.append("Editable") -class Action(Gtk.Action): - __init__ = deprecated_init(Gtk.Action.__init__, - arg_names=('name', 'label', 'tooltip', 'stock_id'), - category=PyGTKDeprecationWarning) - -Action = override(Action) -__all__.append("Action") - - -class RadioAction(Gtk.RadioAction): - __init__ = deprecated_init(Gtk.RadioAction.__init__, - arg_names=('name', 'label', 'tooltip', 'stock_id', 'value'), - category=PyGTKDeprecationWarning) - -RadioAction = override(RadioAction) -__all__.append("RadioAction") +if Gtk._version in ("2.0", "3.0"): + class Action(Gtk.Action): + __init__ = deprecated_init(Gtk.Action.__init__, + arg_names=('name', 'label', 'tooltip', 'stock_id'), + category=PyGTKDeprecationWarning) + + Action = override(Action) + __all__.append("Action") + + class RadioAction(Gtk.RadioAction): + __init__ = deprecated_init(Gtk.RadioAction.__init__, + arg_names=('name', 'label', 'tooltip', 'stock_id', 'value'), + category=PyGTKDeprecationWarning) + + RadioAction = override(RadioAction) + __all__.append("RadioAction") + + class ActionGroup(Gtk.ActionGroup): + __init__ = deprecated_init(Gtk.ActionGroup.__init__, + arg_names=('name',), + category=PyGTKDeprecationWarning) + + def add_actions(self, entries, user_data=None): + """ + The add_actions() method is a convenience method that creates a number + of gtk.Action objects based on the information in the list of action + entry tuples contained in entries and adds them to the action group. + The entry tuples can vary in size from one to six items with the + following information: + + * The name of the action. Must be specified. + * The stock id for the action. Optional with a default value of None + if a label is specified. + * The label for the action. This field should typically be marked + for translation, see the set_translation_domain() method. Optional + with a default value of None if a stock id is specified. + * The accelerator for the action, in the format understood by the + gtk.accelerator_parse() function. Optional with a default value of + None. + * The tooltip for the action. This field should typically be marked + for translation, see the set_translation_domain() method. Optional + with a default value of None. + * The callback function invoked when the action is activated. + Optional with a default value of None. + + The "activate" signals of the actions are connected to the callbacks and + their accel paths are set to <Actions>/group-name/action-name. + """ + try: + iter(entries) + except (TypeError): + raise TypeError('entries must be iterable') + + def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None): + action = Action(name=name, label=label, tooltip=tooltip, stock_id=stock_id) + if callback is not None: + if user_data is None: + action.connect('activate', callback) + else: + action.connect('activate', callback, user_data) + + self.add_action_with_accel(action, accelerator) + + for e in entries: + # using inner function above since entries can leave out optional arguments + _process_action(*e) + + def add_toggle_actions(self, entries, user_data=None): + """ + The add_toggle_actions() method is a convenience method that creates a + number of gtk.ToggleAction objects based on the information in the list + of action entry tuples contained in entries and adds them to the action + group. The toggle action entry tuples can vary in size from one to seven + items with the following information: + + * The name of the action. Must be specified. + * The stock id for the action. Optional with a default value of None + if a label is specified. + * The label for the action. This field should typically be marked + for translation, see the set_translation_domain() method. Optional + with a default value of None if a stock id is specified. + * The accelerator for the action, in the format understood by the + gtk.accelerator_parse() function. Optional with a default value of + None. + * The tooltip for the action. This field should typically be marked + for translation, see the set_translation_domain() method. Optional + with a default value of None. + * The callback function invoked when the action is activated. + Optional with a default value of None. + * A flag indicating whether the toggle action is active. Optional + with a default value of False. + + The "activate" signals of the actions are connected to the callbacks and + their accel paths are set to <Actions>/group-name/action-name. + """ + try: + iter(entries) + except (TypeError): + raise TypeError('entries must be iterable') + + def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None, is_active=False): + action = Gtk.ToggleAction(name=name, label=label, tooltip=tooltip, stock_id=stock_id) + action.set_active(is_active) + if callback is not None: + if user_data is None: + action.connect('activate', callback) + else: + action.connect('activate', callback, user_data) + + self.add_action_with_accel(action, accelerator) + + for e in entries: + # using inner function above since entries can leave out optional arguments + _process_action(*e) + + def add_radio_actions(self, entries, value=None, on_change=None, user_data=None): + """ + The add_radio_actions() method is a convenience method that creates a + number of gtk.RadioAction objects based on the information in the list + of action entry tuples contained in entries and adds them to the action + group. The entry tuples can vary in size from one to six items with the + following information: + + * The name of the action. Must be specified. + * The stock id for the action. Optional with a default value of None + if a label is specified. + * The label for the action. This field should typically be marked + for translation, see the set_translation_domain() method. Optional + with a default value of None if a stock id is specified. + * The accelerator for the action, in the format understood by the + gtk.accelerator_parse() function. Optional with a default value of + None. + * The tooltip for the action. This field should typically be marked + for translation, see the set_translation_domain() method. Optional + with a default value of None. + * The value to set on the radio action. Optional with a default + value of 0. Should be specified in applications. + + The value parameter specifies the radio action that should be set + active. The "changed" signal of the first radio action is connected to + the on_change callback (if specified and not None) and the accel paths + of the actions are set to <Actions>/group-name/action-name. + """ + try: + iter(entries) + except (TypeError): + raise TypeError('entries must be iterable') -class ActionGroup(Gtk.ActionGroup): - __init__ = deprecated_init(Gtk.ActionGroup.__init__, - arg_names=('name',), - category=PyGTKDeprecationWarning) + first_action = None - def add_actions(self, entries, user_data=None): - """ - The add_actions() method is a convenience method that creates a number - of gtk.Action objects based on the information in the list of action - entry tuples contained in entries and adds them to the action group. - The entry tuples can vary in size from one to six items with the - following information: - - * The name of the action. Must be specified. - * The stock id for the action. Optional with a default value of None - if a label is specified. - * The label for the action. This field should typically be marked - for translation, see the set_translation_domain() method. Optional - with a default value of None if a stock id is specified. - * The accelerator for the action, in the format understood by the - gtk.accelerator_parse() function. Optional with a default value of - None. - * The tooltip for the action. This field should typically be marked - for translation, see the set_translation_domain() method. Optional - with a default value of None. - * The callback function invoked when the action is activated. - Optional with a default value of None. - - The "activate" signals of the actions are connected to the callbacks and - their accel paths are set to <Actions>/group-name/action-name. - """ - try: - iter(entries) - except (TypeError): - raise TypeError('entries must be iterable') + def _process_action(group_source, name, stock_id=None, label=None, accelerator=None, tooltip=None, entry_value=0): + action = RadioAction(name=name, label=label, tooltip=tooltip, stock_id=stock_id, value=entry_value) - def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None): - action = Action(name=name, label=label, tooltip=tooltip, stock_id=stock_id) - if callback is not None: - if user_data is None: - action.connect('activate', callback) - else: - action.connect('activate', callback, user_data) + # FIXME: join_group is a patch to Gtk+ 3.0 + # otherwise we can't effectively add radio actions to a + # group. Should we depend on 3.0 and error out here + # or should we offer the functionality via a compat + # C module? + if hasattr(action, 'join_group'): + action.join_group(group_source) - self.add_action_with_accel(action, accelerator) + if value == entry_value: + action.set_active(True) - for e in entries: - # using inner function above since entries can leave out optional arguments - _process_action(*e) + self.add_action_with_accel(action, accelerator) + return action - def add_toggle_actions(self, entries, user_data=None): - """ - The add_toggle_actions() method is a convenience method that creates a - number of gtk.ToggleAction objects based on the information in the list - of action entry tuples contained in entries and adds them to the action - group. The toggle action entry tuples can vary in size from one to seven - items with the following information: - - * The name of the action. Must be specified. - * The stock id for the action. Optional with a default value of None - if a label is specified. - * The label for the action. This field should typically be marked - for translation, see the set_translation_domain() method. Optional - with a default value of None if a stock id is specified. - * The accelerator for the action, in the format understood by the - gtk.accelerator_parse() function. Optional with a default value of - None. - * The tooltip for the action. This field should typically be marked - for translation, see the set_translation_domain() method. Optional - with a default value of None. - * The callback function invoked when the action is activated. - Optional with a default value of None. - * A flag indicating whether the toggle action is active. Optional - with a default value of False. - - The "activate" signals of the actions are connected to the callbacks and - their accel paths are set to <Actions>/group-name/action-name. - """ + for e in entries: + # using inner function above since entries can leave out optional arguments + action = _process_action(first_action, *e) + if first_action is None: + first_action = action - try: - iter(entries) - except (TypeError): - raise TypeError('entries must be iterable') - - def _process_action(name, stock_id=None, label=None, accelerator=None, tooltip=None, callback=None, is_active=False): - action = Gtk.ToggleAction(name=name, label=label, tooltip=tooltip, stock_id=stock_id) - action.set_active(is_active) - if callback is not None: + if first_action is not None and on_change is not None: if user_data is None: - action.connect('activate', callback) + first_action.connect('changed', on_change) else: - action.connect('activate', callback, user_data) - - self.add_action_with_accel(action, accelerator) - - for e in entries: - # using inner function above since entries can leave out optional arguments - _process_action(*e) - - def add_radio_actions(self, entries, value=None, on_change=None, user_data=None): - """ - The add_radio_actions() method is a convenience method that creates a - number of gtk.RadioAction objects based on the information in the list - of action entry tuples contained in entries and adds them to the action - group. The entry tuples can vary in size from one to six items with the - following information: - - * The name of the action. Must be specified. - * The stock id for the action. Optional with a default value of None - if a label is specified. - * The label for the action. This field should typically be marked - for translation, see the set_translation_domain() method. Optional - with a default value of None if a stock id is specified. - * The accelerator for the action, in the format understood by the - gtk.accelerator_parse() function. Optional with a default value of - None. - * The tooltip for the action. This field should typically be marked - for translation, see the set_translation_domain() method. Optional - with a default value of None. - * The value to set on the radio action. Optional with a default - value of 0. Should be specified in applications. - - The value parameter specifies the radio action that should be set - active. The "changed" signal of the first radio action is connected to - the on_change callback (if specified and not None) and the accel paths - of the actions are set to <Actions>/group-name/action-name. - """ - try: - iter(entries) - except (TypeError): - raise TypeError('entries must be iterable') - - first_action = None - - def _process_action(group_source, name, stock_id=None, label=None, accelerator=None, tooltip=None, entry_value=0): - action = RadioAction(name=name, label=label, tooltip=tooltip, stock_id=stock_id, value=entry_value) - - # FIXME: join_group is a patch to Gtk+ 3.0 - # otherwise we can't effectively add radio actions to a - # group. Should we depend on 3.0 and error out here - # or should we offer the functionality via a compat - # C module? - if hasattr(action, 'join_group'): - action.join_group(group_source) - - if value == entry_value: - action.set_active(True) - - self.add_action_with_accel(action, accelerator) - return action - - for e in entries: - # using inner function above since entries can leave out optional arguments - action = _process_action(first_action, *e) - if first_action is None: - first_action = action - - if first_action is not None and on_change is not None: - if user_data is None: - first_action.connect('changed', on_change) - else: - first_action.connect('changed', on_change, user_data) + first_action.connect('changed', on_change, user_data) -ActionGroup = override(ActionGroup) -__all__.append('ActionGroup') + ActionGroup = override(ActionGroup) + __all__.append('ActionGroup') + class UIManager(Gtk.UIManager): + def add_ui_from_string(self, buffer): + if not isinstance(buffer, _basestring): + raise TypeError('buffer must be a string') -class UIManager(Gtk.UIManager): - def add_ui_from_string(self, buffer): - if not isinstance(buffer, _basestring): - raise TypeError('buffer must be a string') + length = len(buffer.encode('UTF-8')) - length = len(buffer.encode('UTF-8')) + return Gtk.UIManager.add_ui_from_string(self, buffer, length) - return Gtk.UIManager.add_ui_from_string(self, buffer, length) + def insert_action_group(self, buffer, length=-1): + return Gtk.UIManager.insert_action_group(self, buffer, length) - def insert_action_group(self, buffer, length=-1): - return Gtk.UIManager.insert_action_group(self, buffer, length) - -UIManager = override(UIManager) -__all__.append('UIManager') + UIManager = override(UIManager) + __all__.append('UIManager') class ComboBox(Gtk.ComboBox, Container): get_active_iter = strip_boolean_result(Gtk.ComboBox.get_active_iter) + ComboBox = override(ComboBox) __all__.append('ComboBox') @@ -415,6 +416,7 @@ class Box(Gtk.Box): arg_names=('homogeneous', 'spacing'), category=PyGTKDeprecationWarning) + Box = override(Box) __all__.append('Box') @@ -425,6 +427,7 @@ class SizeGroup(Gtk.SizeGroup): deprecated_defaults={'mode': Gtk.SizeGroupMode.VERTICAL}, category=PyGTKDeprecationWarning) + SizeGroup = override(SizeGroup) __all__.append('SizeGroup') @@ -434,6 +437,7 @@ class MenuItem(Gtk.MenuItem): arg_names=('label',), category=PyGTKDeprecationWarning) + MenuItem = override(MenuItem) __all__.append('MenuItem') @@ -469,6 +473,7 @@ class Builder(Gtk.Builder): return Gtk.Builder.add_objects_from_string(self, buffer, length, object_ids) + Builder = override(Builder) __all__.append('Builder') @@ -482,6 +487,7 @@ class Window(Gtk.Window): arg_names=('type',), category=PyGTKDeprecationWarning) + Window = override(Window) __all__.append('Window') @@ -568,6 +574,7 @@ class Dialog(Gtk.Dialog, Container): except (IndexError): raise TypeError('Must pass an even number of arguments') + Dialog = override(Dialog) __all__.append('Dialog') @@ -588,17 +595,19 @@ class MessageDialog(Gtk.MessageDialog, Dialog): self.set_property('secondary-use-markup', True) self.set_property('secondary-text', message_format) + MessageDialog = override(MessageDialog) __all__.append('MessageDialog') -class ColorSelectionDialog(Gtk.ColorSelectionDialog): - __init__ = deprecated_init(Gtk.ColorSelectionDialog.__init__, - arg_names=('title',), - category=PyGTKDeprecationWarning) +if Gtk._version in ("2.0", "3.0"): + class ColorSelectionDialog(Gtk.ColorSelectionDialog): + __init__ = deprecated_init(Gtk.ColorSelectionDialog.__init__, + arg_names=('title',), + category=PyGTKDeprecationWarning) -ColorSelectionDialog = override(ColorSelectionDialog) -__all__.append('ColorSelectionDialog') + ColorSelectionDialog = override(ColorSelectionDialog) + __all__.append('ColorSelectionDialog') class FileChooserDialog(Gtk.FileChooserDialog): @@ -606,17 +615,19 @@ class FileChooserDialog(Gtk.FileChooserDialog): arg_names=('title', 'parent', 'action', 'buttons'), category=PyGTKDeprecationWarning) + FileChooserDialog = override(FileChooserDialog) __all__.append('FileChooserDialog') -class FontSelectionDialog(Gtk.FontSelectionDialog): - __init__ = deprecated_init(Gtk.FontSelectionDialog.__init__, - arg_names=('title',), - category=PyGTKDeprecationWarning) +if Gtk._version in ("2.0", "3.0"): + class FontSelectionDialog(Gtk.FontSelectionDialog): + __init__ = deprecated_init(Gtk.FontSelectionDialog.__init__, + arg_names=('title',), + category=PyGTKDeprecationWarning) -FontSelectionDialog = override(FontSelectionDialog) -__all__.append('FontSelectionDialog') + FontSelectionDialog = override(FontSelectionDialog) + __all__.append('FontSelectionDialog') class RecentChooserDialog(Gtk.RecentChooserDialog): @@ -627,6 +638,7 @@ class RecentChooserDialog(Gtk.RecentChooserDialog): deprecated_aliases={'recent_manager': 'manager'}, category=PyGTKDeprecationWarning) + RecentChooserDialog = override(RecentChooserDialog) __all__.append('RecentChooserDialog') @@ -640,6 +652,7 @@ class IconView(Gtk.IconView): get_visible_range = strip_boolean_result(Gtk.IconView.get_visible_range) get_dest_item_at_pos = strip_boolean_result(Gtk.IconView.get_dest_item_at_pos) + IconView = override(IconView) __all__.append('IconView') @@ -649,6 +662,7 @@ class ToolButton(Gtk.ToolButton): arg_names=('stock_id',), category=PyGTKDeprecationWarning) + ToolButton = override(ToolButton) __all__.append('ToolButton') @@ -656,6 +670,7 @@ __all__.append('ToolButton') class IMContext(Gtk.IMContext): get_surrounding = strip_boolean_result(Gtk.IMContext.get_surrounding) + IMContext = override(IMContext) __all__.append('IMContext') @@ -663,6 +678,7 @@ __all__.append('IMContext') class RecentInfo(Gtk.RecentInfo): get_application_info = strip_boolean_result(Gtk.RecentInfo.get_application_info) + RecentInfo = override(RecentInfo) __all__.append('RecentInfo') @@ -750,6 +766,7 @@ class TextBuffer(Gtk.TextBuffer): get_selection_bounds = strip_boolean_result(Gtk.TextBuffer.get_selection_bounds, fail_ret=()) + TextBuffer = override(TextBuffer) __all__.append('TextBuffer') @@ -758,6 +775,7 @@ class TextIter(Gtk.TextIter): forward_search = strip_boolean_result(Gtk.TextIter.forward_search) backward_search = strip_boolean_result(Gtk.TextIter.backward_search) + TextIter = override(TextIter) __all__.append('TextIter') @@ -924,6 +942,7 @@ class TreeSortable(Gtk.TreeSortable, ): def set_default_sort_func(self, sort_func, user_data=None): super(TreeSortable, self).set_default_sort_func(sort_func, user_data) + TreeSortable = override(TreeSortable) __all__.append('TreeSortable') @@ -933,6 +952,7 @@ class TreeModelSort(Gtk.TreeModelSort): arg_names=('model',), category=PyGTKDeprecationWarning) + TreeModelSort = override(TreeModelSort) __all__.append('TreeModelSort') @@ -1017,6 +1037,7 @@ class ListStore(Gtk.ListStore, TreeModel, TreeSortable): else: raise TypeError('Argument list must be in the form of (column, value, ...), ((columns,...), (values, ...)) or {column: value}. No -1 termination is needed.') + ListStore = override(ListStore) __all__.append('ListStore') @@ -1123,6 +1144,7 @@ class TreeModelRow(object): child_iter = self.model.iter_children(self.iter) return TreeModelRowIter(self.model, child_iter) + __all__.append('TreeModelRow') @@ -1145,6 +1167,7 @@ class TreeModelRowIter(object): def __iter__(self): return self + __all__.append('TreeModelRowIter') @@ -1196,6 +1219,7 @@ class TreePath(Gtk.TreePath): def __getitem__(self, index): return self.get_indices()[index] + TreePath = override(TreePath) __all__.append('TreePath') @@ -1275,6 +1299,7 @@ class TreeStore(Gtk.TreeStore, TreeModel, TreeSortable): else: raise TypeError('Argument list must be in the form of (column, value, ...), ((columns,...), (values, ...)) or {column: value}. No -1 termination is needed.') + TreeStore = override(TreeStore) __all__.append('TreeStore') @@ -1321,6 +1346,7 @@ class TreeView(Gtk.TreeView, Container): self.insert_column(column, position) column.set_attributes(cell, **kwargs) + TreeView = override(TreeView) __all__.append('TreeView') @@ -1402,6 +1428,7 @@ class Button(Gtk.Button, Container): else: self._init(*args, **kwargs) + Button = override(Button) __all__.append('Button') @@ -1411,6 +1438,7 @@ class LinkButton(Gtk.LinkButton): arg_names=('uri', 'label'), category=PyGTKDeprecationWarning) + LinkButton = override(LinkButton) __all__.append('LinkButton') @@ -1420,6 +1448,7 @@ class Label(Gtk.Label): arg_names=('label',), category=PyGTKDeprecationWarning) + Label = override(Label) __all__.append('Label') @@ -1442,21 +1471,23 @@ class Adjustment(Gtk.Adjustment): if 'value' in kwargs: self.set_value(kwargs['value']) + Adjustment = override(Adjustment) __all__.append('Adjustment') -class Table(Gtk.Table, Container): - __init__ = deprecated_init(Gtk.Table.__init__, - arg_names=('n_rows', 'n_columns', 'homogeneous'), - deprecated_aliases={'n_rows': 'rows', 'n_columns': 'columns'}, - category=PyGTKDeprecationWarning) +if Gtk._version in ("2.0", "3.0"): + class Table(Gtk.Table, Container): + __init__ = deprecated_init(Gtk.Table.__init__, + arg_names=('n_rows', 'n_columns', 'homogeneous'), + deprecated_aliases={'n_rows': 'rows', 'n_columns': 'columns'}, + category=PyGTKDeprecationWarning) - def attach(self, child, left_attach, right_attach, top_attach, bottom_attach, xoptions=Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, yoptions=Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, xpadding=0, ypadding=0): - Gtk.Table.attach(self, child, left_attach, right_attach, top_attach, bottom_attach, xoptions, yoptions, xpadding, ypadding) + def attach(self, child, left_attach, right_attach, top_attach, bottom_attach, xoptions=Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, yoptions=Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, xpadding=0, ypadding=0): + Gtk.Table.attach(self, child, left_attach, right_attach, top_attach, bottom_attach, xoptions, yoptions, xpadding, ypadding) -Table = override(Table) -__all__.append('Table') + Table = override(Table) + __all__.append('Table') class ScrolledWindow(Gtk.ScrolledWindow): @@ -1464,26 +1495,27 @@ class ScrolledWindow(Gtk.ScrolledWindow): arg_names=('hadjustment', 'vadjustment'), category=PyGTKDeprecationWarning) + ScrolledWindow = override(ScrolledWindow) __all__.append('ScrolledWindow') -class HScrollbar(Gtk.HScrollbar): - __init__ = deprecated_init(Gtk.HScrollbar.__init__, - arg_names=('adjustment',), - category=PyGTKDeprecationWarning) - -HScrollbar = override(HScrollbar) -__all__.append('HScrollbar') +if Gtk._version in ("2.0", "3.0"): + class HScrollbar(Gtk.HScrollbar): + __init__ = deprecated_init(Gtk.HScrollbar.__init__, + arg_names=('adjustment',), + category=PyGTKDeprecationWarning) + HScrollbar = override(HScrollbar) + __all__.append('HScrollbar') -class VScrollbar(Gtk.VScrollbar): - __init__ = deprecated_init(Gtk.VScrollbar.__init__, - arg_names=('adjustment',), - category=PyGTKDeprecationWarning) + class VScrollbar(Gtk.VScrollbar): + __init__ = deprecated_init(Gtk.VScrollbar.__init__, + arg_names=('adjustment',), + category=PyGTKDeprecationWarning) -VScrollbar = override(VScrollbar) -__all__.append('VScrollbar') + VScrollbar = override(VScrollbar) + __all__.append('VScrollbar') class Paned(Gtk.Paned): @@ -1493,35 +1525,36 @@ class Paned(Gtk.Paned): def pack2(self, child, resize=True, shrink=True): super(Paned, self).pack2(child, resize, shrink) + Paned = override(Paned) __all__.append('Paned') -class Arrow(Gtk.Arrow): - __init__ = deprecated_init(Gtk.Arrow.__init__, - arg_names=('arrow_type', 'shadow_type'), - category=PyGTKDeprecationWarning) +if Gtk._version in ("2.0", "3.0"): + class Arrow(Gtk.Arrow): + __init__ = deprecated_init(Gtk.Arrow.__init__, + arg_names=('arrow_type', 'shadow_type'), + category=PyGTKDeprecationWarning) -Arrow = override(Arrow) -__all__.append('Arrow') + Arrow = override(Arrow) + __all__.append('Arrow') + class IconSet(Gtk.IconSet): + def __new__(cls, pixbuf=None): + if pixbuf is not None: + warnings.warn('Gtk.IconSet(pixbuf) has been deprecated. Please use: ' + 'Gtk.IconSet.new_from_pixbuf(pixbuf)', + PyGTKDeprecationWarning, stacklevel=2) + iconset = Gtk.IconSet.new_from_pixbuf(pixbuf) + else: + iconset = Gtk.IconSet.__new__(cls) + return iconset -class IconSet(Gtk.IconSet): - def __new__(cls, pixbuf=None): - if pixbuf is not None: - warnings.warn('Gtk.IconSet(pixbuf) has been deprecated. Please use: ' - 'Gtk.IconSet.new_from_pixbuf(pixbuf)', - PyGTKDeprecationWarning, stacklevel=2) - iconset = Gtk.IconSet.new_from_pixbuf(pixbuf) - else: - iconset = Gtk.IconSet.__new__(cls) - return iconset - - def __init__(self, *args, **kwargs): - return super(IconSet, self).__init__() + def __init__(self, *args, **kwargs): + return super(IconSet, self).__init__() -IconSet = override(IconSet) -__all__.append('IconSet') + IconSet = override(IconSet) + __all__.append('IconSet') class Viewport(Gtk.Viewport): @@ -1529,6 +1562,7 @@ class Viewport(Gtk.Viewport): arg_names=('hadjustment', 'vadjustment'), category=PyGTKDeprecationWarning) + Viewport = override(Viewport) __all__.append('Viewport') @@ -1542,6 +1576,7 @@ class TreeModelFilter(Gtk.TreeModelFilter): iter = self.convert_iter_to_child_iter(iter) self.get_model().set_value(iter, column, value) + TreeModelFilter = override(TreeModelFilter) __all__.append('TreeModelFilter') @@ -1559,8 +1594,13 @@ _Gtk_main_quit = Gtk.main_quit def main_quit(*args): _Gtk_main_quit() -stock_lookup = strip_boolean_result(Gtk.stock_lookup) -__all__.append('stock_lookup') -initialized, argv = Gtk.init_check(sys.argv) -sys.argv = list(argv) +if Gtk._version in ("2.0", "3.0"): + stock_lookup = strip_boolean_result(Gtk.stock_lookup) + __all__.append('stock_lookup') + +if Gtk._version == "4.0": + Gtk.init_check() +else: + initialized, argv = Gtk.init_check(sys.argv) + sys.argv = list(argv) diff --git a/gi/overrides/Makefile.in b/gi/overrides/Makefile.in index 11813bc..6e0976d 100644 --- a/gi/overrides/Makefile.in +++ b/gi/overrides/Makefile.in @@ -176,6 +176,7 @@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/gi/overrides/Pango.py b/gi/overrides/Pango.py index 365e47b..067a628 100644 --- a/gi/overrides/Pango.py +++ b/gi/overrides/Pango.py @@ -37,6 +37,7 @@ class FontDescription(Pango.FontDescription): def __init__(self, *args, **kwargs): return super(FontDescription, self).__init__() + FontDescription = override(FontDescription) __all__.append('FontDescription') @@ -49,5 +50,6 @@ class Layout(Pango.Layout): def set_markup(self, text, length=-1): super(Layout, self).set_markup(text, length) + Layout = override(Layout) __all__.append('Layout') diff --git a/gi/pygi-cache.c b/gi/pygi-cache.c index 5080b66..170b242 100644 --- a/gi/pygi-cache.c +++ b/gi/pygi-cache.c @@ -684,14 +684,13 @@ _callable_cache_generate_args_cache_real (PyGICallableCache *callable_cache, static void _callable_cache_deinit_real (PyGICallableCache *cache) { - g_slist_free (cache->to_py_args); - g_slist_free (cache->arg_name_list); - g_hash_table_destroy (cache->arg_name_hash); - g_ptr_array_unref (cache->args_cache); - Py_XDECREF (cache->resulttuple_type); - - if (cache->return_cache != NULL) - pygi_arg_cache_free (cache->return_cache); + g_clear_pointer (&cache->to_py_args, g_slist_free); + g_clear_pointer (&cache->arg_name_list, g_slist_free); + g_clear_pointer (&cache->arg_name_hash, g_hash_table_unref); + g_clear_pointer (&cache->args_cache, g_ptr_array_unref); + Py_CLEAR (cache->resulttuple_type); + + g_clear_pointer (&cache->return_cache, pygi_arg_cache_free); } static gboolean diff --git a/gi/repository/Makefile.in b/gi/repository/Makefile.in index 3810adf..08de64c 100644 --- a/gi/repository/Makefile.in +++ b/gi/repository/Makefile.in @@ -176,6 +176,7 @@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/gi/types.py b/gi/types.py index 8acbcc2..9d3cb0c 100644 --- a/gi/types.py +++ b/gi/types.py @@ -204,6 +204,7 @@ class _GObjectMetaBase(type): _gobject.type_register(cls, namespace.get('__gtype_name__')) + _gobject._install_metaclass(_GObjectMetaBase) diff --git a/pygtkcompat/Makefile.in b/pygtkcompat/Makefile.in index d0540c2..1603a25 100644 --- a/pygtkcompat/Makefile.in +++ b/pygtkcompat/Makefile.in @@ -176,6 +176,7 @@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/pygtkcompat/pygtkcompat.py b/pygtkcompat/pygtkcompat.py index e976344..fd651f5 100644 --- a/pygtkcompat/pygtkcompat.py +++ b/pygtkcompat/pygtkcompat.py @@ -99,6 +99,7 @@ def enable(): from gi.repository import Gio sys.modules['gio'] = Gio + _unset = object() diff --git a/tests/Makefile.in b/tests/Makefile.in index 33b800a..70bfe67 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -223,6 +223,7 @@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/tests/test_generictreemodel.py b/tests/test_generictreemodel.py index cb248d7..30ae125 100644 --- a/tests/test_generictreemodel.py +++ b/tests/test_generictreemodel.py @@ -415,5 +415,6 @@ class TestReturnsAfterError(unittest.TestCase): res = self.model.iter_parent(child) self.assertEqual(res, None) + if __name__ == '__main__': unittest.main() diff --git a/tests/test_interface.py b/tests/test_interface.py index dd01af8..ba20cb4 100644 --- a/tests/test_interface.py +++ b/tests/test_interface.py @@ -20,6 +20,8 @@ class MyUnknown(Unknown, testhelper.Interface): def do_iface_method(self): self.called = True Unknown.do_iface_method(self) + + GObject.type_register(MyUnknown) @@ -32,6 +34,8 @@ class MyObject(GObject.GObject, testhelper.Interface): def do_iface_method(self): self.called = True + + GObject.type_register(MyObject) diff --git a/tests/test_iochannel.py b/tests/test_iochannel.py index aa130ec..5980a66 100644 --- a/tests/test_iochannel.py +++ b/tests/test_iochannel.py @@ -423,5 +423,6 @@ second line self.assertEqual(GLib.IOFlags.IS_SEEKABLE, GLib.IO_FLAG_IS_SEEKABLE) self.assertEqual(GLib.IOStatus.NORMAL, GLib.IO_STATUS_NORMAL) + if __name__ == '__main__': unittest.main() diff --git a/tests/test_overrides_gtk.py b/tests/test_overrides_gtk.py index f47c63b..6562413 100644 --- a/tests/test_overrides_gtk.py +++ b/tests/test_overrides_gtk.py @@ -76,8 +76,8 @@ class TestGtk(unittest.TestCase): self.assertTrue(label2 in box) self.assertEqual(len(box), 2) self.assertTrue(box) - l = [x for x in box] - self.assertEqual(l, [label, label2]) + labels = [x for x in box] + self.assertEqual(labels, [label, label2]) def test_actions(self): self.assertEqual(Gtk.Action, gi.overrides.Gtk.Action) @@ -615,9 +615,9 @@ class TestGtk(unittest.TestCase): self.assertEqual(viewport.props.hadjustment, hadjustment) def test_stock_lookup(self): - l = Gtk.stock_lookup('gtk-ok') - self.assertEqual(type(l), Gtk.StockItem) - self.assertEqual(l.stock_id, 'gtk-ok') + stock_item = Gtk.stock_lookup('gtk-ok') + self.assertEqual(type(stock_item), Gtk.StockItem) + self.assertEqual(stock_item.stock_id, 'gtk-ok') self.assertEqual(Gtk.stock_lookup('nosuchthing'), None) def test_gtk_main(self): diff --git a/tests/test_properties.py b/tests/test_properties.py index ab71000..109fdb9 100644 --- a/tests/test_properties.py +++ b/tests/test_properties.py @@ -1137,9 +1137,9 @@ class CPropertiesTestBase(object): def test_boxed_glist(self): self.assertEqual(self.get_prop(self.obj, 'some-boxed-glist'), []) - l = [GLib.MININT, 42, GLib.MAXINT] - self.set_prop(self.obj, 'some-boxed-glist', l) - self.assertEqual(self.get_prop(self.obj, 'some-boxed-glist'), l) + list_ = [GLib.MININT, 42, GLib.MAXINT] + self.set_prop(self.obj, 'some-boxed-glist', list_) + self.assertEqual(self.get_prop(self.obj, 'some-boxed-glist'), list_) self.set_prop(self.obj, 'some-boxed-glist', []) self.assertEqual(self.get_prop(self.obj, 'some-boxed-glist'), []) @@ -1158,9 +1158,9 @@ class CPropertiesTestBase(object): @unittest.expectedFailure def test_boxed_glist_ctor(self): - l = [GLib.MININT, 42, GLib.MAXINT] - obj = GIMarshallingTests.PropertiesObject(some_boxed_glist=l) - self.assertEqual(self.get_prop(obj, 'some-boxed-glist'), l) + list_ = [GLib.MININT, 42, GLib.MAXINT] + obj = GIMarshallingTests.PropertiesObject(some_boxed_glist=list_) + self.assertEqual(self.get_prop(obj, 'some-boxed-glist'), list_) def test_variant(self): self.assertEqual(self.get_prop(self.obj, 'some-variant'), None) diff --git a/tests/test_signal.py b/tests/test_signal.py index 92db5a0..91607f9 100644 --- a/tests/test_signal.py +++ b/tests/test_signal.py @@ -659,6 +659,7 @@ class _TestCMarshaller: self.assertEqual(self.obj.emit("test-gvalue-ret", GObject.TYPE_STRING), "hello") + if 'generic-c-marshaller' in GObject.features: class TestCMarshaller(_TestCMarshaller, unittest.TestCase): pass |