commit:     3b21c6040943e41bcaa65dc68bf8a9badfc9eb3a
Author:     wangjiezhe <wangjiezhe <AT> gmail <DOT> com>
AuthorDate: Fri Jan 19 11:06:45 2024 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Sat Feb  3 19:32:47 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b21c604

dev-python/protobuf-python: add 4.22.5

Signed-off-by: wangjiezhe <wangjiezhe <AT> gmail.com>
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>

 dev-python/protobuf-python/Manifest                |  1 +
 .../files/protobuf-python-4.22.5-c++-17.patch      | 13 ++++
 .../protobuf-python/protobuf-python-4.22.5.ebuild  | 85 ++++++++++++++++++++++
 3 files changed, 99 insertions(+)

diff --git a/dev-python/protobuf-python/Manifest 
b/dev-python/protobuf-python/Manifest
index 20e1338a9868..8695f23be04a 100644
--- a/dev-python/protobuf-python/Manifest
+++ b/dev-python/protobuf-python/Manifest
@@ -1,3 +1,4 @@
 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-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/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
+}

Reply via email to