summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-11-13 21:30:40 +0100
committerMichał Górny <mgorny@gentoo.org>2024-11-13 21:41:07 +0100
commit3eefb831a4e63a9c8c75c6e64ae2894d6478973e (patch)
tree3be306511eee9477ffe4839813d828e45918a4df /dev-python/protobuf
parentdev-python/protobuf-python: Prepare newer versions for rename (diff)
downloadgentoo-3eefb831a4e63a9c8c75c6e64ae2894d6478973e.tar.gz
gentoo-3eefb831a4e63a9c8c75c6e64ae2894d6478973e.tar.bz2
gentoo-3eefb831a4e63a9c8c75c6e64ae2894d6478973e.zip
Rename dev-python/{protobuf-python → protobuf}
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/protobuf')
-rw-r--r--dev-python/protobuf/Manifest8
-rw-r--r--dev-python/protobuf/files/protobuf-3.20.3-python311.patch132
-rw-r--r--dev-python/protobuf/files/protobuf-4.22.5-c++-17.patch13
-rw-r--r--dev-python/protobuf/files/protobuf-4.22.5-python.patch21
-rw-r--r--dev-python/protobuf/metadata.xml12
-rw-r--r--dev-python/protobuf/protobuf-4.21.12.ebuild78
-rw-r--r--dev-python/protobuf/protobuf-4.21.9.ebuild84
-rw-r--r--dev-python/protobuf/protobuf-4.22.5.ebuild86
-rw-r--r--dev-python/protobuf/protobuf-4.23.3.ebuild79
-rw-r--r--dev-python/protobuf/protobuf-4.25.4.ebuild29
-rw-r--r--dev-python/protobuf/protobuf-5.27.2.ebuild29
-rw-r--r--dev-python/protobuf/protobuf-5.27.4.ebuild29
-rw-r--r--dev-python/protobuf/protobuf-5.28.0.ebuild29
13 files changed, 629 insertions, 0 deletions
diff --git a/dev-python/protobuf/Manifest b/dev-python/protobuf/Manifest
new file mode 100644
index 000000000000..fb851d0bf1d3
--- /dev/null
+++ b/dev-python/protobuf/Manifest
@@ -0,0 +1,8 @@
+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
+DIST protobuf-python-4.25.4.tar.gz 380283 BLAKE2B 3ded7b654fa4db54b0dff2309f096bcab634b9d587bd94dae4ab49fb2fe9dc8f821c52deed43b026e06189b3b7a1a6697074942c1fa732ec82257233bf1b2f90 SHA512 7b91a9473fafe62b723741faec8e8531c604b025a49ef8be79778f8a48c84c475518447b24f5a08a0a8a8ecb1ff22e2106a3183197b76be3b2b8c6c994d93920
+DIST protobuf-python-5.27.2.tar.gz 401640 BLAKE2B 9d3420b75536ffd452cc2a3317a6ad1e16a62df36085f1e329f0178026032f5533e1a96f7b613f91093ac12a44d7ad4059ebededea636f38ded29da563afd075 SHA512 b3afcf13e223d7e855ac0aa000cc395e3ea1301b2e3dfe3c0d5435d8031be3726e6aec1fb6228c572aa1685f75aba2d97d2c9dfdb6d9e058a2e88321d6ba9180
+DIST protobuf-python-5.27.4.tar.gz 401622 BLAKE2B 4a7f211a4f4b3e7a338f8be6a7c6cdec2df629d6f9b62dfc276d6029864dfb541468a5e4d221f4540ae9281e5fc622ee898daeb178f9d98bac9932af0c8625db SHA512 2b817947363ab8d31bd484c18d33234004c7f5e6cb7bff55657cc33e1f325e22c7ccf83c19e255e839d6061fc62d632af9b36bc4fef0d4b33623b278239043b2
+DIST protobuf-python-5.28.0.tar.gz 422388 BLAKE2B 208f92bdb2bc0b92dca76de4d13eda0c98bc4784cb2ce9d57690682d9327fb2a66646241ecc02e96be602b6763b177b3192ca457732540d1fa8c33afecd8d76f SHA512 91f05915ace778ee76a07856049410c48c02a665f6c4665df9ac3e32992a67235a93fb4e19c9f991821652f236b87749c3d79cfabd8c6508fdc17a2ee612cee5
diff --git a/dev-python/protobuf/files/protobuf-3.20.3-python311.patch b/dev-python/protobuf/files/protobuf-3.20.3-python311.patch
new file mode 100644
index 000000000000..b9aca40776c5
--- /dev/null
+++ b/dev-python/protobuf/files/protobuf-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/files/protobuf-4.22.5-c++-17.patch b/dev-python/protobuf/files/protobuf-4.22.5-c++-17.patch
new file mode 100644
index 000000000000..3ca6a5776d04
--- /dev/null
+++ b/dev-python/protobuf/files/protobuf-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/files/protobuf-4.22.5-python.patch b/dev-python/protobuf/files/protobuf-4.22.5-python.patch
new file mode 100644
index 000000000000..65cb22d5f653
--- /dev/null
+++ b/dev-python/protobuf/files/protobuf-4.22.5-python.patch
@@ -0,0 +1,21 @@
+See also https://github.com/protocolbuffers/protobuf/pull/9098
+--- a/google/protobuf/internal/json_format_test.py
++++ b/google/protobuf/internal/json_format_test.py
+@@ -1060,7 +1060,7 @@ class JsonFormatTest(JsonFormatBase):
+ def testInvalidTimestamp(self):
+ message = json_format_proto3_pb2.TestTimestamp()
+ text = '{"value": "10000-01-01T00:00:00.00Z"}'
+- self.assertRaisesRegexp(
++ self.assertRaisesRegex(
+ json_format.ParseError, 'Failed to parse value field: '
+ 'time data \'10000-01-01T00:00:00\' does not match'
+ ' format \'%Y-%m-%dT%H:%M:%S\' at TestTimestamp.value.',
+@@ -1097,7 +1097,7 @@ class JsonFormatTest(JsonFormatBase):
+ def testInvalidOneof(self):
+ message = json_format_proto3_pb2.TestOneof()
+ text = '{"oneofInt32Value": 1, "oneofStringValue": "2"}'
+- self.assertRaisesRegexp(
++ self.assertRaisesRegex(
+ json_format.ParseError, 'Message type "proto3.TestOneof"'
+ ' should not have multiple "oneof_value" oneof fields at "TestOneof".',
+ json_format.Parse, text, message)
diff --git a/dev-python/protobuf/metadata.xml b/dev-python/protobuf/metadata.xml
new file mode 100644
index 000000000000..05a4e2ab92b2
--- /dev/null
+++ b/dev-python/protobuf/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <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/protobuf-4.21.12.ebuild b/dev-python/protobuf/protobuf-4.21.12.ebuild
new file mode 100644
index 000000000000..4c01b69d46e8
--- /dev/null
+++ b/dev-python/protobuf/protobuf-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/protobuf-4.21.9.ebuild b/dev-python/protobuf/protobuf-4.21.9.ebuild
new file mode 100644
index 000000000000..2a2d21423728
--- /dev/null
+++ b/dev-python/protobuf/protobuf-4.21.9.ebuild
@@ -0,0 +1,84 @@
+# 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 ~hppa ~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/protobuf-4.22.5.ebuild b/dev-python/protobuf/protobuf-4.22.5.ebuild
new file mode 100644
index 000000000000..59b4f648ed71
--- /dev/null
+++ b/dev-python/protobuf/protobuf-4.22.5.ebuild
@@ -0,0 +1,86 @@
+# 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=(
+ "${FILESDIR}/${PN}-4.22.5-python.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
+}
+
+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/protobuf-4.23.3.ebuild b/dev-python/protobuf/protobuf-4.23.3.ebuild
new file mode 100644
index 000000000000..a186181fd7f9
--- /dev/null
+++ b/dev-python/protobuf/protobuf-4.23.3.ebuild
@@ -0,0 +1,79 @@
+# 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 ~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/protobuf-4.25.4.ebuild b/dev-python/protobuf/protobuf-4.25.4.ebuild
new file mode 100644
index 000000000000..defde612e08b
--- /dev/null
+++ b/dev-python/protobuf/protobuf-4.25.4.ebuild
@@ -0,0 +1,29 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Default implementation currently is upb, which doesn't match dev-libs/protobuf
+# https://github.com/protocolbuffers/protobuf/blob/main/python/README.md#implementation-backends
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} )
+PYPI_PN="protobuf"
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Google's Protocol Buffers - Python bindings"
+HOMEPAGE="
+ https://protobuf.dev/
+ https://pypi.org/project/protobuf/
+"
+
+# Rename sdist to avoid conflicts with dev-libs/protobuf
+SRC_URI="
+ $(pypi_sdist_url) -> protobuf-python-${PV}.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1-3)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
diff --git a/dev-python/protobuf/protobuf-5.27.2.ebuild b/dev-python/protobuf/protobuf-5.27.2.ebuild
new file mode 100644
index 000000000000..3ce286ddf0db
--- /dev/null
+++ b/dev-python/protobuf/protobuf-5.27.2.ebuild
@@ -0,0 +1,29 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Default implementation currently is upb, which doesn't match dev-libs/protobuf
+# https://github.com/protocolbuffers/protobuf/blob/main/python/README.md#implementation-backends
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} )
+PYPI_PN="protobuf"
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Google's Protocol Buffers - Python bindings"
+HOMEPAGE="
+ https://protobuf.dev/
+ https://pypi.org/project/protobuf/
+"
+
+# Rename sdist to avoid conflicts with dev-libs/protobuf
+SRC_URI="
+ $(pypi_sdist_url) -> protobuf-python-${PV}.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1-3)"
+KEYWORDS="~alpha amd64 arm arm64 ~loong ~mips ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
diff --git a/dev-python/protobuf/protobuf-5.27.4.ebuild b/dev-python/protobuf/protobuf-5.27.4.ebuild
new file mode 100644
index 000000000000..3ce286ddf0db
--- /dev/null
+++ b/dev-python/protobuf/protobuf-5.27.4.ebuild
@@ -0,0 +1,29 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Default implementation currently is upb, which doesn't match dev-libs/protobuf
+# https://github.com/protocolbuffers/protobuf/blob/main/python/README.md#implementation-backends
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} )
+PYPI_PN="protobuf"
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Google's Protocol Buffers - Python bindings"
+HOMEPAGE="
+ https://protobuf.dev/
+ https://pypi.org/project/protobuf/
+"
+
+# Rename sdist to avoid conflicts with dev-libs/protobuf
+SRC_URI="
+ $(pypi_sdist_url) -> protobuf-python-${PV}.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1-3)"
+KEYWORDS="~alpha amd64 arm arm64 ~loong ~mips ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
diff --git a/dev-python/protobuf/protobuf-5.28.0.ebuild b/dev-python/protobuf/protobuf-5.28.0.ebuild
new file mode 100644
index 000000000000..3ce286ddf0db
--- /dev/null
+++ b/dev-python/protobuf/protobuf-5.28.0.ebuild
@@ -0,0 +1,29 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Default implementation currently is upb, which doesn't match dev-libs/protobuf
+# https://github.com/protocolbuffers/protobuf/blob/main/python/README.md#implementation-backends
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} )
+PYPI_PN="protobuf"
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Google's Protocol Buffers - Python bindings"
+HOMEPAGE="
+ https://protobuf.dev/
+ https://pypi.org/project/protobuf/
+"
+
+# Rename sdist to avoid conflicts with dev-libs/protobuf
+SRC_URI="
+ $(pypi_sdist_url) -> protobuf-python-${PV}.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1-3)"
+KEYWORDS="~alpha amd64 arm arm64 ~loong ~mips ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos"