diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-09-25 20:21:45 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-09-25 20:21:45 +0100 |
commit | c719fdcee603a5a706a45d10cb598762d56a727d (patch) | |
tree | 620cbf137661399a3fb1eff92914204f9a970713 /dev-python/pygobject | |
parent | cc4618c9ba3d974948ebf340b542d8cb01db2f55 (diff) |
gentoo resync : 25.09.2021
Diffstat (limited to 'dev-python/pygobject')
-rw-r--r-- | dev-python/pygobject/Manifest | 3 | ||||
-rw-r--r-- | dev-python/pygobject/files/pygobject-3.42.0-dynamicimporter-py310.patch | 61 | ||||
-rw-r--r-- | dev-python/pygobject/pygobject-3.42.0.ebuild | 78 |
3 files changed, 142 insertions, 0 deletions
diff --git a/dev-python/pygobject/Manifest b/dev-python/pygobject/Manifest index f9cd5d1e5f14..bdde9d2d5b01 100644 --- a/dev-python/pygobject/Manifest +++ b/dev-python/pygobject/Manifest @@ -1,4 +1,7 @@ AUX pygobject-3.40.1-dynamicimporter-py310.patch 1785 BLAKE2B 5c1779972f3e44a711465bd7b0138f0945118e39d566a7721b71e890756f41d10ea5af1864af40d667b195c5d3658f9cd982b93e18a6784289a5ecb3df2f9678 SHA512 4794c6dd097cd708614ef1e34f0a324bc7b607d66cb05c4025492fd64b7f165c1da10650ff9067f0b9342955643ff6c9519082ec3ff5abc83025b10fe45d9e48 +AUX pygobject-3.42.0-dynamicimporter-py310.patch 2283 BLAKE2B f59cd749cea48343d0bf1c798c1b8d038c763c2cf3afd798030c7befe428427fe30d37c4dcbd5ffe8c9bbca18b3cb04fdae464867262e489075a254c9ac29fc5 SHA512 2ab000c63386eb986cd396e6c51054482d06923f279021d04e9674f16e17cbfea00a8f0750c8cd05d04db0a07a35e5f2739aec7040372b039ae86971e636d96c DIST pygobject-3.40.1.tar.xz 556104 BLAKE2B e6a092bee68121d9ef82f41f21c9811f384b8578c48de445f707f1b0de124cf38d899d34b8f4269a154ebd4e323afdfa7afef5c0c5cc5dc451b2cd68b30da04b SHA512 a8350f43ea99c93aa66a23102d4ee2ca3c7f8ec2c8bcf5cd142dd097b4fb38167f1713efff3584aa323c34656c911fb940e462c83c02b107e4aad93d005022f7 +DIST pygobject-3.42.0.tar.xz 557060 BLAKE2B 25c0634dcb713f4059d19ff2efdd67004e1343f49982123686f4df71fc2678583244dab7a22160f42d5361c3e5c6e38bcd8ccaeeafb3e1d885e5d5febaa9dde1 SHA512 2f3e9187cb8dd7ccbf139a58ea348732fc7cb95dbf4bee2ba8f78003a7540d90c0b29153d93f50bf613c2d43f0de0ec8971c61c358d48552e42ce17775a178dd EBUILD pygobject-3.40.1-r1.ebuild 1817 BLAKE2B d8029762266f8a60b3e6aac7293cc554691cad39401f150e020e65c1fc459141aeb0d3cd9183a1769ff1c8ef1b5342b0079dab7b6f4aa4dac8a02c1afafccd15 SHA512 bb999c619c68775b7eb936ea25344ade7c970ef002b75d0a643aa76c84febd1f7766d8a2e41dbc17530501d3cdc3edd3fd296db4fb9d5c080143ff80133e83fd +EBUILD pygobject-3.42.0.ebuild 1825 BLAKE2B 874ebd24bf0d966afcb38a254db85f34d8b2a015d2c5e7defdfabe561af2d01cc36963171bf5f49e4f952987f15c52785086d417caaa139977ecf7f230823abf SHA512 95b9d27a7eeb6428aba7d20bdd4c4bf6d36b06492244a1d41539768ffd3e1a636c9de3817f4939bc2b02b64a6c470de00117a7074cf90f32434823cc5b8a14a7 MISC metadata.xml 1293 BLAKE2B f47bd4d3e2239697d3684223a8dcfed77c3af429414f6bbbcd6e37d1707d38796fc1ab6ba01402442dbf9cff8d89349888403240ab9dd348083968c61eae5cb8 SHA512 33ad074a03fa3ac7917dc7225218cf8e636776588015c9a9cd9c2274fe77b63a0695f288ff06e0cb94899e5286d11a9746457531df945f8a95fd7e031f601db3 diff --git a/dev-python/pygobject/files/pygobject-3.42.0-dynamicimporter-py310.patch b/dev-python/pygobject/files/pygobject-3.42.0-dynamicimporter-py310.patch new file mode 100644 index 000000000000..cf292ffbf7c6 --- /dev/null +++ b/dev-python/pygobject/files/pygobject-3.42.0-dynamicimporter-py310.patch @@ -0,0 +1,61 @@ +From dea457c0754550e210ab3cca9da8be1ae52d1d31 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz> +Date: Tue, 18 May 2021 12:31:51 +0200 +Subject: [PATCH] Implement DynamicImporter.find_spec() + +On Python 3.10, the code raised an ImportWarning: + + ImportWarning: DynamicImporter.find_spec() not found; falling back to find_module() + +See https://docs.python.org/3.10/whatsnew/3.10.html#deprecated + +> Starting in this release, there will be a concerted effort to begin cleaning +> up old import semantics that were kept for Python 2.7 compatibility. +> Specifically, find_loader()/find_module() (superseded by find_spec()), +> load_module() (superseded by exec_module()), module_repr() +> (which the import system takes care of for you), +> the __package__ attribute (superseded by __spec__.parent), +> the __loader__ attribute (superseded by __spec__.loader), +> and the __cached__ attribute (superseded by __spec__.cached) +> will slowly be removed (as well as other classes and methods in importlib). +> ImportWarning and/or DeprecationWarning will be raised as appropriate to help +> identify code which needs updating during this transition. + +Fixes https://gitlab.gnome.org/GNOME/pygobject/-/issues/473 +--- + gi/importer.py | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/gi/importer.py b/gi/importer.py +index 32967974..63788776 100644 +--- a/gi/importer.py ++++ b/gi/importer.py +@@ -107,15 +107,20 @@ class DynamicImporter(object): + def __init__(self, path): + self.path = path + +- def find_module(self, fullname, path=None): ++ def _find_module_check(self, fullname): + if not fullname.startswith(self.path): +- return ++ return False + + path, namespace = fullname.rsplit('.', 1) +- if path != self.path: +- return ++ return path == self.path ++ ++ def find_spec(self, fullname, path=None, target=None): ++ if self._find_module_check(fullname): ++ return importlib.util.spec_from_loader(fullname, self) + +- return self ++ def find_module(self, fullname, path=None): ++ if self._find_module_check(fullname): ++ return self + + def load_module(self, fullname): + if fullname in sys.modules: +-- +2.32.0 + diff --git a/dev-python/pygobject/pygobject-3.42.0.ebuild b/dev-python/pygobject/pygobject-3.42.0.ebuild new file mode 100644 index 000000000000..01f7b7055ebd --- /dev/null +++ b/dev-python/pygobject/pygobject-3.42.0.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 +} |