From: Nick Bowler Date: Thu, 26 Nov 2020 07:51:27 +0000 (-0500) Subject: Resurrect dev-python/pygtk. X-Git-Url: https://git.draconx.ca/gitweb/gentoo-fixes.git/commitdiff_plain/1af3b4950d9e72d2439a29c78b58e7c774b419ac Resurrect dev-python/pygtk. This is needed for gimp python support. Bring back pygtk and versions of its dependencies for python-2, parallel installable with the current versions in gentoo repo. --- diff --git a/dev-python/pycairo/Manifest b/dev-python/pycairo/Manifest new file mode 100644 index 0000000..d592ffa --- /dev/null +++ b/dev-python/pycairo/Manifest @@ -0,0 +1,5 @@ +AUX pycairo-1.18.2-no-setuptools.patch 390 BLAKE2B 2e96d663534447de9aadd2a688dd6277a35ff2f9f3ea3f8a9bd060d4fffca36c565ac0ba4dff2b1fe470ac55cace671b7875a387d85fcaf307a289727f922190 SHA512 31775030b33a756a5075b793f5a4b6c3998f42b6a98f612aa991a2c8ed72263363aaf2dcf43bbd2357adb8897f372e3cd88526fe1b14f3ed645cde53386127f0 +AUX pycairo-1.19.1-py39.patch 890 BLAKE2B 8ee84005e17fd485f568213e751dd30bcb904806d4016088d0c6882958ce7edeba2517f3ab4b8139a8f923e3baec435bc9a21cf3546b60f4459c5cc9ad7a54d6 SHA512 607d6f2cf6bcaec394b755f452d3c4bc0f6edb39bea185a18258c1ee0db11a99d84c7605dbe9db83906518d41baf065b2b8d9261db3736f8a737a2a8f7dff266 +DIST pycairo-1.18.2.tar.gz 200462 BLAKE2B 1f755dc90fe3ee50aa68273a0816752312f144831ff857709e1a4695a58646ffe6be518733480ed37231c213a11d4e5aaf8dfd1cfa68104873bc7d4192435b89 SHA512 279ea80413ba55d493d51455685da09afa1f5c45e2930c3fca3e417a8afe6645a0d8131201f79482de59e5ec56cfef62eac65ed88fe88866bfcc06503dcc59e0 +EBUILD pycairo-1.18.2-r1.ebuild 1750 BLAKE2B 8c53d49cd8b810c371264bf9bf1eaddf63c3d29880fdc8936512c7f5980780a59b154977f4fc60ac60ff91777acdfbff18b0efd0fe24197362d493db7f232cd7 SHA512 833453edd35bfdef0bf41b4fddc9e55612bfb129288b3eada6989ae121287d0000c247fc428e936067060c6679f566f9091dcc6ed207806e8b488d66244b3532 +EBUILD pycairo-1.18.2.ebuild 1338 BLAKE2B 11805aacbe6c9779dcb6617ea7395e8a6fef2ed86a2fc4085fc5c73f94659405152754fde9aaf94bc2802615a1e1349e8170dbb50f604265bd68b4b1f818599c SHA512 ae1b95e7e12be835fdbed2ecf94a507cfd3df1181b12af3bed72f0644c61bfe465b43aee4ce0820046ef7bf691188eb217eb4933fa9acaa1842fca9603239171 diff --git a/dev-python/pycairo/files/pycairo-1.18.2-no-setuptools.patch b/dev-python/pycairo/files/pycairo-1.18.2-no-setuptools.patch new file mode 100644 index 0000000..9ec62b8 --- /dev/null +++ b/dev-python/pycairo/files/pycairo-1.18.2-no-setuptools.patch @@ -0,0 +1,16 @@ +diff --git a/setup.py b/setup.py +index fc48072..86f8560 100755 +--- a/setup.py ++++ b/setup.py +@@ -6,10 +6,7 @@ import sys + import os + import errno + +-try: +- from setuptools import setup +-except ImportError: +- from distutils.core import setup ++from distutils.core import setup + + from distutils.core import Extension, Command, Distribution + from distutils.ccompiler import new_compiler diff --git a/dev-python/pycairo/files/pycairo-1.19.1-py39.patch b/dev-python/pycairo/files/pycairo-1.19.1-py39.patch new file mode 100644 index 0000000..97b2022 --- /dev/null +++ b/dev-python/pycairo/files/pycairo-1.19.1-py39.patch @@ -0,0 +1,26 @@ +From 3ecf0a4060d6de3b92a77a393ece663455cf6add Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sun, 10 May 2020 11:22:40 +0200 +Subject: [PATCH] tests: Fix syntax issue with Python 3.9 + +https://bugs.python.org/issue40246 + +I haven't actually tested with 3.9 yet, so this is just what I found +with grep. +--- + tests/test_enums.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_enums.py b/tests/test_enums.py +index 4bc2e3d..02756d0 100644 +--- a/tests/test_enums.py ++++ b/tests/test_enums.py +@@ -79,7 +79,7 @@ def get_prefix(t): + # special case.. + if name == "PathDataType": + name = "Path" +- return"_".join([s.upper() for s in re.findall('[A-Z][^A-Z]*', name)]) ++ return "_".join([s.upper() for s in re.findall('[A-Z][^A-Z]*', name)]) + + for t in types_: + for name in dir(t): diff --git a/dev-python/pycairo/pycairo-1.18.2-r1.ebuild b/dev-python/pycairo/pycairo-1.18.2-r1.ebuild new file mode 100644 index 0000000..c596011 --- /dev/null +++ b/dev-python/pycairo/pycairo-1.18.2-r1.ebuild @@ -0,0 +1,61 @@ +# Copyright © 2020 Nick Bowler +# +# License GPLv2+: GNU General Public License version 2 or any later version. +# This is free software: you are free to change and redistribute it. +# There is NO WARRANTY, to the extent permitted by law. +# +# This is a modified version of the original ebuild from Gentoo GNU/Linux, +# covered by the following copyright and permission notice: +# +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +PYTHON_COMPAT=( python2_7 ) +PYTHON_REQ_USE="threads(+)" +DISTUTILS_USE_SETUPTOOLS=no + +inherit distutils-r1 + +DESCRIPTION="Python bindings for the cairo library" +HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo" +SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz" + +LICENSE="|| ( LGPL-2.1 MPL-1.1 )" +SLOT="2" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="examples" + +# Strong block on old pycairo w/ python2 support because the merge will +# otherwise not work properly due to replacing a directory with a file. + +RDEPEND=">=x11-libs/cairo-1.13.1[svg] + !!dev-python/pycairo:0[python_targets_python2_7]" +DEPEND=$RDEPEND + +PATCHES=( + "$FILESDIR/$P-no-setuptools.patch" + "$FILESDIR/$PN-1.19.1-py39.patch" +) + +distutils_enable_sphinx docs \ + dev-python/sphinx_rtd_theme +distutils_enable_tests setup.py + +python_test() { + einfo "Skipping tests on Python 2 to unblock deps" +} + +python_install() { + distutils-r1_python_install \ + install_pkgconfig --pkgconfigdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig" +} + +python_install_all() { + if use examples; then + dodoc -r examples + fi + + distutils-r1_python_install_all +} diff --git a/dev-python/pycairo/pycairo-1.18.2.ebuild b/dev-python/pycairo/pycairo-1.18.2.ebuild new file mode 100644 index 0000000..253c565 --- /dev/null +++ b/dev-python/pycairo/pycairo-1.18.2.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +PYTHON_COMPAT=( python2_7 python3_{6..9} ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 + +DESCRIPTION="Python bindings for the cairo library" +HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo" +SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz" + +LICENSE="|| ( LGPL-2.1 MPL-1.1 )" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="examples" + +BDEPEND=" + test? ( + $(python_gen_cond_dep ' + dev-python/hypothesis[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + ' -3) + ) +" +RDEPEND=" + >=x11-libs/cairo-1.13.1[svg] +" +DEPEND="${RDEPEND}" + +PATCHES=( "${FILESDIR}/${PN}-1.19.1-py39.patch" ) + +distutils_enable_sphinx docs \ + dev-python/sphinx_rtd_theme +distutils_enable_tests setup.py + +python_test() { + if ! python_is_python3; then + einfo "Skipping tests on Python 2 to unblock deps" + return + fi + + esetup.py test +} + +python_install() { + distutils-r1_python_install \ + install_pkgconfig --pkgconfigdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig" +} + +python_install_all() { + if use examples; then + dodoc -r examples + fi + + distutils-r1_python_install_all +} diff --git a/dev-python/pygobject/Manifest b/dev-python/pygobject/Manifest new file mode 100644 index 0000000..1acab78 --- /dev/null +++ b/dev-python/pygobject/Manifest @@ -0,0 +1,11 @@ +AUX pygobject-2.28.3-fix-codegen-location.patch 1948 BLAKE2B c3f4735c9a2fdd1cc9847766299fb6c6d0bd7e54a9920c1b2f2a82edaab9399906cd9504d361869494db93782d278c2a099efdd519571b6ca25d2b681295950c SHA512 6f618d3826a505906669bbbe680a514e61884564f2c3025c438a97f192de6c9fd0e7f43c8e9bfff62776a51a56b0eead6ca54a0c157c071cf0f493b8f0d46506 +AUX pygobject-2.28.3-make_check.patch 2705 BLAKE2B 42cf86c7b45d4d63831a0772ead400b083dd73c5f95f2a4fd8e7c0810b0ab6781218e65d0de1a031102a0f525a5c1f73426431c6561d412ced95c3e2f883f6d7 SHA512 9829f92ce0ace9d1a6e84428dc16bd0a893a24e784273e79c849618ebf4749e3168e6b1f1b9a9ca7e114ec04612045985823ad34247891d8ba7609279c4c4af4 +AUX pygobject-2.28.3-support_multiple_python_versions.patch 3938 BLAKE2B 5cc2d6cd8059a536d9198c08a2de36e538d6a36b4617a5c5254172716faf94dceedfa3204683e7ba71df8bbf3ba3140d3837a1b860a96ea856f8e3377aa56d5b SHA512 b835c503ea1baa831d1f258221998c5194ea58750e33564ff7b22870a8f47dfef37d986aa282d527dd2ea2b9e598ffede38ed7dd8f966788e32e8719ac94035f +AUX pygobject-2.28.6-disable-failing-tests.patch 3549 BLAKE2B fed363cb76f5115b44ef9ae8b96e863bd9d7c10b7fc1d5416745e6de0e85c2f85cf4ea3792fec36c2edab0a2592c1f63be0c996222d707e9231f92ba6d5bb4b9 SHA512 1ff3b9474c1fbf7e4fe7f2346f862f1ba1da0748d955ebcfd606d74b885c12daa2673c31aa594925c441bfaa29390d9324e56696e291d3f7e301cbf114491cb3 +AUX pygobject-2.28.6-gio-types-2.32.patch 1231 BLAKE2B 1649df8d58ee096a0746b5ca282f18f6cc64e66683ea9dd24343b4441d582eba9b1dec82eab6397397da1155ee3e8d872a1e261e04734aa88dccc2652ebc625d SHA512 86a34f73a4436ff77488743fc15c0cc901c27b55dad9bcfdc9c32ff184bccc277217d5a0e13bc36982e14e34ab5fee5224e055879a0036a1ccdf5dc26bc737d4 +AUX pygobject-2.28.6-glib-2.36-class_init.patch 11038 BLAKE2B d610454930cf4a568fc9800b3fc58440e2bbc08d91572e7263df42af9c20d2400f7c6d4f64a0cdd066be1469ff33e2ba01b452b5898fe1368add1bb947ca366f SHA512 e8acc5970ac540dc01551759591ee693ae12dd1512130b135e397e528d920159f0f8866bb8a611e2c06cd96f899ef7239153b59a2ec0318e1fd08266acf95e04 +AUX pygobject-2.28.6-python-byte-compile.patch 539 BLAKE2B b2d64ab0ad8943948c7bf0856d23ab20259810d8717fa20f3bc5e76d96d2df880a9b452ba79e6429d7060d7975fa817a321c1c74099a1d672e590ff1b1240eb0 SHA512 257ec04b0eb61cdb3b3e08fe1983ba8923e4264f2d51bccb533a15636dadf2ebe657e7997696ce989f87364a5213b500d0abe6bfa05bb6656ff814dc67a953f7 +AUX pygobject-2.28.6-set_qdata.patch 847 BLAKE2B 696aa6c48ee900db738f8a92265a625a3ab7b59afece84157bf0b9abd0aca5ae68b7ac8cc627a47a5b1a688029d592abcc38e403543a4144e055bcdac68285e4 SHA512 19025af51a8387061276ec9d6c8eb0ecadb5124bba2c4ab3755ab653df467896d19c366d80ce9313fd46e43b493b7c536f780014cf18a6ac47f4b1d2ad4bedb4 +AUX pygobject-2.28.6-tests-no-introspection.patch 1257 BLAKE2B 7ff0587b4b40a1519927f8837b5487847ad0d0aa25f57dbaa4b10eaed2eff79f52d6581ca29f1688ebdbe71db231aba56de06c3aa8b246fdd1799320d9a15cc3 SHA512 7d57cb9bbd0b16f4fb0ed9d5eca310c47daf86b89daefa41fb0cf5dd470a6f6a31d0dad31dd261332c039d39bd778f9de8de7260c5856f1b718f72b9aabc01b4 +DIST pygobject-2.28.6.tar.xz 747248 BLAKE2B 5f92794034b2d0559a623db4a7d273a7dc3f099cae87ede91b17e81acac085a9298c6b81b45b4b8540b6a75ced97e474a993437dbfcfc2133d3321d6a979b541 SHA512 37544ea2377258758169b25a2969d5ee1c9ffb9b6e63e05bc7a0471a49ac9169c51ec587d4489172c7d256f53df878a81c1992a08059aa7e43dbbb69f799545c +EBUILD pygobject-2.28.6-r56.ebuild 3789 BLAKE2B 08d12f3ee8dd9c7355cf8b10fb7c39e8bf83f8beaad1895b5c02d5b79313ece6bf2efda31ba6af19d540f7657df30362c97e8d36e618d237d6c32a791a6ffef6 SHA512 552af976c6fe3d6fbccd77a15b4e84265b9a4752596d181020654d93bb7b46a2d88ba10dd2834a685a0e35b93ef8eedb657bbfe7fdebb1adcc597b5151f1ca35 diff --git a/dev-python/pygobject/files/pygobject-2.28.3-fix-codegen-location.patch b/dev-python/pygobject/files/pygobject-2.28.3-fix-codegen-location.patch new file mode 100644 index 0000000..44440a5 --- /dev/null +++ b/dev-python/pygobject/files/pygobject-2.28.3-fix-codegen-location.patch @@ -0,0 +1,64 @@ +From b3e852d29bfd1e90f7e0da409fd0ae36cc01675a Mon Sep 17 00:00:00 2001 +From: Gilles Dartiguelongue +Date: Fri, 8 Apr 2011 15:36:35 +0200 +Subject: [PATCH 1/3] Move codegen to a non-private directory + +--- + codegen/Makefile.am | 2 +- + codegen/pygobject-codegen-2.0.in | 3 ++- + pygobject-2.0.pc.in | 3 ++- + 3 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/codegen/Makefile.am b/codegen/Makefile.am +index f9886eb..d714ff2 100644 +--- a/codegen/Makefile.am ++++ b/codegen/Makefile.am +@@ -2,7 +2,7 @@ PLATFORM_VERSION = 2.0 + + bin_SCRIPTS = pygobject-codegen-$(PLATFORM_VERSION) + +-codegendir = $(pkgdatadir)/$(PLATFORM_VERSION)/codegen ++codegendir = $(pyexecdir)/gtk-2.0/codegen + + codegen_SCRIPTS = \ + code-coverage.py \ +diff --git a/codegen/pygobject-codegen-2.0.in b/codegen/pygobject-codegen-2.0.in +index c5c912e..c04451b 100644 +--- a/codegen/pygobject-codegen-2.0.in ++++ b/codegen/pygobject-codegen-2.0.in +@@ -1,9 +1,10 @@ + #!/bin/sh + + prefix=@prefix@ ++exec_prefix=@exec_prefix@ + datarootdir=@datarootdir@ + datadir=@datadir@ +-codegendir=${datadir}/pygobject/2.0/codegen ++codegendir=@pyexecdir@/gtk-2.0/codegen + + PYTHONPATH=$codegendir + export PYTHONPATH +diff --git a/pygobject-2.0.pc.in b/pygobject-2.0.pc.in +index a47b685..0d1a811 100644 +--- a/pygobject-2.0.pc.in ++++ b/pygobject-2.0.pc.in +@@ -4,6 +4,7 @@ includedir=@includedir@ + datarootdir=@datarootdir@ + datadir=@datadir@ + libdir=@libdir@ ++pyexecdir=@pyexecdir@ + + # you can use the --variable=pygtkincludedir argument to + # pkg-config to get this value. You might want to use this to +@@ -12,7 +13,7 @@ pygtkincludedir=${includedir}/pygtk-2.0 + fixxref=${datadir}/pygobject/xsl/fixxref.py + pygdocs=${datadir}/gtk-doc/html/pygobject + defsdir=${datadir}/pygobject/2.0/defs +-codegendir=${datadir}/pygobject/2.0/codegen ++codegendir=${pyexecdir}/gtk-2.0/codegen + overridesdir=@pyexecdir@/gi/overrides + + Name: PyGObject +-- +1.7.4.1 + diff --git a/dev-python/pygobject/files/pygobject-2.28.3-make_check.patch b/dev-python/pygobject/files/pygobject-2.28.3-make_check.patch new file mode 100644 index 0000000..45c04b9 --- /dev/null +++ b/dev-python/pygobject/files/pygobject-2.28.3-make_check.patch @@ -0,0 +1,76 @@ +From b5c4b8b97a1ccb9a4c63ab726ea9c84d81ef51ca Mon Sep 17 00:00:00 2001 +From: Gilles Dartiguelongue +Date: Fri, 5 Nov 2010 23:39:08 +0100 +Subject: [PATCH 2/3] Do not build tests unless needed + +--- + tests/Makefile.am | 12 +++++------- + tests/runtests.py | 2 ++ + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index bad15f0..5b0859a 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -1,7 +1,7 @@ + CLEANFILES = +-noinst_LTLIBRARIES = ++check_LTLIBRARIES = + if ENABLE_INTROSPECTION +-noinst_LTLIBRARIES += libregress.la libgimarshallingtests.la ++check_LTLIBRARIES += libregress.la libgimarshallingtests.la + + nodist_libregress_la_SOURCES = $(GI_DATADIR)/tests/regress.c $(GI_DATADIR)/tests/regress.h + libregress_la_CFLAGS = $(GIO_CFLAGS) $(PYCAIRO_CFLAGS) +@@ -46,7 +46,7 @@ gschemas.compiled: org.gnome.test.gschema.xml + CLEANFILES += Regress-1.0.gir Regress-1.0.typelib GIMarshallingTests-1.0.gir GIMarshallingTests-1.0.typelib gschemas.compiled + endif + +-noinst_LTLIBRARIES += testhelper.la ++check_LTLIBRARIES += testhelper.la + + testhelper_la_CFLAGS = -I$(top_srcdir)/gobject -I$(top_srcdir)/glib $(PYTHON_INCLUDES) $(GLIB_CFLAGS) + testhelper_la_LDFLAGS = -module -avoid-version +@@ -66,8 +66,6 @@ testhelper.la: $(testhelper_la_OBJECTS) $(testhelper_la_DEPENDENCIES) + test -L $@ || $(LN_S) .libs/$@ $@ + + +-all: $(LTLIBRARIES:.la=.so) +- + TEST_FILES_STATIC = \ + test_gobject.py \ + test_interface.py \ +@@ -109,7 +107,7 @@ EXTRA_DIST = \ + EXTRA_DIST += $(TEST_FILES_STATIC) $(TEST_FILES_GI) $(TEST_FILES_GIO) + + clean-local: +- rm -f $(LTLIBRARIES:.la=.so) file.txt~ ++ rm -f $(check_LTLIBRARIES:.la=.so) file.txt~ + + DBUS_LAUNCH=$(shell which dbus-launch) + RUN_TESTS_ENV_VARS= \ +@@ -121,7 +119,7 @@ RUN_TESTS_ENV_VARS= \ + RUN_TESTS_LAUNCH=$(RUN_TESTS_ENV_VARS) $(DBUS_LAUNCH) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py + + # run tests in separately to avoid loading static and introspection bindings in the same process +-check-local: $(LTLIBRARIES:.la=.so) Regress-1.0.typelib GIMarshallingTests-1.0.typelib gschemas.compiled ++check-local: $(check_LTLIBRARIES:.la=.so) Regress-1.0.typelib GIMarshallingTests-1.0.typelib gschemas.compiled + TEST_FILES="$(TEST_FILES_STATIC)" $(RUN_TESTS_LAUNCH) + TEST_FILES="$(TEST_FILES_GI)" $(RUN_TESTS_LAUNCH) + if BUILD_GIO +diff --git a/tests/runtests.py b/tests/runtests.py +index 2bb8637..4107bcf 100644 +--- a/tests/runtests.py ++++ b/tests/runtests.py +@@ -6,6 +6,8 @@ import sys + + import unittest + ++# Some tests fail with translated messages. ++os.environ["LC_ALL"] = "C" + + # force untranslated messages, as we check for them in some tests + os.environ['LC_MESSAGES'] = 'C' +-- +1.7.4.1 + diff --git a/dev-python/pygobject/files/pygobject-2.28.3-support_multiple_python_versions.patch b/dev-python/pygobject/files/pygobject-2.28.3-support_multiple_python_versions.patch new file mode 100644 index 0000000..65d881a --- /dev/null +++ b/dev-python/pygobject/files/pygobject-2.28.3-support_multiple_python_versions.patch @@ -0,0 +1,103 @@ +From 2f75378f3c56f245cabdcd2c52b561dbb878db2d Mon Sep 17 00:00:00 2001 +From: Gilles Dartiguelongue +Date: Fri, 8 Apr 2011 15:43:39 +0200 +Subject: [PATCH 3/3] Enable support to build against multiple version of python + +--- + codegen/pygobject-codegen-2.0.in | 2 +- + gi/Makefile.am | 2 +- + gio/Makefile.am | 2 +- + glib/Makefile.am | 10 +++++----- + gobject/Makefile.am | 2 +- + 5 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/codegen/pygobject-codegen-2.0.in b/codegen/pygobject-codegen-2.0.in +index c04451b..194e5ba 100644 +--- a/codegen/pygobject-codegen-2.0.in ++++ b/codegen/pygobject-codegen-2.0.in +@@ -4,7 +4,7 @@ prefix=@prefix@ + exec_prefix=@exec_prefix@ + datarootdir=@datarootdir@ + datadir=@datadir@ +-codegendir=@pyexecdir@/gtk-2.0/codegen ++codegendir=$(@PYTHON@ -c "from distutils import sysconfig; print sysconfig.get_python_lib(1, 0, prefix='@exec_prefix@')")/gtk-2.0/codegen + + PYTHONPATH=$codegendir + export PYTHONPATH +diff --git a/gi/Makefile.am b/gi/Makefile.am +index 31f6c79..8690522 100644 +--- a/gi/Makefile.am ++++ b/gi/Makefile.am +@@ -25,7 +25,7 @@ _gi_la_LDFLAGS = \ + -export-symbols-regex "init_gi|PyInit__gi" + _gi_la_LIBADD = \ + $(GI_LIBS) \ +- $(top_builddir)/glib/libpyglib-2.0-@PYTHON_BASENAME@.la ++ $(top_builddir)/glib/libpyglib-2.0-@PYTHON_BASENAME@@PYTHON_VERSION@.la + _gi_la_SOURCES = \ + pygi-repository.c \ + pygi-repository.h \ +diff --git a/gio/Makefile.am b/gio/Makefile.am +index 6b3eb57..00e1c54 100644 +--- a/gio/Makefile.am ++++ b/gio/Makefile.am +@@ -67,7 +67,7 @@ EXTRA_DIST += $(GIO_DEFS) $(GIO_OVERRIDES) + gio.c: $(GIO_DEFS) $(GIO_OVERRIDES) + _gio_la_CFLAGS = $(GIO_CFLAGS) + _gio_la_LDFLAGS = $(common_ldflags) -export-symbols-regex init_gio +-_gio_la_LIBADD = $(GIO_LIBS) $(top_builddir)/glib/libpyglib-2.0-@PYTHON_BASENAME@.la ++_gio_la_LIBADD = $(GIO_LIBS) $(top_builddir)/glib/libpyglib-2.0-@PYTHON_BASENAME@@PYTHON_VERSION@.la + _gio_la_SOURCES = \ + giomodule.c \ + pygio-utils.c \ +diff --git a/glib/Makefile.am b/glib/Makefile.am +index e210318..df39687 100644 +--- a/glib/Makefile.am ++++ b/glib/Makefile.am +@@ -4,7 +4,7 @@ INCLUDES = $(PYTHON_INCLUDES) $(GLIB_CFLAGS) -DPY_SSIZE_T_CLEAN + pkgincludedir = $(includedir)/pygtk-2.0 + pkginclude_HEADERS = pyglib.h + +-lib_LTLIBRARIES = libpyglib-2.0-@PYTHON_BASENAME@.la ++lib_LTLIBRARIES = libpyglib-2.0-@PYTHON_BASENAME@@PYTHON_VERSION@.la + + pkgpyexecdir = $(pyexecdir) + +@@ -19,9 +19,9 @@ if PLATFORM_WIN32 + common_ldflags += -no-undefined + endif + +-libpyglib_2_0_@PYTHON_BASENAME@_la_CFLAGS = $(GLIB_CFLAGS) +-libpyglib_2_0_@PYTHON_BASENAME@_la_LIBADD = $(GLIB_LIBS) $(FFI_LIBS) +-libpyglib_2_0_@PYTHON_BASENAME@_la_SOURCES = \ ++libpyglib_2_0_@PYTHON_BASENAME@@PYTHON_VERSION@_la_CFLAGS = $(GLIB_CFLAGS) ++libpyglib_2_0_@PYTHON_BASENAME@@PYTHON_VERSION@_la_LIBADD = $(GLIB_LIBS) $(FFI_LIBS) ++libpyglib_2_0_@PYTHON_BASENAME@@PYTHON_VERSION@_la_SOURCES = \ + pyglib.c \ + pyglib.h \ + pyglib-private.h \ +@@ -29,7 +29,7 @@ libpyglib_2_0_@PYTHON_BASENAME@_la_SOURCES = \ + + _glib_la_CFLAGS = $(GLIB_CFLAGS) + _glib_la_LDFLAGS = $(common_ldflags) -export-symbols-regex "_glib|PyInit__glib" +-_glib_la_LIBADD = $(GLIB_LIBS) libpyglib-2.0-@PYTHON_BASENAME@.la ++_glib_la_LIBADD = $(GLIB_LIBS) libpyglib-2.0-@PYTHON_BASENAME@@PYTHON_VERSION@.la + _glib_la_SOURCES = \ + glibmodule.c \ + pygiochannel.c \ +diff --git a/gobject/Makefile.am b/gobject/Makefile.am +index 7208329..3f9ad8e 100644 +--- a/gobject/Makefile.am ++++ b/gobject/Makefile.am +@@ -35,7 +35,7 @@ _gobject_la_LDFLAGS = $(common_ldflags) -export-symbols-regex "_gobject|PyInit__ + _gobject_la_LIBADD = \ + $(GLIB_LIBS) \ + $(FFI_LIBS) \ +- $(top_builddir)/glib/libpyglib-2.0-@PYTHON_BASENAME@.la ++ $(top_builddir)/glib/libpyglib-2.0-@PYTHON_BASENAME@@PYTHON_VERSION@.la + _gobject_la_SOURCES = \ + gobjectmodule.c \ + pygboxed.c \ +-- +1.7.4.1 + diff --git a/dev-python/pygobject/files/pygobject-2.28.6-disable-failing-tests.patch b/dev-python/pygobject/files/pygobject-2.28.6-disable-failing-tests.patch new file mode 100644 index 0000000..f9d396d --- /dev/null +++ b/dev-python/pygobject/files/pygobject-2.28.6-disable-failing-tests.patch @@ -0,0 +1,98 @@ +From 9d8867a7c67a14d055a0dd8db5f6a9aae5762a04 Mon Sep 17 00:00:00 2001 +From: Alexandre Rostovtsev +Date: Sun, 13 Jan 2013 19:50:14 -0500 +Subject: [PATCH] Disable failing tests + +--- + tests/test_gio.py | 13 ++++++++----- + tests/test_overrides.py | 4 ++-- + 2 files changed, 10 insertions(+), 7 deletions(-) + +diff --git a/tests/test_gio.py b/tests/test_gio.py +index e14eddf..a4d1bc7 100644 +--- a/tests/test_gio.py ++++ b/tests/test_gio.py +@@ -650,10 +650,11 @@ class TestInputStream(unittest.TestCase): + else: + return read_data + ++ """ + def testReadAsync(self): + def callback(stream, result): +- self.assertEquals(result.get_op_res_gssize(), 7) + try: ++ self.assertEquals(result.get_op_res_gssize(), 7) + data = stream.read_finish(result) + self.assertEquals(data, "testing") + stream.close() +@@ -694,7 +695,7 @@ class TestInputStream(unittest.TestCase): + self.assertRaises(TypeError, self.stream.read_async, 1024, + priority=1, cancellable="bar") + self.assertRaises(TypeError, self.stream.read_async, 1024, 1, "bar") +- ++ """ + + # FIXME: this makes 'make check' freeze + def _testCloseAsync(self): +@@ -822,10 +823,11 @@ class TestOutputStream(unittest.TestCase): + + self.assertEquals(stream.get_contents(), some_data) + ++ """ + def testWriteAsync(self): + def callback(stream, result): +- self.assertEquals(result.get_op_res_gssize(), 7) + try: ++ self.assertEquals(result.get_op_res_gssize(), 7) + self.assertEquals(stream.write_finish(result), 7) + self.failUnless(os.path.exists("outputstream.txt")) + self.assertEquals(open("outputstream.txt").read(), "testing") +@@ -861,6 +863,7 @@ class TestOutputStream(unittest.TestCase): + self.assertRaises(TypeError, self.stream.write_async, "foo", + priority=1, cancellable="bar") + self.assertRaises(TypeError, self.stream.write_async, "foo", 1, "bar") ++ """ + + # FIXME: this makes 'make check' freeze + def _testCloseAsync(self): +@@ -1007,7 +1010,7 @@ class TestVfs(unittest.TestCase): + class TestVolume(unittest.TestCase): + def setUp(self): + self.monitor = gio.volume_monitor_get() +- ++""" + def testVolumeEnumerate(self): + volumes = self.monitor.get_volumes() + self.failUnless(isinstance(volumes, list)) +@@ -1018,7 +1021,7 @@ class TestVolume(unittest.TestCase): + for id in ids: + if id is not None: + self.failUnless(isinstance(id, str)) +- ++""" + class TestFileInputStream(unittest.TestCase): + def setUp(self): + self._f = open("file.txt", "w+") +diff --git a/tests/test_overrides.py b/tests/test_overrides.py +index 47f38a3..063792d 100644 +--- a/tests/test_overrides.py ++++ b/tests/test_overrides.py +@@ -337,13 +337,13 @@ class TestPango(unittest.TestCase): + desc = Pango.FontDescription('monospace') + self.assertEquals(desc.get_family(), 'monospace') + self.assertEquals(desc.get_variant(), Pango.Variant.NORMAL) +- ++""" + def test_layout(self): + self.assertRaises(TypeError, Pango.Layout) + context = Pango.Context() + layout = Pango.Layout(context) + self.assertEquals(layout.get_context(), context) +- ++""" + class TestGdk(unittest.TestCase): + + def test_constructor(self): +-- +1.8.1 + diff --git a/dev-python/pygobject/files/pygobject-2.28.6-gio-types-2.32.patch b/dev-python/pygobject/files/pygobject-2.28.6-gio-types-2.32.patch new file mode 100644 index 0000000..fa0adf5 --- /dev/null +++ b/dev-python/pygobject/files/pygobject-2.28.6-gio-types-2.32.patch @@ -0,0 +1,50 @@ +From 42d01f060c5d764baa881d13c103d68897163a49 Mon Sep 17 00:00:00 2001 +From: Ryan Lortie +Date: Mon, 12 Mar 2012 16:44:14 -0400 +Subject: [PATCH] gio-types.defs: change some enums to flags + +These flags types were originally incorrectly handled in glib as being +enums. That bug was fixed, but they're still enums here, leading to +warnings about the mismatch. + +Change them to flags. + +https://bugzilla.gnome.org/show_bug.cgi?id=668522 +--- + gio/gio-types.defs | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/gio/gio-types.defs b/gio/gio-types.defs +index 331e0bc..7eee5c8 100644 +--- a/gio/gio-types.defs ++++ b/gio/gio-types.defs +@@ -526,7 +526,7 @@ + ) + ) + +-(define-enum MountMountFlags ++(define-flags MountMountFlags + (in-module "gio") + (c-name "GMountMountFlags") + (gtype-id "G_TYPE_MOUNT_MOUNT_FLAGS") +@@ -545,7 +545,7 @@ + ) + ) + +-(define-enum DriveStartFlags ++(define-flags DriveStartFlags + (in-module "gio") + (c-name "GDriveStartFlags") + (gtype-id "G_TYPE_DRIVE_START_FLAGS") +@@ -770,7 +770,7 @@ + ) + ) + +-(define-enum SocketMsgFlags ++(define-flags SocketMsgFlags + (in-module "gio") + (c-name "GSocketMsgFlags") + (gtype-id "G_TYPE_SOCKET_MSG_FLAGS") +-- +1.7.8.5 + diff --git a/dev-python/pygobject/files/pygobject-2.28.6-glib-2.36-class_init.patch b/dev-python/pygobject/files/pygobject-2.28.6-glib-2.36-class_init.patch new file mode 100644 index 0000000..b2f9b14 --- /dev/null +++ b/dev-python/pygobject/files/pygobject-2.28.6-glib-2.36-class_init.patch @@ -0,0 +1,315 @@ +From 9456ba70fdb98b3a4eb7ee2f630182387a54ca00 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Tue, 19 Feb 2013 15:39:56 +0100 +Subject: [PATCH] Move property and signal creation into _class_init() + +We must not add class interfaces after g_type_class_ref() has been called the +first time. Move signal and property creation from pyg_type_register() into +pyg_object_class_init(), and drop the hack of registering interfaces twice. + +This is a backport of commit efcb0f9fd for 2.28.x. This allows old pygtk +applications to work with pygobject 2.28.x and glib 2.35.x. + +https://bugzilla.gnome.org/show_bug.cgi?id=694108 +--- + gobject/gobjectmodule.c | 177 +++++++++++++++++++----------------------------- + 1 file changed, 70 insertions(+), 107 deletions(-) + +diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c +index 2a84606..91f7315 100644 +--- a/gobject/gobjectmodule.c ++++ b/gobject/gobjectmodule.c +@@ -312,13 +312,6 @@ pyg_object_get_property (GObject *object, guint property_id, + pyglib_gil_state_release(state); + } + +-static void +-pyg_object_class_init(GObjectClass *class, PyObject *py_class) +-{ +- class->set_property = pyg_object_set_property; +- class->get_property = pyg_object_get_property; +-} +- + typedef struct _PyGSignalAccumulatorData { + PyObject *callable; + PyObject *user_data; +@@ -484,15 +477,14 @@ override_signal(GType instance_type, const gchar *signal_name) + } + + static PyObject * +-add_signals (GType instance_type, PyObject *signals) ++add_signals (GObjectClass *klass, PyObject *signals) + { + gboolean ret = TRUE; +- GObjectClass *oclass; + Py_ssize_t pos = 0; + PyObject *key, *value, *overridden_signals = NULL; ++ GType instance_type = G_OBJECT_CLASS_TYPE (klass); + + overridden_signals = PyDict_New(); +- oclass = g_type_class_ref(instance_type); + while (PyDict_Next(signals, &pos, &key, &value)) { + const gchar *signal_name; + gchar *signal_name_canon, *c; +@@ -530,7 +522,6 @@ add_signals (GType instance_type, PyObject *signals) + if (!ret) + break; + } +- g_type_class_unref(oclass); + if (ret) + return overridden_signals; + else { +@@ -800,14 +791,12 @@ pyg_param_spec_from_object (PyObject *tuple) + } + + static gboolean +-add_properties (GType instance_type, PyObject *properties) ++add_properties (GObjectClass *klass, PyObject *properties) + { + gboolean ret = TRUE; +- GObjectClass *oclass; + Py_ssize_t pos = 0; + PyObject *key, *value; + +- oclass = g_type_class_ref(instance_type); + while (PyDict_Next(properties, &pos, &key, &value)) { + const gchar *prop_name; + GType prop_type; +@@ -873,7 +862,7 @@ add_properties (GType instance_type, PyObject *properties) + Py_DECREF(slice); + + if (pspec) { +- g_object_class_install_property(oclass, 1, pspec); ++ g_object_class_install_property(klass, 1, pspec); + } else { + PyObject *type, *value, *traceback; + ret = FALSE; +@@ -883,7 +872,7 @@ add_properties (GType instance_type, PyObject *properties) + g_snprintf(msg, 256, + "%s (while registering property '%s' for GType '%s')", + PYGLIB_PyUnicode_AsString(value), +- prop_name, g_type_name(instance_type)); ++ prop_name, G_OBJECT_CLASS_NAME(klass)); + Py_DECREF(value); + value = PYGLIB_PyUnicode_FromString(msg); + } +@@ -892,11 +881,63 @@ add_properties (GType instance_type, PyObject *properties) + } + } + +- g_type_class_unref(oclass); + return ret; + } + + static void ++pyg_object_class_init(GObjectClass *class, PyObject *py_class) ++{ ++ PyObject *gproperties, *gsignals, *overridden_signals; ++ PyObject *class_dict = ((PyTypeObject*) py_class)->tp_dict; ++ ++ class->set_property = pyg_object_set_property; ++ class->get_property = pyg_object_get_property; ++ ++ /* install signals */ ++ /* we look this up in the instance dictionary, so we don't ++ * accidentally get a parent type's __gsignals__ attribute. */ ++ gsignals = PyDict_GetItemString(class_dict, "__gsignals__"); ++ if (gsignals) { ++ if (!PyDict_Check(gsignals)) { ++ PyErr_SetString(PyExc_TypeError, ++ "__gsignals__ attribute not a dict!"); ++ return; ++ } ++ if (!(overridden_signals = add_signals(class, gsignals))) { ++ return; ++ } ++ if (PyDict_SetItemString(class_dict, "__gsignals__", ++ overridden_signals)) { ++ return; ++ } ++ Py_DECREF(overridden_signals); ++ ++ PyDict_DelItemString(class_dict, "__gsignals__"); ++ } else { ++ PyErr_Clear(); ++ } ++ ++ /* install properties */ ++ /* we look this up in the instance dictionary, so we don't ++ * accidentally get a parent type's __gproperties__ attribute. */ ++ gproperties = PyDict_GetItemString(class_dict, "__gproperties__"); ++ if (gproperties) { ++ if (!PyDict_Check(gproperties)) { ++ PyErr_SetString(PyExc_TypeError, ++ "__gproperties__ attribute not a dict!"); ++ return; ++ } ++ if (!add_properties(class, gproperties)) { ++ return; ++ } ++ PyDict_DelItemString(class_dict, "__gproperties__"); ++ /* Borrowed reference. Py_DECREF(gproperties); */ ++ } else { ++ PyErr_Clear(); ++ } ++} ++ ++static void + pyg_register_class_init(GType gtype, PyGClassInitFunc class_init) + { + GSList *list; +@@ -1068,7 +1109,7 @@ pygobject__g_instance_init(GTypeInstance *instance, + */ + static void + pyg_type_add_interfaces(PyTypeObject *class, GType instance_type, +- PyObject *bases, gboolean new_interfaces, ++ PyObject *bases, + GType *parent_interfaces, guint n_parent_interfaces) + { + int i; +@@ -1082,7 +1123,6 @@ pyg_type_add_interfaces(PyTypeObject *class, GType instance_type, + guint k; + PyObject *base = PyTuple_GET_ITEM(bases, i); + GType itype; +- gboolean is_new = TRUE; + const GInterfaceInfo *iinfo; + GInterfaceInfo iinfo_copy; + +@@ -1099,16 +1139,6 @@ pyg_type_add_interfaces(PyTypeObject *class, GType instance_type, + if (!G_TYPE_IS_INTERFACE(itype)) + continue; + +- for (k = 0; k < n_parent_interfaces; ++k) { +- if (parent_interfaces[k] == itype) { +- is_new = FALSE; +- break; +- } +- } +- +- if ((new_interfaces && !is_new) || (!new_interfaces && is_new)) +- continue; +- + iinfo = pyg_lookup_interface_info(itype); + if (!iinfo) { + gchar *error; +@@ -1129,7 +1159,7 @@ pyg_type_add_interfaces(PyTypeObject *class, GType instance_type, + int + pyg_type_register(PyTypeObject *class, const char *type_name) + { +- PyObject *gtype, *gsignals, *gproperties, *overridden_signals; ++ PyObject *gtype; + GType parent_type, instance_type; + GType *parent_interfaces; + guint n_parent_interfaces; +@@ -1216,88 +1246,22 @@ pyg_type_register(PyTypeObject *class, const char *type_name) + } + + /* +- * Note: Interfaces to be implemented are searched twice. First +- * we register interfaces that are already implemented by a parent +- * type. The second time, the remaining interfaces are +- * registered, i.e. the ones that are not implemented by a parent +- * type. In between these two loops, properties and signals are +- * registered. It has to be done this way, in two steps, +- * otherwise glib will complain. If registering all interfaces +- * always before properties, you get an error like: +- * +- * ../gobject:121: Warning: Object class +- * test_interface+MyObject doesn't implement property +- * 'some-property' from interface 'TestInterface' +- * +- * If, on the other hand, you register interfaces after +- * registering the properties, you get something like: +- * +- * ../gobject:121: Warning: cannot add interface type +- * `TestInterface' to type `test_interface+MyUnknown', since +- * type `test_interface+MyUnknown' already conforms to +- * interface +- * +- * This looks like a GLib quirk, but no bug has been filed +- * upstream. However we have a unit test for this particular +- * problem, which can be found in test_interfaces.py, class +- * TestInterfaceImpl. ++ * Note, all interfaces need to be registered before the first ++ * g_type_class_ref(), see bug #686149. + * + * See also comment above pyg_type_add_interfaces(). + */ +- pyg_type_add_interfaces(class, instance_type, class->tp_bases, FALSE, ++ pyg_type_add_interfaces(class, instance_type, class->tp_bases, + parent_interfaces, n_parent_interfaces); + +- /* we look this up in the instance dictionary, so we don't +- * accidentally get a parent type's __gsignals__ attribute. */ +- gsignals = PyDict_GetItemString(class->tp_dict, "__gsignals__"); +- if (gsignals) { +- if (!PyDict_Check(gsignals)) { +- PyErr_SetString(PyExc_TypeError, +- "__gsignals__ attribute not a dict!"); +- g_free(parent_interfaces); +- return -1; +- } +- if (!(overridden_signals = add_signals(instance_type, gsignals))) { +- g_free(parent_interfaces); +- return -1; +- } +- if (PyDict_SetItemString(class->tp_dict, "__gsignals__", +- overridden_signals)) { +- g_free(parent_interfaces); +- return -1; +- } +- Py_DECREF(overridden_signals); +- } else { +- PyErr_Clear(); +- } + +- /* we look this up in the instance dictionary, so we don't +- * accidentally get a parent type's __gsignals__ attribute. */ +- gproperties = PyDict_GetItemString(class->tp_dict, "__gproperties__"); +- if (gproperties) { +- if (!PyDict_Check(gproperties)) { +- PyErr_SetString(PyExc_TypeError, +- "__gproperties__ attribute not a dict!"); +- g_free(parent_interfaces); +- return -1; +- } +- if (!add_properties(instance_type, gproperties)) { +- g_free(parent_interfaces); +- return -1; +- } +- PyDict_DelItemString(class->tp_dict, "__gproperties__"); +- /* Borrowed reference. Py_DECREF(gproperties); */ +- } else { +- PyErr_Clear(); ++ gclass = g_type_class_ref(instance_type); ++ if (PyErr_Occurred() != NULL) { ++ g_type_class_unref(gclass); ++ g_free(parent_interfaces); ++ return -1; + } + +- /* Register new interfaces, that are _not_ already defined by +- * the parent type. FIXME: See above. +- */ +- pyg_type_add_interfaces(class, instance_type, class->tp_bases, TRUE, +- parent_interfaces, n_parent_interfaces); +- +- gclass = g_type_class_ref(instance_type); + if (pyg_run_class_init(instance_type, gclass, class)) { + g_type_class_unref(gclass); + g_free(parent_interfaces); +@@ -1306,9 +1270,8 @@ pyg_type_register(PyTypeObject *class, const char *type_name) + g_type_class_unref(gclass); + g_free(parent_interfaces); + +- if (gsignals) +- PyDict_DelItemString(class->tp_dict, "__gsignals__"); +- ++ if (PyErr_Occurred() != NULL) ++ return -1; + return 0; + } + +-- +1.8.3.2 + diff --git a/dev-python/pygobject/files/pygobject-2.28.6-python-byte-compile.patch b/dev-python/pygobject/files/pygobject-2.28.6-python-byte-compile.patch new file mode 100644 index 0000000..d8941d1 --- /dev/null +++ b/dev-python/pygobject/files/pygobject-2.28.6-python-byte-compile.patch @@ -0,0 +1,24 @@ +diff --git a/codegen/Makefile.am b/codegen/Makefile.am +index d714ff2..c2702b1 100644 +--- a/codegen/Makefile.am ++++ b/codegen/Makefile.am +@@ -4,7 +4,7 @@ bin_SCRIPTS = pygobject-codegen-$(PLATFORM_VERSION) + + codegendir = $(pyexecdir)/gtk-2.0/codegen + +-codegen_SCRIPTS = \ ++codegen_PYTHON = \ + code-coverage.py \ + codegen.py \ + createdefs.py \ +@@ -17,9 +17,7 @@ codegen_SCRIPTS = \ + missingdefs.py \ + mkskel.py \ + scanvirtuals.py \ +- scmexpr.py +- +-codegen_PYTHON = \ ++ scmexpr.py \ + __init__.py \ + argtypes.py \ + definitions.py \ diff --git a/dev-python/pygobject/files/pygobject-2.28.6-set_qdata.patch b/dev-python/pygobject/files/pygobject-2.28.6-set_qdata.patch new file mode 100644 index 0000000..55376b5 --- /dev/null +++ b/dev-python/pygobject/files/pygobject-2.28.6-set_qdata.patch @@ -0,0 +1,28 @@ +From 42d871eb0b08ee6d55e95cc7e4b90844919555b9 Mon Sep 17 00:00:00 2001 +From: Ivan Stankovic +Date: Tue, 21 Feb 2012 12:24:58 +0100 +Subject: [PATCH] Fix set_qdata warning on accessing NULL gobject property + +https://bugzilla.gnome.org/show_bug.cgi?id=661155 +--- + gobject/pygobject.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/gobject/pygobject.c b/gobject/pygobject.c +index 6c2f06c..70dc89a 100644 +--- a/gobject/pygobject.c ++++ b/gobject/pygobject.c +@@ -991,7 +991,9 @@ pygobject_new(GObject *obj) + PyObject * + pygobject_new_sunk(GObject *obj) + { +- g_object_set_qdata (obj, pygobject_ref_sunk_key, GINT_TO_POINTER (1)); ++ if (obj) ++ g_object_set_qdata (obj, pygobject_ref_sunk_key, GINT_TO_POINTER (1)); ++ + return pygobject_new_full(obj, TRUE, NULL); + } + +-- +1.7.8.5 + diff --git a/dev-python/pygobject/files/pygobject-2.28.6-tests-no-introspection.patch b/dev-python/pygobject/files/pygobject-2.28.6-tests-no-introspection.patch new file mode 100644 index 0000000..d7e0c68 --- /dev/null +++ b/dev-python/pygobject/files/pygobject-2.28.6-tests-no-introspection.patch @@ -0,0 +1,33 @@ +From 9c8ec7495e9e73855dc284be293828572f408c92 Mon Sep 17 00:00:00 2001 +From: Alexandre Rostovtsev +Date: Tue, 25 Dec 2012 00:26:05 -0500 +Subject: [PATCH] Do not run introspection tests when building with + introspection disabled + +--- + tests/Makefile.am | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index e60bad5..3a0d1b7 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -120,9 +120,14 @@ RUN_TESTS_ENV_VARS= \ + RUN_TESTS_LAUNCH=$(RUN_TESTS_ENV_VARS) $(DBUS_LAUNCH) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py + + # run tests in separately to avoid loading static and introspection bindings in the same process +-check-local: $(check_LTLIBRARIES:.la=.so) Regress-1.0.typelib GIMarshallingTests-1.0.typelib gschemas.compiled ++if ENABLE_INTROSPECTION ++CHECK_LOCAL_INTROSPECTION_REQ = Regress-1.0.typelib GIMarshallingTests-1.0.typelib gschemas.compiled ++endif ++check-local: $(check_LTLIBRARIES:.la=.so) $(CHECK_LOCAL_INTROSPECTION_REQ) + TEST_FILES="$(TEST_FILES_STATIC)" $(RUN_TESTS_LAUNCH) ++if ENABLE_INTROSPECTION + TEST_FILES="$(TEST_FILES_GI)" $(RUN_TESTS_LAUNCH) ++endif + if BUILD_GIO + TEST_FILES="$(TEST_FILES_GIO)" $(RUN_TESTS_LAUNCH) + endif +-- +1.8.0.2 + diff --git a/dev-python/pygobject/pygobject-2.28.6-r56.ebuild b/dev-python/pygobject/pygobject-2.28.6-r56.ebuild new file mode 100644 index 0000000..dfb017b --- /dev/null +++ b/dev-python/pygobject/pygobject-2.28.6-r56.ebuild @@ -0,0 +1,141 @@ +# Copyright © 2020 Nick Bowler +# +# License GPLv2+: GNU General Public License version 2 or any later version. +# This is free software: you are free to change and redistribute it. +# There is NO WARRANTY, to the extent permitted by law. +# +# This is a modified version of the original ebuild from Gentoo GNU/Linux, +# covered by the following copyright and permission notice: +# +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +GNOME2_LA_PUNT=yes +GNOME2_EAUTORECONF=yes + +PYTHON_COMPAT=( python2_7 ) + +inherit autotools eutils gnome2 python-r1 virtualx + +DESCRIPTION="GLib's GObject library bindings for Python" +HOMEPAGE="http://www.pygtk.org/" + +LICENSE="LGPL-2.1+" +SLOT="2" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris" +IUSE="examples libffi test" +RESTRICT="!test? ( test )" +REQUIRED_USE=$PYTHON_REQUIRED_USE + +BDEPEND="virtual/pkgconfig + dev-util/gtk-doc-am" + +RDEPEND=">=dev-libs/glib-2.24.0:2 + dev-lang/python-exec:2 + libffi? ( dev-libs/libffi:= ) + ! +Date: Tue, 27 Sep 2011 04:17:52 +0000 +Subject: Fix leaks of Pango objects + +Gtk.PrintContext.create_pango_context() +Gtk.PrintContext.create_pango_layout() +pangocairo.CairoContext.create_layout() + +were leaking the objects they returned. + +https://bugzilla.gnome.org/show_bug.cgi?id=660216 +--- +diff --git a/gtk/gtk-2.10.defs b/gtk/gtk-2.10.defs +index 69c7e0c..faa45e1 100644 +--- a/gtk/gtk-2.10.defs ++++ b/gtk/gtk-2.10.defs +@@ -1388,12 +1388,14 @@ + (define-method create_pango_context + (of-object "GtkPrintContext") + (c-name "gtk_print_context_create_pango_context") ++ (caller-owns-return #t) + (return-type "PangoContext*") + ) + + (define-method create_pango_layout + (of-object "GtkPrintContext") + (c-name "gtk_print_context_create_pango_layout") ++ (caller-owns-return #t) + (return-type "PangoLayout*") + ) + +diff --git a/pangocairo.override b/pangocairo.override +index bb923e6..5101107 100644 +--- a/pangocairo.override ++++ b/pangocairo.override +@@ -118,11 +118,16 @@ _wrap_pango_cairo_update_context(PyGObject *self, PyObject *args, PyObject *kwar + static PyObject * + _wrap_pango_cairo_create_layout(PyGObject *self) + { +- PangoLayout *ret; ++ PangoLayout *layout; ++ PyObject *ret; + +- ret = pango_cairo_create_layout(PycairoContext_GET(self)); ++ layout = pango_cairo_create_layout(PycairoContext_GET(self)); + /* pygobject_new handles NULL checking */ +- return pygobject_new((GObject *)ret); ++ ret = pygobject_new((GObject *)layout); ++ if (layout) ++ g_object_unref(layout); ++ ++ return ret; + } + + static PyObject * +-- +cgit v0.9.2 diff --git a/dev-python/pygtk/files/pygtk-2.24.0-pango-1.44.patch b/dev-python/pygtk/files/pygtk-2.24.0-pango-1.44.patch new file mode 100644 index 0000000..b4ed200 --- /dev/null +++ b/dev-python/pygtk/files/pygtk-2.24.0-pango-1.44.patch @@ -0,0 +1,41 @@ +From 4aaa48eb80c6802aec6d03e5695d2a0ff20e0fc2 Mon Sep 17 00:00:00 2001 +From: Jordan Petridis +Date: Thu, 24 Oct 2019 22:58:36 +0200 +Subject: [PATCH] Drop the PangoFont find_shaper virtual method + +This API has been removed from Pango 1.44.6, because it was completely +unused by anything. + +However, PyGTK tries to bind everything, even unused API. + +Removing this from PyGTK means we can build it against the latest Pango +again. + +https://gitlab.gnome.org/GNOME/pango/issues/417 +--- + pango.defs | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/pango.defs b/pango.defs +index 6935c964..da968f58 100644 +--- a/pango.defs ++++ b/pango.defs +@@ -1391,15 +1391,6 @@ + ) + ) + +-(define-virtual find_shaper +- (of-object "PangoFont") +- (return-type "PangoEngineShape*") +- (parameters +- '("PangoLanguage*" "lang") +- '("guint32" "ch") +- ) +-) +- + (define-virtual get_glyph_extents + (of-object "PangoFont") + (return-type "none") +-- +2.24.1 + diff --git a/dev-python/pygtk/files/pygtk-2.24.0-quartz-objc.patch b/dev-python/pygtk/files/pygtk-2.24.0-quartz-objc.patch new file mode 100644 index 0000000..828057e --- /dev/null +++ b/dev-python/pygtk/files/pygtk-2.24.0-quartz-objc.patch @@ -0,0 +1,45 @@ +From: Anders F Bjorklund +Date: Mon, 4 Apr 2011 21:34:20 +0200 +Subject: [PATCH] use objective-c for quartz + +https://bugzilla.gnome.org/show_bug.cgi?id=646743 +--- + configure.ac | 5 +++++ + gtk/Makefile.am | 5 +++++ + 2 files changed, 10 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 84c78f6c..27192f9c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -445,6 +445,11 @@ case $gdk_target in + ;; + esac + ++if test "x$gdk_target" = "xquartz"; then ++ AM_CONDITIONAL(USE_QUARTZ, true) ++else ++ AM_CONDITIONAL(USE_QUARTZ, false) ++fi + + dnl checks to see if numpy is installed. + AC_ARG_ENABLE(numpy, +diff --git a/gtk/Makefile.am b/gtk/Makefile.am +index 7bb5d0c8..44d68700 100644 +--- a/gtk/Makefile.am ++++ b/gtk/Makefile.am +@@ -9,6 +9,11 @@ INCLUDES = \ + $(PYGOBJECT_CFLAGS) \ + -I$(srcdir)/gtk + ++if USE_QUARTZ ++# same as in gtk+/gdk/quartz/Makefile.am ++INCLUDES += "-xobjective-c" ++endif ++ + # defs files + defsdir = $(pkgdatadir)/$(PLATFORM_VERSION)/defs + defs_DATA = +-- +2.12.0 + diff --git a/dev-python/pygtk/files/pygtk-2.24.0-test-fail.patch b/dev-python/pygtk/files/pygtk-2.24.0-test-fail.patch new file mode 100644 index 0000000..a02b550 --- /dev/null +++ b/dev-python/pygtk/files/pygtk-2.24.0-test-fail.patch @@ -0,0 +1,9 @@ +--- a/tests/runtests.py ++++ b/tests/runtests.py +@@ -41,4 +41,5 @@ + suite.addTest(loader.loadTestsFromName(name)) + + testRunner = unittest.TextTestRunner() +-testRunner.run(suite) ++result = testRunner.run(suite) ++sys.exit(not result.wasSuccessful()) diff --git a/dev-python/pygtk/files/pygtk-2.24.0-test_dialog.patch b/dev-python/pygtk/files/pygtk-2.24.0-test_dialog.patch new file mode 100644 index 0000000..832007a --- /dev/null +++ b/dev-python/pygtk/files/pygtk-2.24.0-test_dialog.patch @@ -0,0 +1,28 @@ +From eb92ecdfe7e310499743a5686560e18bb48ef0f0 Mon Sep 17 00:00:00 2001 +From: Alexandre Rostovtsev +Date: Wed, 2 Oct 2013 14:51:20 -0400 +Subject: [PATCH] tests: fix MessageDialogTest.testSubclass + +Don't check sub.__gtype__ until we set sub + +https://bugzilla.gnome.org/show_bug.cgi?id=709304 +--- + tests/test_dialog.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_dialog.py b/tests/test_dialog.py +index a6a3ce5..6540be3 100644 +--- a/tests/test_dialog.py ++++ b/tests/test_dialog.py +@@ -20,7 +20,7 @@ class MessageDialogTest(unittest.TestCase): + print sub.__gtype__.name + self.assertEqual(sub.__gtype__.name, 'GtkMessageDialog') + +- type('Sub', (gtk.MessageDialog,), {'__gtype_name__': 'SubDialog'}) ++ sub = type('Sub', (gtk.MessageDialog,), {'__gtype_name__': 'SubDialog'}) + self.assertEqual(sub.__gtype__.name, 'SubDialog') + + def testDialogLeak(self): +-- +1.8.3.2 + diff --git a/dev-python/pygtk/pygtk-2.24.0-r5.ebuild b/dev-python/pygtk/pygtk-2.24.0-r5.ebuild new file mode 100644 index 0000000..c23bff3 --- /dev/null +++ b/dev-python/pygtk/pygtk-2.24.0-r5.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +GNOME_TARBALL_SUFFIX="bz2" + +PYTHON_COMPAT=( python2_7 ) + +inherit autotools flag-o-matic gnome2 python-r1 virtualx + +DESCRIPTION="GTK+2 bindings for Python" +HOMEPAGE="https://gitlab.gnome.org/Archive/pygtk" + +LICENSE="LGPL-2.1" +SLOT="2" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ~ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris" +IUSE="doc examples test" +REQUIRED_USE=$PYTHON_REQUIRED_USE + +RESTRICT="!test? ( test )" + +RDEPEND="${PYTHON_DEPS} + >=dev-libs/glib-2.8:2 + >=x11-libs/pango-1.16 + >=dev-libs/atk-1.12 + >=x11-libs/gtk+-2.24:2 + >=dev-python/pycairo-1.0.2:2[$PYTHON_USEDEP] + >=dev-python/pygobject-2.26.8-r53:2[$PYTHON_USEDEP] + >=gnome-base/libglade-2.5:2.0 +" +DEPEND="${RDEPEND} + virtual/pkgconfig + doc? ( + dev-libs/libxslt + >=app-text/docbook-xsl-stylesheets-1.70.1 ) +" + +PATCHES=( + # Fix declaration of codegen in .pc + "${FILESDIR}/${PN}-2.13.0-fix-codegen-location.patch" + "${FILESDIR}/${PN}-2.14.1-libdir-pc.patch" + # Fix leaks of Pango objects + "${FILESDIR}/${PN}-2.24.0-fix-leaks.patch" + # Fail when tests are failing, bug #391307 + "${FILESDIR}/${PN}-2.24.0-test-fail.patch" + # Fix broken tests, https://bugzilla.gnome.org/show_bug.cgi?id=709304 + "${FILESDIR}/${P}-test_dialog.patch" + # Fix build on Darwin + "${FILESDIR}/${PN}-2.24.0-quartz-objc.patch" + # x11-libs/pango-1.44 + "${FILESDIR}/${PN}-2.24.0-pango-1.44.patch" +) + +src_prepare() { + default + + # Examples is handled "manually" + sed -e 's/\(SUBDIRS = .* \)examples/\1/' \ + -i Makefile.am Makefile.in || die + + sed -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \ + -i configure.ac || die #466968 + + AT_M4DIR="m4" eautoreconf + + prepare_pygtk() { + mkdir -p "${BUILD_DIR}" || die + } + python_foreach_impl prepare_pygtk +} + +src_configure() { + use hppa && append-flags -ffunction-sections + configure_pygtk() { + ECONF_SOURCE="${S}" gnome2_src_configure \ + $(use_enable doc docs) \ + --disable-numpy \ + --with-glade \ + --enable-thread + } + python_foreach_impl run_in_build_dir configure_pygtk +} + +src_compile() { + python_foreach_impl run_in_build_dir gnome2_src_compile +} + +src_test() { + # Let tests pass without permissions problems, bug #245103 + gnome2_environment_reset + unset DBUS_SESSION_BUS_ADDRESS + + testing() { + cd tests + virtx emake check-local + } + python_foreach_impl run_in_build_dir testing +} + +src_install() { + dodoc AUTHORS ChangeLog INSTALL MAPPING NEWS README THREADS TODO + + if use examples; then + rm examples/Makefile* || die + dodoc -r examples + fi + + python_foreach_impl run_in_build_dir gnome2_src_install + find "${D}" -name '*.la' -type f -delete || die +}