diff options
Diffstat (limited to 'dev-python/protobuf-python')
| -rw-r--r-- | dev-python/protobuf-python/Manifest | 1 | ||||
| -rw-r--r-- | dev-python/protobuf-python/files/editions.patch | 58 | ||||
| -rw-r--r-- | dev-python/protobuf-python/metadata.xml | 2 | ||||
| -rw-r--r-- | dev-python/protobuf-python/protobuf-python-4.21.9.ebuild | 2 | ||||
| -rw-r--r-- | dev-python/protobuf-python/protobuf-python-4.24.0.ebuild | 58 | ||||
| -rw-r--r-- | dev-python/protobuf-python/protobuf-python-9999.ebuild | 80 |
6 files changed, 119 insertions, 82 deletions
diff --git a/dev-python/protobuf-python/Manifest b/dev-python/protobuf-python/Manifest index 85bcbb4bda71..fd3464a8111e 100644 --- a/dev-python/protobuf-python/Manifest +++ b/dev-python/protobuf-python/Manifest @@ -1 +1,2 @@ DIST protobuf-21.9.tar.gz 5110670 BLAKE2B a4f5b7f58e1c5904ca990b100a72992f6f56177b28773f8de8c99e4158391d33cfb8aa8575915887fc9ae4294faf81d4ff6b470bc07b394bfd5885a09ba0fafe SHA512 6954b42d21921e630173b7848c056ab95635627d8eddec960f3db2ddda13eedde00520a9b350722e76e2998649eb8ebe10758e1db938b6a91e38ff3295b1b7c1 +DIST protobuf-24.0.tar.gz 5179150 BLAKE2B a5fdcde3b4d66c1a55ab66943e88ef4e5315c57432fcd3ba4e032e6da0fc0e7b22007bd133d63810ac6af668a5cdc529fac73a3d4012a62d62de0e819e04ac76 SHA512 6c850e4f7355d3dbc2524de152fe16c0bfe83ecaa712850c99e76afaa55ba4b35538df0faf4904f40c18ff0da9846a4f70cff3f5db0fb33a5d020919d3a2158a diff --git a/dev-python/protobuf-python/files/editions.patch b/dev-python/protobuf-python/files/editions.patch new file mode 100644 index 000000000000..bd81416897a9 --- /dev/null +++ b/dev-python/protobuf-python/files/editions.patch @@ -0,0 +1,58 @@ +From 2eee41224e2eac1aa4e8e8f4a28ff11748e49a41 Mon Sep 17 00:00:00 2001 +From: Mike Kruskal <mkruskal@google.com> +Date: Thu, 10 Aug 2023 15:35:41 -0700 +Subject: [PATCH] Remove editions test proto from setup.py. + +This proto is only used in C++ tests, and doesn't need to be built in python. Python doesn't support editions yet, so we should just remove it for now. This also fixes some other issues with setup.py where tests fail. + +Closes #13501 + +PiperOrigin-RevId: 555681295 +--- + python/google/protobuf/internal/descriptor_test.py | 5 ++--- + python/setup.py | 2 +- + 2 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/python/google/protobuf/internal/descriptor_test.py b/python/google/protobuf/internal/descriptor_test.py +index b070bca87dc..b7e8d71f4d6 100755 +--- a/python/google/protobuf/internal/descriptor_test.py ++++ b/python/google/protobuf/internal/descriptor_test.py +@@ -67,7 +67,7 @@ + message ResponseMessage { + } + +-service Service { ++service DescriptorTestService { + rpc CallMethod(.protobuf_unittest.NestedMessage) returns (.protobuf_unittest.ResponseMessage); + } + +@@ -97,8 +97,7 @@ def setUp(self): + enum_proto.value.add(name='FOREIGN_BAZ', number=6) + + file_proto.message_type.add(name='ResponseMessage') +- service_proto = file_proto.service.add( +- name='Service') ++ service_proto = file_proto.service.add(name='DescriptorTestService') + method_proto = service_proto.method.add( + name='CallMethod', + input_type='.protobuf_unittest.NestedMessage', +diff --git a/python/setup.py b/python/setup.py +index e65631013eb..c686ddc25a7 100755 +--- a/python/setup.py ++++ b/python/setup.py +@@ -131,7 +131,6 @@ def GenerateUnittestProtos(): + GenProto('../src/google/protobuf/map_unittest.proto', False) + GenProto('../src/google/protobuf/test_messages_proto3.proto', False) + GenProto('../src/google/protobuf/test_messages_proto2.proto', False) +- GenProto('../src/google/protobuf/unittest_arena.proto', False) + GenProto('../src/google/protobuf/unittest.proto', False) + GenProto('../src/google/protobuf/unittest_custom_options.proto', False) + GenProto('../src/google/protobuf/unittest_import.proto', False) +@@ -140,6 +139,7 @@ def GenerateUnittestProtos(): + GenProto('../src/google/protobuf/unittest_mset_wire_format.proto', False) + GenProto('../src/google/protobuf/unittest_no_generic_services.proto', False) + GenProto('../src/google/protobuf/unittest_proto3_arena.proto', False) ++ GenProto('../src/google/protobuf/unittest_retention.proto', False) + GenProto('../src/google/protobuf/util/json_format.proto', False) + GenProto('../src/google/protobuf/util/json_format_proto3.proto', False) + GenProto('google/protobuf/internal/any_test.proto', False) diff --git a/dev-python/protobuf-python/metadata.xml b/dev-python/protobuf-python/metadata.xml index 93fdb41b6e37..618c14fd4a43 100644 --- a/dev-python/protobuf-python/metadata.xml +++ b/dev-python/protobuf-python/metadata.xml @@ -10,7 +10,7 @@ <name>Cjk</name> </maintainer> - <origin>gentoo-staging</origin> + <origin>ports</origin> <slots> <subslots>Soname version number of Protobuf</subslots> </slots> diff --git a/dev-python/protobuf-python/protobuf-python-4.21.9.ebuild b/dev-python/protobuf-python/protobuf-python-4.21.9.ebuild index 0f090987f996..bb717e07e836 100644 --- a/dev-python/protobuf-python/protobuf-python-4.21.9.ebuild +++ b/dev-python/protobuf-python/protobuf-python-4.21.9.ebuild @@ -24,7 +24,7 @@ else 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" + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos" fi DESCRIPTION="Google's Protocol Buffers - Python bindings" diff --git a/dev-python/protobuf-python/protobuf-python-4.24.0.ebuild b/dev-python/protobuf-python/protobuf-python-4.24.0.ebuild new file mode 100644 index 000000000000..8c74e01cec58 --- /dev/null +++ b/dev-python/protobuf-python/protobuf-python-4.24.0.ebuild @@ -0,0 +1,58 @@ +# Copyright 2023 Liguros Authors +# Distributed under the terms of the GNU General Public License v2 +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{7,8,9,10,11} ) + +inherit distutils-r1 flag-o-matic + +PARENT_PN="${PN/-python/}" +PARENT_PV="$(ver_cut 2-)" +PARENT_P="${PARENT_PN}-${PARENT_PV}" + +SRC_URI=" + https://github.com/protocolbuffers/protobuf/archive/v${PARENT_PV}.tar.gz -> ${PARENT_P}.tar.gz +" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos" + +DESCRIPTION="Google's Protocol Buffers - Python bindings" +HOMEPAGE=" + https://developers.google.com/protocol-buffers/ + https://pypi.org/project/protobuf/ +" + +LICENSE="BSD" +SLOT="0/23" + +S="${WORKDIR}/${PARENT_P}/python" + +BDEPEND=" +" +DEPEND=" + ${PYTHON_DEPS} +" +RDEPEND=" + ${BDEPEND} + dev-libs/protobuf:${SLOT} +" + +distutils_enable_tests setup.py + +python_prepare_all() { + eapply -p2 ${FILESDIR}/editions.patch + eapply_user + + distutils-r1_python_prepare_all +} + +src_configure() { + append-cxxflags -std=c++17 + 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 deleted file mode 100644 index 1c20e7fa7ff2..000000000000 --- a/dev-python/protobuf-python/protobuf-python-9999.ebuild +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright 2008-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{7,8,9,10,11} ) - -inherit distutils-r1 - -PARENT_PN="${PN/-python/}" -PARENT_PV="${PV}" -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=" - dev-libs/protobuf:${SLOT} - dev-python/six[${PYTHON_USEDEP}] -" -DEPEND=" - ${PYTHON_DEPS} - dev-libs/protobuf:${SLOT} -" -RDEPEND=" - ${BDEPEND} -" - -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 -} |
