summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/protobuf-python')
-rw-r--r--dev-python/protobuf-python/Manifest10
-rw-r--r--dev-python/protobuf-python/files/protobuf-python-3.13.0-google.protobuf.pyext._message.PyUnknownFieldRef.patch22
-rw-r--r--dev-python/protobuf-python/files/protobuf-python-3.20.3-python311.patch132
-rw-r--r--dev-python/protobuf-python/files/protobuf-python-4.22.5-c++-17.patch13
-rw-r--r--dev-python/protobuf-python/metadata.xml5
-rw-r--r--dev-python/protobuf-python/protobuf-python-3.15.8.ebuild65
-rw-r--r--dev-python/protobuf-python/protobuf-python-3.16.0.ebuild65
-rw-r--r--dev-python/protobuf-python/protobuf-python-3.17.0.ebuild65
-rw-r--r--dev-python/protobuf-python/protobuf-python-3.17.1.ebuild65
-rw-r--r--dev-python/protobuf-python/protobuf-python-3.17.2.ebuild65
-rw-r--r--dev-python/protobuf-python/protobuf-python-3.17.3.ebuild65
-rw-r--r--dev-python/protobuf-python/protobuf-python-4.21.12.ebuild78
-rw-r--r--dev-python/protobuf-python/protobuf-python-4.21.9.ebuild84
-rw-r--r--dev-python/protobuf-python/protobuf-python-4.22.5.ebuild85
-rw-r--r--dev-python/protobuf-python/protobuf-python-4.23.3.ebuild79
-rw-r--r--dev-python/protobuf-python/protobuf-python-9999.ebuild96
16 files changed, 533 insertions, 461 deletions
diff --git a/dev-python/protobuf-python/Manifest b/dev-python/protobuf-python/Manifest
index 87ea4747892e..8695f23be04a 100644
--- a/dev-python/protobuf-python/Manifest
+++ b/dev-python/protobuf-python/Manifest
@@ -1,6 +1,4 @@
-DIST protobuf-3.15.8.tar.gz 5285277 BLAKE2B 798fc011ac03cdc2406acf5845c667d8482082044bdace06c2c1d02b5b1b69c1b1f30e29774180dc1801a1d21d62e2ce50325105859564a1e36d3fe478e64d8b SHA512 56fc6df2dae14eee0fb67dd4204fc1ec54a18d994a69c9e42c7888d0cd50d269d1c5e1445d74f0fa705850d4ac86a22d86781e09769a716e5c6f829b15b05592
-DIST protobuf-3.16.0.tar.gz 5299781 BLAKE2B 9ace02a6038c31b7393671fb2ccd6a4866a3f8b7d87d2bc8371f49d65b9180f10792ca2430a83449dfa7d785a1244dac23c20756414c9d1e7c7e871a8038b123 SHA512 0191e5a6a23d03f691e883e259f6d06a0ac8eef427455bc7d1cc70b6f0ed260e4ad8f360c836fd4bdc95ec0ca314c887cbf7acbcda60e03cdfe69e4cd275bff5
-DIST protobuf-3.17.0.tar.gz 5185780 BLAKE2B a168619df72cdf097c7ddfd50aca96a2101bf73e7c1c842c020e6ee08a853db8674a86ca999b7706da3dd21d4d3d2159241c93232efc693701962f3a54a382e9 SHA512 36ed2de641849ce01531ff1207f62a0748f811519c40622a119a17a1e709864382de81481fb58f374a025948971c48416e7e6de9c00512a78633c7a8a3aa3a36
-DIST protobuf-3.17.1.tar.gz 5192666 BLAKE2B 7f912db7e0835aaa42628fcf564a5666e2cbfa021bb35638a5eec53c3c457f1e747225dea54f732b7239a1520febca9bc20c824b1938f100796caa3ac2133bc1 SHA512 5a18aa3c1dab040dc6d22310a8503241081106acf7ca89079d7b416533d7c2cdd47719dc9023e6bc26969f0f1c796550260a04034a403c69752f6a3a7a651bb8
-DIST protobuf-3.17.2.tar.gz 5192779 BLAKE2B 97f9561848e70b8d26ebcc7fc4fa8da51c4b8267efbe1d2d386c2785308e7ba7edc05f1b3863c274dc8838866d58b58509606d72c51a22b956d1d528584c4c95 SHA512 b3e7ad50ed772668df70a3a20ad1af13a5e82f23b109e4fecd34e6a74947bed300963c9f084907fbfafe28fc18365cde7df1975e2ff9538d2f5a3d2b458bca98
-DIST protobuf-3.17.3.tar.gz 5235236 BLAKE2B 2495e678c8f9436d4e5a30ccee8b6226125d418ac7ecf7df20b078a1a16c221cbccab7d846dcd56a90220c106617fa75c410a21b62612fedec378cd7e8571350 SHA512 b4030b4474cc5fb5a62501200725dd488e6e66e3ced4ed12ab4ee029fcfed305e92ec966adafbdd343afffd186908163849422b95eaa500e7e741ac325d01d12
+DIST protobuf-21.12.tar.gz 5141166 BLAKE2B 33500612d103afb817062486a741e8e5503f82c42c70054d47d1899e6bb79f3fdde2666cad5b8eff6e1bc539c3b0cdf9f2b125ce7e5d3a459a69e84d67ab535e SHA512 2dc8f552388438268d8b9f7a9e84c6abf1736be3d5031438c789c317410c9f4b5cedd25bf7da6d67b3ba32ca890869f9ddaab2284d6ac0e734a5b135ffbb1346
+DIST protobuf-21.9.tar.gz 5110670 BLAKE2B a4f5b7f58e1c5904ca990b100a72992f6f56177b28773f8de8c99e4158391d33cfb8aa8575915887fc9ae4294faf81d4ff6b470bc07b394bfd5885a09ba0fafe SHA512 6954b42d21921e630173b7848c056ab95635627d8eddec960f3db2ddda13eedde00520a9b350722e76e2998649eb8ebe10758e1db938b6a91e38ff3295b1b7c1
+DIST protobuf-22.5.tar.gz 4924661 BLAKE2B d69c73f4ebfddf45fd94b4f5f898faf00256fe674f2cbc0443c60a88d7a0f47fb96f2f6262879927c6da88095b4ea3ee7fd4c471c100bf42a2bae9edf48c07f1 SHA512 058ab2fec5b11007972e6043071056d1944c3b6fe1d31246cddba8eb57686e3b5280f6ad3d58e78940ca63005e74a8de3c72237f9f7c5066548c5a2513ddc584
+DIST protobuf-23.3.tar.gz 5043803 BLAKE2B ee2edee230969555c9ef95069c7b1d6c23c3d1f8ea1b2249fb3e9f6fcf63312c6e10e9da65b80629fb08d5fb08d05a19bb9c752c25b892c1e3fd6f18b9279eb3 SHA512 646af367dbc61b42e322cf0b335f360e428b272e2b1f5361b2f17c18d3dc9dddd615e1279436028b1a42275a0beadda37c2c934fc27d6c892131cc8d526d8b3b
diff --git a/dev-python/protobuf-python/files/protobuf-python-3.13.0-google.protobuf.pyext._message.PyUnknownFieldRef.patch b/dev-python/protobuf-python/files/protobuf-python-3.13.0-google.protobuf.pyext._message.PyUnknownFieldRef.patch
deleted file mode 100644
index 68318320b909..000000000000
--- a/dev-python/protobuf-python/files/protobuf-python-3.13.0-google.protobuf.pyext._message.PyUnknownFieldRef.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-https://github.com/protocolbuffers/protobuf/issues/6205
-https://github.com/protocolbuffers/protobuf/pull/7016
-
---- /python/google/protobuf/pyext/unknown_fields.cc
-+++ /python/google/protobuf/pyext/unknown_fields.cc
-@@ -277,13 +277,13 @@
- PyObject* data = NULL;
- switch (field->type()) {
- case UnknownField::TYPE_VARINT:
-- data = PyInt_FromLong(field->varint());
-+ data = PyLong_FromUnsignedLongLong(field->varint());
- break;
- case UnknownField::TYPE_FIXED32:
-- data = PyInt_FromLong(field->fixed32());
-+ data = PyLong_FromUnsignedLong(field->fixed32());
- break;
- case UnknownField::TYPE_FIXED64:
-- data = PyInt_FromLong(field->fixed64());
-+ data = PyLong_FromUnsignedLongLong(field->fixed64());
- break;
- case UnknownField::TYPE_LENGTH_DELIMITED:
- data = PyBytes_FromStringAndSize(field->length_delimited().data(),
diff --git a/dev-python/protobuf-python/files/protobuf-python-3.20.3-python311.patch b/dev-python/protobuf-python/files/protobuf-python-3.20.3-python311.patch
new file mode 100644
index 000000000000..b9aca40776c5
--- /dev/null
+++ b/dev-python/protobuf-python/files/protobuf-python-3.20.3-python311.patch
@@ -0,0 +1,132 @@
+https://github.com/protocolbuffers/protobuf/commit/2206b63c4649cf2e8a06b66c9191c8ef862ca519
+https://github.com/protocolbuffers/protobuf/pull/10403
+https://github.com/protocolbuffers/protobuf/issues/10305
+https://bugs.gentoo.org/844184
+
+From da973aff2adab60a9e516d3202c111dbdde1a50f Mon Sep 17 00:00:00 2001
+From: Alexander Shadchin <alexandr.shadchin@gmail.com>
+Date: Sun, 14 Aug 2022 21:13:49 +0300
+Subject: [PATCH] Fix build with Python 3.11
+
+The PyFrameObject structure members have been removed from the public C API.
+--- a/google/protobuf/pyext/descriptor.cc
++++ b/google/protobuf/pyext/descriptor.cc
+@@ -58,6 +58,37 @@
+ : 0) \
+ : PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
+
++#if PY_VERSION_HEX < 0x030900B1 && !defined(PYPY_VERSION)
++static PyCodeObject* PyFrame_GetCode(PyFrameObject *frame)
++{
++ Py_INCREF(frame->f_code);
++ return frame->f_code;
++}
++
++static PyFrameObject* PyFrame_GetBack(PyFrameObject *frame)
++{
++ Py_XINCREF(frame->f_back);
++ return frame->f_back;
++}
++#endif
++
++#if PY_VERSION_HEX < 0x030B00A7 && !defined(PYPY_VERSION)
++static PyObject* PyFrame_GetLocals(PyFrameObject *frame)
++{
++ if (PyFrame_FastToLocalsWithError(frame) < 0) {
++ return NULL;
++ }
++ Py_INCREF(frame->f_locals);
++ return frame->f_locals;
++}
++
++static PyObject* PyFrame_GetGlobals(PyFrameObject *frame)
++{
++ Py_INCREF(frame->f_globals);
++ return frame->f_globals;
++}
++#endif
++
+ namespace google {
+ namespace protobuf {
+ namespace python {
+@@ -96,48 +127,66 @@ bool _CalledFromGeneratedFile(int stacklevel) {
+ // This check is not critical and is somewhat difficult to implement correctly
+ // in PyPy.
+ PyFrameObject* frame = PyEval_GetFrame();
++ PyCodeObject* frame_code = nullptr;
++ PyObject* frame_globals = nullptr;
++ PyObject* frame_locals = nullptr;
++ bool result = false;
++
+ if (frame == nullptr) {
+- return false;
++ goto exit;
+ }
++ Py_INCREF(frame);
+ while (stacklevel-- > 0) {
+- frame = frame->f_back;
++ PyFrameObject* next_frame = PyFrame_GetBack(frame);
++ Py_DECREF(frame);
++ frame = next_frame;
+ if (frame == nullptr) {
+- return false;
++ goto exit;
+ }
+ }
+
+- if (frame->f_code->co_filename == nullptr) {
+- return false;
++ frame_code = PyFrame_GetCode(frame);
++ if (frame_code->co_filename == nullptr) {
++ goto exit;
+ }
+ char* filename;
+ Py_ssize_t filename_size;
+- if (PyString_AsStringAndSize(frame->f_code->co_filename,
++ if (PyString_AsStringAndSize(frame_code->co_filename,
+ &filename, &filename_size) < 0) {
+ // filename is not a string.
+ PyErr_Clear();
+- return false;
++ goto exit;
+ }
+ if ((filename_size < 3) ||
+ (strcmp(&filename[filename_size - 3], ".py") != 0)) {
+ // Cython's stack does not have .py file name and is not at global module
+ // scope.
+- return true;
++ result = true;
++ goto exit;
+ }
+ if (filename_size < 7) {
+ // filename is too short.
+- return false;
++ goto exit;
+ }
+ if (strcmp(&filename[filename_size - 7], "_pb2.py") != 0) {
+ // Filename is not ending with _pb2.
+- return false;
++ goto exit;
+ }
+
+- if (frame->f_globals != frame->f_locals) {
++ frame_globals = PyFrame_GetGlobals(frame);
++ frame_locals = PyFrame_GetLocals(frame);
++ if (frame_globals != frame_locals) {
+ // Not at global module scope
+- return false;
++ goto exit;
+ }
+ #endif
+- return true;
++ result = true;
++exit:
++ Py_XDECREF(frame_globals);
++ Py_XDECREF(frame_locals);
++ Py_XDECREF(frame_code);
++ Py_XDECREF(frame);
++ return result;
+ }
+
+ // If the calling code is not a _pb2.py file, raise AttributeError.
+
diff --git a/dev-python/protobuf-python/files/protobuf-python-4.22.5-c++-17.patch b/dev-python/protobuf-python/files/protobuf-python-4.22.5-c++-17.patch
new file mode 100644
index 000000000000..3ca6a5776d04
--- /dev/null
+++ b/dev-python/protobuf-python/files/protobuf-python-4.22.5-c++-17.patch
@@ -0,0 +1,13 @@
+diff --git a/python/setup.py b/python/setup.py
+index e65631013..8a6cbe59a 100755
+--- a/python/setup.py
++++ b/python/setup.py
+@@ -370,7 +370,7 @@ if __name__ == '__main__':
+ extra_compile_args.append('-Wno-invalid-offsetof')
+ extra_compile_args.append('-Wno-sign-compare')
+ extra_compile_args.append('-Wno-unused-variable')
+- extra_compile_args.append('-std=c++14')
++ extra_compile_args.append('-std=c++17')
+
+ if sys.platform == 'darwin':
+ extra_compile_args.append('-Wno-shorten-64-to-32')
diff --git a/dev-python/protobuf-python/metadata.xml b/dev-python/protobuf-python/metadata.xml
index 9a6f066d8d62..a3f1bad10813 100644
--- a/dev-python/protobuf-python/metadata.xml
+++ b/dev-python/protobuf-python/metadata.xml
@@ -6,13 +6,14 @@
<name>Arfrever Frehtes Taifersar Arahesis</name>
</maintainer>
<maintainer type="project">
- <email>python@gentoo.org</email>
- <name>Python</name>
+ <email>cjk@gentoo.org</email>
+ <name>Cjk</name>
</maintainer>
<slots>
<subslots>Soname version number of Protobuf</subslots>
</slots>
<upstream>
<remote-id type="github">protocolbuffers/protobuf</remote-id>
+ <remote-id type="pypi">protobuf</remote-id>
</upstream>
</pkgmetadata>
diff --git a/dev-python/protobuf-python/protobuf-python-3.15.8.ebuild b/dev-python/protobuf-python/protobuf-python-3.15.8.ebuild
deleted file mode 100644
index 2fe19c7f5cf5..000000000000
--- a/dev-python/protobuf-python/protobuf-python-3.15.8.ebuild
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 2008-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-PYTHON_COMPAT=( python3_{8..10} )
-DISTUTILS_USE_SETUPTOOLS="bdepend"
-
-inherit distutils-r1
-
-if [[ "${PV}" == "9999" ]]; then
- inherit git-r3
-
- EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
- EGIT_SUBMODULES=()
-fi
-
-DESCRIPTION="Google's Protocol Buffers - Python bindings"
-HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
-if [[ "${PV}" == "9999" ]]; then
- SRC_URI=""
-else
- SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> protobuf-${PV}.tar.gz"
-fi
-
-LICENSE="BSD"
-SLOT="0/26"
-KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
-IUSE=""
-
-BDEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}
- dev-python/namespace-google[${PYTHON_USEDEP}]
- dev-python/six[${PYTHON_USEDEP}]"
-DEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}"
-RDEPEND="${BDEPEND}"
-
-S="${WORKDIR}/protobuf-${PV}/python"
-
-if [[ "${PV}" == "9999" ]]; then
- EGIT_CHECKOUT_DIR="${WORKDIR}/protobuf-${PV}"
-fi
-
-python_prepare_all() {
- pushd "${WORKDIR}/protobuf-${PV}" > /dev/null || die
- eapply "${FILESDIR}/${PN}-3.13.0-google.protobuf.pyext._message.PyUnknownFieldRef.patch"
- eapply_user
- popd > /dev/null || die
-
- distutils-r1_python_prepare_all
-}
-
-python_configure_all() {
- mydistutilsargs=(--cpp_implementation)
-}
-
-python_test() {
- esetup.py test
-}
-
-python_install_all() {
- distutils-r1_python_install_all
-
- find "${ED}" -name "*.pth" -type f -delete || die
-}
diff --git a/dev-python/protobuf-python/protobuf-python-3.16.0.ebuild b/dev-python/protobuf-python/protobuf-python-3.16.0.ebuild
deleted file mode 100644
index fbe4535581f8..000000000000
--- a/dev-python/protobuf-python/protobuf-python-3.16.0.ebuild
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 2008-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-PYTHON_COMPAT=( python3_{8..10} )
-DISTUTILS_USE_SETUPTOOLS="bdepend"
-
-inherit distutils-r1
-
-if [[ "${PV}" == "9999" ]]; then
- inherit git-r3
-
- EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
- EGIT_SUBMODULES=()
-fi
-
-DESCRIPTION="Google's Protocol Buffers - Python bindings"
-HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
-if [[ "${PV}" == "9999" ]]; then
- SRC_URI=""
-else
- SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> protobuf-${PV}.tar.gz"
-fi
-
-LICENSE="BSD"
-SLOT="0/27"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
-IUSE=""
-
-BDEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}
- dev-python/namespace-google[${PYTHON_USEDEP}]
- dev-python/six[${PYTHON_USEDEP}]"
-DEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}"
-RDEPEND="${BDEPEND}"
-
-S="${WORKDIR}/protobuf-${PV}/python"
-
-if [[ "${PV}" == "9999" ]]; then
- EGIT_CHECKOUT_DIR="${WORKDIR}/protobuf-${PV}"
-fi
-
-python_prepare_all() {
- pushd "${WORKDIR}/protobuf-${PV}" > /dev/null || die
- eapply "${FILESDIR}/${PN}-3.13.0-google.protobuf.pyext._message.PyUnknownFieldRef.patch"
- eapply_user
- popd > /dev/null || die
-
- distutils-r1_python_prepare_all
-}
-
-python_configure_all() {
- mydistutilsargs=(--cpp_implementation)
-}
-
-python_test() {
- esetup.py test
-}
-
-python_install_all() {
- distutils-r1_python_install_all
-
- find "${ED}" -name "*.pth" -type f -delete || die
-}
diff --git a/dev-python/protobuf-python/protobuf-python-3.17.0.ebuild b/dev-python/protobuf-python/protobuf-python-3.17.0.ebuild
deleted file mode 100644
index 383ab9947049..000000000000
--- a/dev-python/protobuf-python/protobuf-python-3.17.0.ebuild
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 2008-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-PYTHON_COMPAT=( python3_{8..10} )
-DISTUTILS_USE_SETUPTOOLS="bdepend"
-
-inherit distutils-r1
-
-if [[ "${PV}" == "9999" ]]; then
- inherit git-r3
-
- EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
- EGIT_SUBMODULES=()
-fi
-
-DESCRIPTION="Google's Protocol Buffers - Python bindings"
-HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
-if [[ "${PV}" == "9999" ]]; then
- SRC_URI=""
-else
- SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> protobuf-${PV}.tar.gz"
-fi
-
-LICENSE="BSD"
-SLOT="0/28"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
-IUSE=""
-
-BDEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}
- dev-python/namespace-google[${PYTHON_USEDEP}]
- dev-python/six[${PYTHON_USEDEP}]"
-DEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}"
-RDEPEND="${BDEPEND}"
-
-S="${WORKDIR}/protobuf-${PV}/python"
-
-if [[ "${PV}" == "9999" ]]; then
- EGIT_CHECKOUT_DIR="${WORKDIR}/protobuf-${PV}"
-fi
-
-python_prepare_all() {
- pushd "${WORKDIR}/protobuf-${PV}" > /dev/null || die
- eapply "${FILESDIR}/${PN}-3.13.0-google.protobuf.pyext._message.PyUnknownFieldRef.patch"
- eapply_user
- popd > /dev/null || die
-
- distutils-r1_python_prepare_all
-}
-
-python_configure_all() {
- mydistutilsargs=(--cpp_implementation)
-}
-
-python_test() {
- esetup.py test
-}
-
-python_install_all() {
- distutils-r1_python_install_all
-
- find "${ED}" -name "*.pth" -type f -delete || die
-}
diff --git a/dev-python/protobuf-python/protobuf-python-3.17.1.ebuild b/dev-python/protobuf-python/protobuf-python-3.17.1.ebuild
deleted file mode 100644
index 383ab9947049..000000000000
--- a/dev-python/protobuf-python/protobuf-python-3.17.1.ebuild
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 2008-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-PYTHON_COMPAT=( python3_{8..10} )
-DISTUTILS_USE_SETUPTOOLS="bdepend"
-
-inherit distutils-r1
-
-if [[ "${PV}" == "9999" ]]; then
- inherit git-r3
-
- EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
- EGIT_SUBMODULES=()
-fi
-
-DESCRIPTION="Google's Protocol Buffers - Python bindings"
-HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
-if [[ "${PV}" == "9999" ]]; then
- SRC_URI=""
-else
- SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> protobuf-${PV}.tar.gz"
-fi
-
-LICENSE="BSD"
-SLOT="0/28"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
-IUSE=""
-
-BDEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}
- dev-python/namespace-google[${PYTHON_USEDEP}]
- dev-python/six[${PYTHON_USEDEP}]"
-DEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}"
-RDEPEND="${BDEPEND}"
-
-S="${WORKDIR}/protobuf-${PV}/python"
-
-if [[ "${PV}" == "9999" ]]; then
- EGIT_CHECKOUT_DIR="${WORKDIR}/protobuf-${PV}"
-fi
-
-python_prepare_all() {
- pushd "${WORKDIR}/protobuf-${PV}" > /dev/null || die
- eapply "${FILESDIR}/${PN}-3.13.0-google.protobuf.pyext._message.PyUnknownFieldRef.patch"
- eapply_user
- popd > /dev/null || die
-
- distutils-r1_python_prepare_all
-}
-
-python_configure_all() {
- mydistutilsargs=(--cpp_implementation)
-}
-
-python_test() {
- esetup.py test
-}
-
-python_install_all() {
- distutils-r1_python_install_all
-
- find "${ED}" -name "*.pth" -type f -delete || die
-}
diff --git a/dev-python/protobuf-python/protobuf-python-3.17.2.ebuild b/dev-python/protobuf-python/protobuf-python-3.17.2.ebuild
deleted file mode 100644
index 383ab9947049..000000000000
--- a/dev-python/protobuf-python/protobuf-python-3.17.2.ebuild
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 2008-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-PYTHON_COMPAT=( python3_{8..10} )
-DISTUTILS_USE_SETUPTOOLS="bdepend"
-
-inherit distutils-r1
-
-if [[ "${PV}" == "9999" ]]; then
- inherit git-r3
-
- EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
- EGIT_SUBMODULES=()
-fi
-
-DESCRIPTION="Google's Protocol Buffers - Python bindings"
-HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
-if [[ "${PV}" == "9999" ]]; then
- SRC_URI=""
-else
- SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> protobuf-${PV}.tar.gz"
-fi
-
-LICENSE="BSD"
-SLOT="0/28"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
-IUSE=""
-
-BDEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}
- dev-python/namespace-google[${PYTHON_USEDEP}]
- dev-python/six[${PYTHON_USEDEP}]"
-DEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}"
-RDEPEND="${BDEPEND}"
-
-S="${WORKDIR}/protobuf-${PV}/python"
-
-if [[ "${PV}" == "9999" ]]; then
- EGIT_CHECKOUT_DIR="${WORKDIR}/protobuf-${PV}"
-fi
-
-python_prepare_all() {
- pushd "${WORKDIR}/protobuf-${PV}" > /dev/null || die
- eapply "${FILESDIR}/${PN}-3.13.0-google.protobuf.pyext._message.PyUnknownFieldRef.patch"
- eapply_user
- popd > /dev/null || die
-
- distutils-r1_python_prepare_all
-}
-
-python_configure_all() {
- mydistutilsargs=(--cpp_implementation)
-}
-
-python_test() {
- esetup.py test
-}
-
-python_install_all() {
- distutils-r1_python_install_all
-
- find "${ED}" -name "*.pth" -type f -delete || die
-}
diff --git a/dev-python/protobuf-python/protobuf-python-3.17.3.ebuild b/dev-python/protobuf-python/protobuf-python-3.17.3.ebuild
deleted file mode 100644
index 3d9369545d71..000000000000
--- a/dev-python/protobuf-python/protobuf-python-3.17.3.ebuild
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 2008-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-PYTHON_COMPAT=( python3_{8..10} )
-DISTUTILS_USE_SETUPTOOLS="bdepend"
-
-inherit distutils-r1
-
-if [[ "${PV}" == "9999" ]]; then
- inherit git-r3
-
- EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
- EGIT_SUBMODULES=()
-fi
-
-DESCRIPTION="Google's Protocol Buffers - Python bindings"
-HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
-if [[ "${PV}" == "9999" ]]; then
- SRC_URI=""
-else
- SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> protobuf-${PV}.tar.gz"
-fi
-
-LICENSE="BSD"
-SLOT="0/28"
-KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
-IUSE=""
-
-BDEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}
- dev-python/namespace-google[${PYTHON_USEDEP}]
- dev-python/six[${PYTHON_USEDEP}]"
-DEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}"
-RDEPEND="${BDEPEND}"
-
-S="${WORKDIR}/protobuf-${PV}/python"
-
-if [[ "${PV}" == "9999" ]]; then
- EGIT_CHECKOUT_DIR="${WORKDIR}/protobuf-${PV}"
-fi
-
-python_prepare_all() {
- pushd "${WORKDIR}/protobuf-${PV}" > /dev/null || die
- eapply "${FILESDIR}/${PN}-3.13.0-google.protobuf.pyext._message.PyUnknownFieldRef.patch"
- eapply_user
- popd > /dev/null || die
-
- distutils-r1_python_prepare_all
-}
-
-python_configure_all() {
- mydistutilsargs=(--cpp_implementation)
-}
-
-python_test() {
- esetup.py test
-}
-
-python_install_all() {
- distutils-r1_python_install_all
-
- find "${ED}" -name "*.pth" -type f -delete || die
-}
diff --git a/dev-python/protobuf-python/protobuf-python-4.21.12.ebuild b/dev-python/protobuf-python/protobuf-python-4.21.12.ebuild
new file mode 100644
index 000000000000..c445608352ac
--- /dev/null
+++ b/dev-python/protobuf-python/protobuf-python-4.21.12.ebuild
@@ -0,0 +1,78 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..11} )
+
+inherit distutils-r1
+
+PARENT_PN="${PN/-python/}"
+PARENT_PV="$(ver_cut 2-)"
+PARENT_P="${PARENT_PN}-${PARENT_PV}"
+
+if [[ "${PV}" == *9999 ]]; then
+ inherit git-r3
+
+ EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git"
+ EGIT_SUBMODULES=()
+ EGIT_CHECKOUT_DIR="${WORKDIR}/${PARENT_P}"
+else
+ SRC_URI="
+ https://github.com/protocolbuffers/protobuf/archive/v${PARENT_PV}.tar.gz
+ -> ${PARENT_P}.tar.gz
+ "
+ KEYWORDS="~alpha amd64 ~arm arm64 ~loong ~mips ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+fi
+
+DESCRIPTION="Google's Protocol Buffers - Python bindings"
+HOMEPAGE="
+ https://developers.google.com/protocol-buffers/
+ https://pypi.org/project/protobuf/
+"
+
+LICENSE="BSD"
+SLOT="0/3.${PARENT_PV}.0"
+
+S="${WORKDIR}/${PARENT_P}/python"
+
+DEPEND="
+ ${PYTHON_DEPS}
+"
+RDEPEND="
+ ${BDEPEND}
+ dev-libs/protobuf:${SLOT}
+"
+
+distutils_enable_tests setup.py
+
+# Same than PATCHES but from repository's root directory,
+# please see function `python_prepare_all` below.
+# Simplier for users IMHO.
+PARENT_PATCHES=(
+)
+
+# Here for patches within "python/" subdirectory.
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.20.3-python311.patch
+)
+
+python_prepare_all() {
+ pushd "${WORKDIR}/${PARENT_P}" > /dev/null || die
+ [[ -n "${PARENT_PATCHES[@]}" ]] && eapply "${PARENT_PATCHES[@]}"
+ eapply_user
+ popd > /dev/null || die
+
+ distutils-r1_python_prepare_all
+}
+
+src_configure() {
+ DISTUTILS_ARGS=( --cpp_implementation )
+}
+
+python_compile() {
+ distutils-r1_python_compile
+ find "${BUILD_DIR}/install" -name "*.pth" -type f -delete || die
+}
diff --git a/dev-python/protobuf-python/protobuf-python-4.21.9.ebuild b/dev-python/protobuf-python/protobuf-python-4.21.9.ebuild
new file mode 100644
index 000000000000..76cb2702273c
--- /dev/null
+++ b/dev-python/protobuf-python/protobuf-python-4.21.9.ebuild
@@ -0,0 +1,84 @@
+# Copyright 2008-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit distutils-r1
+
+PARENT_PN="${PN/-python/}"
+PARENT_PV="$(ver_cut 2-)"
+PARENT_P="${PARENT_PN}-${PARENT_PV}"
+
+if [[ "${PV}" == *9999 ]]; then
+ inherit git-r3
+
+ EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git"
+ EGIT_SUBMODULES=()
+ EGIT_CHECKOUT_DIR="${WORKDIR}/${PARENT_P}"
+else
+ SRC_URI="
+ https://github.com/protocolbuffers/protobuf/archive/v${PARENT_PV}.tar.gz
+ -> ${PARENT_P}.tar.gz
+ "
+ KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
+fi
+
+DESCRIPTION="Google's Protocol Buffers - Python bindings"
+HOMEPAGE="
+ https://developers.google.com/protocol-buffers/
+ https://pypi.org/project/protobuf/
+"
+
+LICENSE="BSD"
+SLOT="0/32"
+
+S="${WORKDIR}/${PARENT_P}/python"
+
+BDEPEND="
+"
+DEPEND="
+ ${PYTHON_DEPS}
+"
+RDEPEND="
+ ${BDEPEND}
+ dev-libs/protobuf:${SLOT}
+"
+
+distutils_enable_tests setup.py
+
+# Same than PATCHES but from repository's root directory,
+# please see function `python_prepare_all` below.
+# Simplier for users IMHO.
+PARENT_PATCHES=(
+)
+
+# Here for patches within "python/" subdirectory.
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.20.3-python311.patch
+)
+
+python_prepare_all() {
+ pushd "${WORKDIR}/${PARENT_P}" > /dev/null || die
+ [[ -n "${PARENT_PATCHES[@]}" ]] && eapply "${PARENT_PATCHES[@]}"
+ eapply_user
+ popd > /dev/null || die
+
+ # py3.12
+ sed -i -e 's:assertRaisesRegexp:assertRaisesRegex:' \
+ google/protobuf/internal/json_format_test.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+src_configure() {
+ DISTUTILS_ARGS=( --cpp_implementation )
+}
+
+python_compile() {
+ distutils-r1_python_compile
+ find "${BUILD_DIR}/install" -name "*.pth" -type f -delete || die
+}
diff --git a/dev-python/protobuf-python/protobuf-python-4.22.5.ebuild b/dev-python/protobuf-python/protobuf-python-4.22.5.ebuild
new file mode 100644
index 000000000000..27768732e87b
--- /dev/null
+++ b/dev-python/protobuf-python/protobuf-python-4.22.5.ebuild
@@ -0,0 +1,85 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit distutils-r1
+
+PARENT_PN="${PN/-python/}"
+PARENT_PV="$(ver_cut 2-)"
+PARENT_P="${PARENT_PN}-${PARENT_PV}"
+
+if [[ "${PV}" == *9999 ]]; then
+ inherit git-r3
+
+ EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git"
+ EGIT_SUBMODULES=()
+ EGIT_CHECKOUT_DIR="${WORKDIR}/${PARENT_P}"
+else
+ SRC_URI="
+ https://github.com/protocolbuffers/protobuf/archive/v${PARENT_PV}.tar.gz
+ -> ${PARENT_P}.tar.gz
+ "
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+fi
+
+DESCRIPTION="Google's Protocol Buffers - Python bindings"
+HOMEPAGE="
+ https://developers.google.com/protocol-buffers/
+ https://pypi.org/project/protobuf/
+"
+
+LICENSE="BSD"
+SLOT="0/22.5.0"
+
+S="${WORKDIR}/${PARENT_P}/python"
+
+DEPEND="
+ ${PYTHON_DEPS}
+"
+RDEPEND="
+ dev-libs/protobuf:${SLOT}
+"
+
+distutils_enable_tests setup.py
+
+# Same than PATCHES but from repository's root directory,
+# please see function `python_prepare_all` below.
+# Simplier for users IMHO.
+PARENT_PATCHES=(
+ "${FILESDIR}/${P}-c++-17.patch"
+)
+
+# Here for patches within "python/" subdirectory.
+PATCHES=(
+)
+
+python_prepare_all() {
+ pushd "${WORKDIR}/${PARENT_P}" > /dev/null || die
+ [[ -n "${PARENT_PATCHES[@]}" ]] && eapply "${PARENT_PATCHES[@]}"
+ eapply_user
+ popd > /dev/null || die
+
+ distutils-r1_python_prepare_all
+}
+
+src_configure() {
+ DISTUTILS_ARGS=( --cpp_implementation )
+}
+
+python_compile() {
+ distutils-r1_python_compile
+ find "${BUILD_DIR}/install" -name "*.pth" -type f -delete || die
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ einfo "Installing headers"
+ insinto /usr/include/google/protobuf
+ doins google/protobuf/proto_api.h
+}
diff --git a/dev-python/protobuf-python/protobuf-python-4.23.3.ebuild b/dev-python/protobuf-python/protobuf-python-4.23.3.ebuild
new file mode 100644
index 000000000000..546a2110c18e
--- /dev/null
+++ b/dev-python/protobuf-python/protobuf-python-4.23.3.ebuild
@@ -0,0 +1,79 @@
+# Copyright 2008-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit distutils-r1
+
+PARENT_PN="${PN/-python/}"
+PARENT_PV="$(ver_cut 2-)"
+PARENT_P="${PARENT_PN}-${PARENT_PV}"
+
+if [[ "${PV}" == *9999 ]]; then
+ inherit git-r3
+
+ EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git"
+ EGIT_SUBMODULES=()
+ EGIT_CHECKOUT_DIR="${WORKDIR}/${PARENT_P}"
+else
+ SRC_URI="
+ https://github.com/protocolbuffers/protobuf/archive/v${PARENT_PV}.tar.gz
+ -> ${PARENT_P}.tar.gz
+ "
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+fi
+
+DESCRIPTION="Google's Protocol Buffers - Python bindings"
+HOMEPAGE="
+ https://developers.google.com/protocol-buffers/
+ https://pypi.org/project/protobuf/
+"
+
+LICENSE="BSD"
+SLOT="0/23.3.0"
+
+S="${WORKDIR}/${PARENT_P}/python"
+
+BDEPEND="
+"
+DEPEND="
+ ${PYTHON_DEPS}
+"
+RDEPEND="
+ ${BDEPEND}
+ dev-libs/protobuf:${SLOT}
+"
+
+distutils_enable_tests setup.py
+
+# Same than PATCHES but from repository's root directory,
+# please see function `python_prepare_all` below.
+# Simplier for users IMHO.
+PARENT_PATCHES=(
+)
+
+# Here for patches within "python/" subdirectory.
+PATCHES=(
+)
+
+python_prepare_all() {
+ pushd "${WORKDIR}/${PARENT_P}" > /dev/null || die
+ [[ -n "${PARENT_PATCHES[@]}" ]] && eapply "${PARENT_PATCHES[@]}"
+ eapply_user
+ popd > /dev/null || die
+
+ distutils-r1_python_prepare_all
+}
+
+src_configure() {
+ DISTUTILS_ARGS=( --cpp_implementation )
+}
+
+python_compile() {
+ distutils-r1_python_compile
+ find "${BUILD_DIR}/install" -name "*.pth" -type f -delete || die
+}
diff --git a/dev-python/protobuf-python/protobuf-python-9999.ebuild b/dev-python/protobuf-python/protobuf-python-9999.ebuild
index f07439781bb9..c8a33b8666b2 100644
--- a/dev-python/protobuf-python/protobuf-python-9999.ebuild
+++ b/dev-python/protobuf-python/protobuf-python-9999.ebuild
@@ -1,65 +1,79 @@
-# Copyright 2008-2021 Gentoo Authors
+# Copyright 2008-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="7"
-PYTHON_COMPAT=( python3_{8..10} )
-DISTUTILS_USE_SETUPTOOLS="bdepend"
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} )
inherit distutils-r1
-if [[ "${PV}" == "9999" ]]; then
+PARENT_PN="${PN/-python/}"
+PARENT_PV="$(ver_cut 2-)"
+PARENT_P="${PARENT_PN}-${PARENT_PV}"
+
+if [[ "${PV}" == *9999 ]]; then
inherit git-r3
- EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
+ EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git"
EGIT_SUBMODULES=()
+ EGIT_CHECKOUT_DIR="${WORKDIR}/${PARENT_P}"
+else
+ SRC_URI="
+ https://github.com/protocolbuffers/protobuf/archive/v${PARENT_PV}.tar.gz
+ -> ${PARENT_P}.tar.gz
+ "
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux ~x64-macos"
fi
DESCRIPTION="Google's Protocol Buffers - Python bindings"
-HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
-if [[ "${PV}" == "9999" ]]; then
- SRC_URI=""
-else
- SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> protobuf-${PV}.tar.gz"
-fi
+HOMEPAGE="
+ https://developers.google.com/protocol-buffers/
+ https://pypi.org/project/protobuf/
+"
LICENSE="BSD"
-SLOT="0/28"
-KEYWORDS=""
-IUSE=""
-
-BDEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}
- dev-python/namespace-google[${PYTHON_USEDEP}]
- dev-python/six[${PYTHON_USEDEP}]"
-DEPEND="${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}"
-RDEPEND="${BDEPEND}"
-
-S="${WORKDIR}/protobuf-${PV}/python"
-
-if [[ "${PV}" == "9999" ]]; then
- EGIT_CHECKOUT_DIR="${WORKDIR}/protobuf-${PV}"
-fi
+SLOT="0/23.3.0"
+
+S="${WORKDIR}/${PARENT_P}/python"
+
+BDEPEND="
+"
+DEPEND="
+ ${PYTHON_DEPS}
+"
+RDEPEND="
+ ${BDEPEND}
+ dev-libs/protobuf:${SLOT}
+"
+
+distutils_enable_tests setup.py
+
+# Same than PATCHES but from repository's root directory,
+# please see function `python_prepare_all` below.
+# Simplier for users IMHO.
+PARENT_PATCHES=(
+)
+
+# Here for patches within "python/" subdirectory.
+PATCHES=(
+)
python_prepare_all() {
- pushd "${WORKDIR}/protobuf-${PV}" > /dev/null || die
- eapply "${FILESDIR}/${PN}-3.13.0-google.protobuf.pyext._message.PyUnknownFieldRef.patch"
+ pushd "${WORKDIR}/${PARENT_P}" > /dev/null || die
+ [[ -n "${PARENT_PATCHES[@]}" ]] && eapply "${PARENT_PATCHES[@]}"
eapply_user
popd > /dev/null || die
distutils-r1_python_prepare_all
}
-python_configure_all() {
- mydistutilsargs=(--cpp_implementation)
+src_configure() {
+ DISTUTILS_ARGS=( --cpp_implementation )
}
-python_test() {
- esetup.py test
-}
-
-python_install_all() {
- distutils-r1_python_install_all
-
- find "${ED}" -name "*.pth" -type f -delete || die
+python_compile() {
+ distutils-r1_python_compile
+ find "${BUILD_DIR}/install" -name "*.pth" -type f -delete || die
}