diff options
Diffstat (limited to 'dev-python/pygobject')
-rw-r--r-- | dev-python/pygobject/Manifest | 2 | ||||
-rw-r--r-- | dev-python/pygobject/files/pygobject-3.40.1-dynamicimporter-py310.patch | 63 | ||||
-rw-r--r-- | dev-python/pygobject/pygobject-3.40.1-r1.ebuild | 78 |
3 files changed, 143 insertions, 0 deletions
diff --git a/dev-python/pygobject/Manifest b/dev-python/pygobject/Manifest index 35c26254cf66..7440c2cfdadc 100644 --- a/dev-python/pygobject/Manifest +++ b/dev-python/pygobject/Manifest @@ -1,7 +1,9 @@ +AUX pygobject-3.40.1-dynamicimporter-py310.patch 1785 BLAKE2B 5c1779972f3e44a711465bd7b0138f0945118e39d566a7721b71e890756f41d10ea5af1864af40d667b195c5d3658f9cd982b93e18a6784289a5ecb3df2f9678 SHA512 4794c6dd097cd708614ef1e34f0a324bc7b607d66cb05c4025492fd64b7f165c1da10650ff9067f0b9342955643ff6c9519082ec3ff5abc83025b10fe45d9e48 DIST pygobject-3.38.0.tar.xz 553892 BLAKE2B d6add416c3f87ee9d5a56f30dbcaa599682ec5932b204f7c743d50475503ea2705e7943e6a93610d6f1c9d322723d1df6ea0f19c1cf245b2ca7d49395ca36170 SHA512 d63313dea2c143cf8c08a4678f1aa8e5908d503ad29c596eeb9fa1070e1231de57cf934c33031f9c4920b85e391f3b4143b46491ffd16e04e8d48871cb05e5df DIST pygobject-3.40.0.tar.xz 555920 BLAKE2B e7b3fa926066ddc6992c3087a582e25207ffb34f5c847be705953d8498f307661822462ceaa6362d120e96556a50882ed78540fce5cd2e97f0a4fd11232fe01c SHA512 c0c617e5678f942db33bdff6e149e438bd7d5f4e0a4e0a112476515d1face1c6e992457f998a5077a08bdacc1bda24711b29a4312bd3ee825b526d54a7ca3db7 DIST pygobject-3.40.1.tar.xz 556104 BLAKE2B e6a092bee68121d9ef82f41f21c9811f384b8578c48de445f707f1b0de124cf38d899d34b8f4269a154ebd4e323afdfa7afef5c0c5cc5dc451b2cd68b30da04b SHA512 a8350f43ea99c93aa66a23102d4ee2ca3c7f8ec2c8bcf5cd142dd097b4fb38167f1713efff3584aa323c34656c911fb940e462c83c02b107e4aad93d005022f7 EBUILD pygobject-3.38.0.ebuild 1750 BLAKE2B 5e9fb1c304867db80e8abd422d6a2acc73cc04d04e5183d6aa6be9e5dea7a1026d9e5888d389eea628dce8fea026363dfea8325f2d971a33a0861ae3b490f6ef SHA512 aad5d9bbbc022fa21b3491eedd9237bb125387639031c2a9897cbc1d7afa6f6f26d435612a73486e157d56000a1011ea80b215ed5e68753ca432eaa07f1a4b68 EBUILD pygobject-3.40.0.ebuild 1758 BLAKE2B a85eceb3d69edb260372851136bdc829bb67f7d2808e738af42f5a7d2bdd859c6b793259ede2ddf7b0218d2ba5027ab778749f3d8482aacb845bc020639dfe86 SHA512 43a99bc52d4fd93c4225b6acbe998fd506ed7abaccdacb0b8f5628bc1aa9e5cba05dda44856279856f20db9ab67672a2b941a32be7b9ec1b2f4a76b6442a8345 +EBUILD pygobject-3.40.1-r1.ebuild 1825 BLAKE2B 874ebd24bf0d966afcb38a254db85f34d8b2a015d2c5e7defdfabe561af2d01cc36963171bf5f49e4f952987f15c52785086d417caaa139977ecf7f230823abf SHA512 95b9d27a7eeb6428aba7d20bdd4c4bf6d36b06492244a1d41539768ffd3e1a636c9de3817f4939bc2b02b64a6c470de00117a7074cf90f32434823cc5b8a14a7 EBUILD pygobject-3.40.1.ebuild 1759 BLAKE2B 66a6d8aca77da2fc35a9b0a988eaefac284ddde2377407d6edf04b7342d6b14709157b3dc432f9ed5b80a3e47cdccfd31a63cfea07df0e1c0423fcf2c056ab28 SHA512 d869ac8ca451dcc1355beae9c84147ef42ee56ee60683eb21d23a64d7992842c0880bf4462dcc99b9b2a2199d4201a058bbc112ac7b189cdfb568ab40fddd7e1 MISC metadata.xml 1292 BLAKE2B ba52782219669d3f01ff1befd8ddcd445c36ac0af2f9e4125ca4fedca7c01665282485b9457b189689c80d4db55de9316ee2dfc19d06340c23a6f00e08e92213 SHA512 7aaf7a98227e36a6d556f225161eecbc43140736f3e79583694d131e99218f887aa6cfdb9991d6fb041bba6e7df2318e65e8cdf181d97bc41301aac6f040df48 diff --git a/dev-python/pygobject/files/pygobject-3.40.1-dynamicimporter-py310.patch b/dev-python/pygobject/files/pygobject-3.40.1-dynamicimporter-py310.patch new file mode 100644 index 000000000000..341a096767b6 --- /dev/null +++ b/dev-python/pygobject/files/pygobject-3.40.1-dynamicimporter-py310.patch @@ -0,0 +1,63 @@ +From 1ae65be0f7e621002e2e29921e0252c1b57a170c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Sun, 20 Jun 2021 17:54:52 +0200 +Subject: [PATCH] Implement PEP451 semantics for DynamicImporter + +Make DynamicImporter PEP451-compliant in order to silence ImportWarnings +in Python 3.10. This is mostly based on six._SixMetaPathImporter. + +Fixes #476 +--- + gi/importer.py | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/gi/importer.py b/gi/importer.py +index 32967974..006cf464 100644 +--- a/gi/importer.py ++++ b/gi/importer.py +@@ -24,6 +24,7 @@ + import sys + import warnings + import importlib ++import importlib.util + from contextlib import contextmanager + + import gi +@@ -103,6 +104,7 @@ def get_import_stacklevel(import_hook): + class DynamicImporter(object): + + # Note: see PEP302 for the Importer Protocol implemented below. ++ # PEP451 for A ModuleSpec Type for the Import System. + + def __init__(self, path): + self.path = path +@@ -117,6 +119,16 @@ class DynamicImporter(object): + + return self + ++ def find_spec(self, fullname, path, target=None): ++ if not fullname.startswith(self.path): ++ return None ++ ++ path, namespace = fullname.rsplit('.', 1) ++ if path != self.path: ++ return None ++ ++ return importlib.util.spec_from_loader(fullname, self) ++ + def load_module(self, fullname): + if fullname in sys.modules: + return sys.modules[fullname] +@@ -149,3 +161,9 @@ class DynamicImporter(object): + sys.modules[fullname] = dynamic_module + + return dynamic_module ++ ++ def create_module(self, spec): ++ return self.load_module(spec.name) ++ ++ def exec_module(self, module): ++ pass +-- +2.32.0 + diff --git a/dev-python/pygobject/pygobject-3.40.1-r1.ebuild b/dev-python/pygobject/pygobject-3.40.1-r1.ebuild new file mode 100644 index 000000000000..01f7b7055ebd --- /dev/null +++ b/dev-python/pygobject/pygobject-3.40.1-r1.ebuild @@ -0,0 +1,78 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7..10} ) + +inherit gnome.org meson python-r1 virtualx xdg + +DESCRIPTION="Python bindings for GObject Introspection" +HOMEPAGE="https://pygobject.readthedocs.io/" + +LICENSE="LGPL-2.1+" +SLOT="3" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris" +IUSE="+cairo examples test" +RESTRICT="!test? ( test )" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +RDEPEND="${PYTHON_DEPS} + >=dev-libs/glib-2.56:2 + >=dev-libs/gobject-introspection-1.56:= + dev-libs/libffi:= + cairo? ( + >=dev-python/pycairo-1.16.0[${PYTHON_USEDEP}] + x11-libs/cairo[glib] ) +" +DEPEND="${RDEPEND} + test? ( + dev-libs/atk[introspection] + dev-python/pytest[${PYTHON_USEDEP}] + x11-libs/gdk-pixbuf:2[introspection,jpeg] + x11-libs/gtk+:3[introspection] + x11-libs/pango[introspection] + ) +" +BDEPEND=" + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${P}-dynamicimporter-py310.patch +) + +src_configure() { + configuring() { + meson_src_configure \ + $(meson_feature cairo pycairo) \ + $(meson_use test tests) \ + -Dpython="${EPYTHON}" + } + + python_foreach_impl configuring +} + +src_compile() { + python_foreach_impl meson_src_compile +} + +src_test() { + local -x GIO_USE_VFS="local" # prevents odd issues with deleting ${T}/.gvfs + local -x GIO_USE_VOLUME_MONITOR="unix" # prevent udisks-related failures in chroots, bug #449484 + + testing() { + local -x XDG_CACHE_HOME="${T}/${EPYTHON}" + meson_src_test || die "test failed for ${EPYTHON}" + } + virtx python_foreach_impl testing +} + +src_install() { + installing() { + meson_src_install + python_optimize + } + python_foreach_impl installing + use examples && dodoc -r examples +} |