summaryrefslogtreecommitdiff
path: root/dev-python/protobuf
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-11-14 03:02:32 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-11-14 03:02:32 +0000
commitd3c7d3e5f9607edef1a795ccc502ab3eb3121165 (patch)
treed36ccc4ef4aa53927a8cd66bc5d3ab06fe1bdd24 /dev-python/protobuf
parent4dc2f97ed84159736ecfb5dea5485e83b27810d1 (diff)
gentoo auto-resync : 14:11:2024 - 03:02:32
Diffstat (limited to 'dev-python/protobuf')
-rw-r--r--dev-python/protobuf/Manifest20
-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, 641 insertions, 0 deletions
diff --git a/dev-python/protobuf/Manifest b/dev-python/protobuf/Manifest
new file mode 100644
index 000000000000..ca7f427cf19b
--- /dev/null
+++ b/dev-python/protobuf/Manifest
@@ -0,0 +1,20 @@
+AUX protobuf-3.20.3-python311.patch 3717 BLAKE2B f3a0b1b06bdbc2222fd3817b87f9b80cf609e9eb410770af31a069396eb68417f37c06603229ac8fc6aca958a9f8c0deec6b5f0812df6d7dac214b3f8622da29 SHA512 dd03b34b06e67aa4dc16281902e4676ee55169343d062b9515195ff9c92fc9cca4aaa24f83309b7f150f67a49356c41e22380bd68231dab7df04ac1c127f096f
+AUX protobuf-4.22.5-c++-17.patch 529 BLAKE2B 1d194a6de009b0f9f2dcb7a3d7813efe354e62c7ccaf26f272bff1eda6ae857380d8b7913552147e54da8d223f85e721e359cf2e078da5d8aed223e8787ef2d8 SHA512 2d408dd3592c26855e24b6968daed2db9b3b97272a94e115e775f4cda00fae0eaec61e266af28d82614dd029212be0fa16299130d7830c832b6ebd776db3da1b
+AUX protobuf-4.22.5-python.patch 1070 BLAKE2B aee5dfdbbbddfbd0ecf7dbc29490701c609347d32bac85916042aafadb5bf2bf803ec121bb4d7163f54a083eec571701c18775a97067a6cb8dcc6a46d265f241 SHA512 89f7a1563809a0c60bf5a49e4f28d0d58d04d7153d545bfcd3e54f76756372424813b8c520b3f05e10cdcb3e239217446326c34e8396d1640ac8065bc5a04a1f
+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-5.28.0.py.tar.gz 422388 BLAKE2B 208f92bdb2bc0b92dca76de4d13eda0c98bc4784cb2ce9d57690682d9327fb2a66646241ecc02e96be602b6763b177b3192ca457732540d1fa8c33afecd8d76f SHA512 91f05915ace778ee76a07856049410c48c02a665f6c4665df9ac3e32992a67235a93fb4e19c9f991821652f236b87749c3d79cfabd8c6508fdc17a2ee612cee5
+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
+EBUILD protobuf-4.21.12.ebuild 1711 BLAKE2B eefe5bc310013fc007050f7baf0be7d3c4370ced384fae6ea824941bb3767af129fcb0a5828ed6a572010f623e733cc858f9d8e27de800f47d7655aed590a603 SHA512 b62a8d8920a68081ed7e1d6fabfbd71f92eec828d431b3a67adcba4bfd4bd8a53fe3004c507bea115f44bdcee4be0d0d8192318be90eadbba269819104e16739
+EBUILD protobuf-4.21.9.ebuild 1846 BLAKE2B df3a526073190e63bf42808f5d1b05b759a8002a23c593b51ff88c143e49a0c1cbf01c8ef53cc60167d70630392c4059d307edc35fa2724055e26ebd699453ab SHA512 87627fe4fa4ba8f200efc40c679d6b1c5ee3c5ed7336dd506d110940fbcd6d3b5b638cd43560888c428c7901ca9c1375e1af06eb0d85ad62199c38abeca009ef
+EBUILD protobuf-4.22.5.ebuild 1882 BLAKE2B 1e396eee398034d49bab504eb6872cb377a6324b1f4f2d172e2d4764d8d59116db84e0abdbde537704fb9329fa1bb8459988ce85c6e3303d6990fded37924647 SHA512 acf574eabebcca95529c94876b3bcaca16e84bde632194d145fb90487b1b980ab7ee1907bd247c4532394960eaa3c0c06db24111db6df518721247cc5f959e28
+EBUILD protobuf-4.23.3.ebuild 1673 BLAKE2B cec3e11a0f348852ec2fbaa3929736a79496fad7719de37731b0478bd5b1a7b1ee7c40eb604ab8e2d52a628f93159ee12118534c52efd037e82a59196ebdfd78 SHA512 a1f7f11412cc0779c342b6e1a7ff150cfff7cf990ac4e016cbcd46c3b4a8639430bf7cf13cc4e58bb2008d39c657a67228c0f2c13bdd5442b542b91753662e4b
+EBUILD protobuf-4.25.4.ebuild 823 BLAKE2B 95086249e52573ff65313267546f2695e75a16e0e3ae2c3712ed846c61590362a2f24d29447cc79e8563859ebeed447b9a9ce2bad0b8ad2e16f8bed165852d3e SHA512 892978318aa0918235dacfecfe0ae1ac306874f708a2db608cda4274a435e9d92605636b6a390a65c47589e90a19001223218eef4c3c00e04a75dcb0639b2ee0
+EBUILD protobuf-5.27.2.ebuild 818 BLAKE2B 79a37b05c9014099e6dce287ffbfa5dc9733c6a26a0985c0654abe5ec6d595ae2f3eb8a786a6502877e22b7c82a2a226beb80c916fe70c9e51b761d4768f2f99 SHA512 7ee8d9499574715b8cb6e1980c2d245c0299a3e1fb4f6fc948717e3da5c3776f2c80abe15dbb69678c3ab33bd611de86158a6163c4bae7b1d311c03e18d9ca9e
+EBUILD protobuf-5.27.4.ebuild 818 BLAKE2B 79a37b05c9014099e6dce287ffbfa5dc9733c6a26a0985c0654abe5ec6d595ae2f3eb8a786a6502877e22b7c82a2a226beb80c916fe70c9e51b761d4768f2f99 SHA512 7ee8d9499574715b8cb6e1980c2d245c0299a3e1fb4f6fc948717e3da5c3776f2c80abe15dbb69678c3ab33bd611de86158a6163c4bae7b1d311c03e18d9ca9e
+EBUILD protobuf-5.28.0.ebuild 804 BLAKE2B 7b757e7ba7f0d6a3937e3baae425aa54ce567dba45a064a69485925c75e14296bde24dca6baf385095e31c780d13d87cf79a1bd688ae824175a104a20d0f0797 SHA512 db64c931ec3f5ad5613ee2219e70b6375c0dbfd8383d990ca999d5d41363b62f90da8952039479e9aa8ec9de0c06a4fb34c2721364a79d57bc42c996eefa7d1b
+MISC metadata.xml 379 BLAKE2B 633742f2c32c646e3c7f065d269b5d17fc99b3adcae725493ca612cd9ce6bda0f2521274619c3433f68227428aad897e783ac4b91dbd983216c0355619015197 SHA512 7d3a14e66af994e2fae5509b7d84012b0004d124021f3eae1a1c112ad0e2a83f622de9d2c7a614f19bac8a15ba889fe1b4136c93c57b9dd910511587d3d09af9
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..6f2bfd580e7a
--- /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) -> ${P}.py.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"