summaryrefslogtreecommitdiff
path: root/dev-python/protobuf-python
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-10-26 03:54:55 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-10-26 03:54:55 +0100
commit2ecd7994be1409f2a65bfca700904d2a78fd7bbe (patch)
tree0248ea4d4f411ea88c27470c15ebc725bb04baa1 /dev-python/protobuf-python
parentc22e93ab35a8cb604c41623a7b2cda059c462b70 (diff)
gentoo auto-resync : 26:10:2022 - 03:54:55
Diffstat (limited to 'dev-python/protobuf-python')
-rw-r--r--dev-python/protobuf-python/Manifest9
-rw-r--r--dev-python/protobuf-python/files/protobuf-python-4.21.8-python311.patch132
-rw-r--r--dev-python/protobuf-python/protobuf-python-3.19.6.ebuild79
-rw-r--r--dev-python/protobuf-python/protobuf-python-3.20.3.ebuild78
-rw-r--r--dev-python/protobuf-python/protobuf-python-4.21.8.ebuild79
-rw-r--r--dev-python/protobuf-python/protobuf-python-9999.ebuild55
6 files changed, 408 insertions, 24 deletions
diff --git a/dev-python/protobuf-python/Manifest b/dev-python/protobuf-python/Manifest
index 00112ba55fdb..25ad3bd0c713 100644
--- a/dev-python/protobuf-python/Manifest
+++ b/dev-python/protobuf-python/Manifest
@@ -1,8 +1,15 @@
AUX protobuf-python-3.19.0-google.protobuf.pyext._message.PyUnknownFieldRef.patch 1743 BLAKE2B c21d80a6cd218068d2a910ccd12c314810bd2eb679b59f79ba8d4d694948841d0fd8a56e921fed6f347ae9235f33903d79a038e8ae8659ea65bb59dbf7d7d9ea SHA512 7822b826d62585c48acebf04083546a3ebf8f6570854da8bddac3cc40554e71eaf57e9579c314ada33cf5bd0837cae23a3ef1057e44f6234d1d4a591c8036678
+AUX protobuf-python-4.21.8-python311.patch 3717 BLAKE2B f3a0b1b06bdbc2222fd3817b87f9b80cf609e9eb410770af31a069396eb68417f37c06603229ac8fc6aca958a9f8c0deec6b5f0812df6d7dac214b3f8622da29 SHA512 dd03b34b06e67aa4dc16281902e4676ee55169343d062b9515195ff9c92fc9cca4aaa24f83309b7f150f67a49356c41e22380bd68231dab7df04ac1c127f096f
+DIST protobuf-21.8.tar.gz 5110670 BLAKE2B 3c1b0c857a86e9586481d63896341d0cb11290dbd710d87a6f7889d34f5f262abe2986a29ed19a730f8fa5df0b5c62d77a4db6aa415a72b239f7483ae8d6380c SHA512 cb17be759311e91172801add1f88fe7a0291b547170c40d2e3303f5c248570dddeade96bd48740edd628215f55269c97475e2f4c4a41c50f1018d525f52036cb
DIST protobuf-3.19.3.tar.gz 5293258 BLAKE2B c05b70ffca97f7166ea6a511a36907eed125edf1ebf17f908718221d9b851be84dfb2b1b39973f2faf35f6ade630e6ba4f9e8b91b8fbc922c5db97079323ee6e SHA512 1c003e7cbc8eae6a038f46e688b401ee202ba47f502561e909df79770f6e8b7daf3dc1ccc727e31bfb5b52cd04cb4fef7d2d2a28d650c13f396872ad4aa076c6
+DIST protobuf-3.19.6.tar.gz 5299501 BLAKE2B 3121f76b95f83c5309ce49ce296b738eff7be9d3a5093c564fbe2339fb5f3729e406f1b44bfcc05feb0d31ab63838bb4f54685017977c73a33b91215a6776072 SHA512 8f92242f2be8e1bbfba41341c87709ad91ad83b8b3e3df88bb430411541d3399295f49291fd52b50e3487b0fce33181cb4d175685fd25aac72adfaee26a612d4
DIST protobuf-3.20.1.tar.gz 5368262 BLAKE2B 1ce1aef2e4c4f3ea4863629cc75d89fe17d0c7ac0c342ac641c787456fd4a12756c2892a27ddadedc94a7201494ec84566638ce33a03cb0c867b04e9eee0edb3 SHA512 fde3eb9f13946887ddfd87df428c5615ad09aaf191e4478b24e98e5e13231feeff4e70b4ca6a2ff7d9b9b2e2c60bc1d5479526edeafa78f9a8ed3bef2e0bacb0
+DIST protobuf-3.20.3.tar.gz 5374320 BLAKE2B fb51f2a0ecf5b83235f5252051f8192ae377bb7a5e030c3f3e9435ccde25919c059830cf476e840fa6c970928a32c0075e213c9d5d4d9e3d3b24732c39a9fbfa SHA512 01d6703bdbe769a1200ee6e4ebcdcb99688ec21f576988c60d82ec36e0822820fb245fcb4ca53293143d53e666d748b5a0c6937bc659fb3cdc4cd9b05ed12a1c
EBUILD protobuf-python-3.19.3-r2.ebuild 1521 BLAKE2B fa114bf35d495311e22ba3c14c5ddb7786b0841f490eea785e7f9d74b3106e9163d7f257a7807f02322391d467bedac1553b677ff6f6902d72731246bf6a8c8a SHA512 c018c87e6c104d9c30fa6aa8088bf67d241580dab165b3a7da1443ee715d372a2371e76741863310e85cb225cf23f42b468b1b1c46cae3c3d60409012d9702ff
EBUILD protobuf-python-3.19.3-r3.ebuild 1598 BLAKE2B 081d83d76faa14c2937203a3aaa66c326b3d495ab5679e749ea4bcf55418d93da7eb80c98082930e539ea46afcfd118e9542f129f280b0d011990d5d262dfbff SHA512 d0d714420b8598fce1300d463c71c5455b1fe9afb14119527614bdb51ee4ff5665064dd918303acb636d548696de55ede2cf273be3d5988b8abfd925b714c45a
+EBUILD protobuf-python-3.19.6.ebuild 1745 BLAKE2B b4a48882580da78eb0544d211fb950be7da985b70bf906d81fefe3dcd7991d46ce937735261e64e7560153e13e524dbc2445409a987d9c0ec5bcb6bbdbe5ee43 SHA512 80c550e72d84f897189b9f3b97c466bbb2732976b2485ea20b5fe39b68eb9aee0e44aceed8a6956bcdb06da9e465dfa750531e31ec34d7c42f2a61060327e395
EBUILD protobuf-python-3.20.1.ebuild 1512 BLAKE2B 9826dc63b7dd36a16b5ff21431466386dd7f853d19ea4ad20399ce4a1b9855f03ebc06cdc9c90b5270ac4919b4919832a520729e0c1db3df2e53f80383e7e4f4 SHA512 7a2047e3c7e2fb3ab24764deb24a0fd9cdb2343ed7d53a42a0aa5ac5e365590699477616a2e2961467872ed1951a1422d4d41a6d6ddff521c2ca8c4b5ee92afb
-EBUILD protobuf-python-9999.ebuild 1403 BLAKE2B a3212b6bd2f93ae71951e9ec8978394e660423d83cf937a3703e10ab6dfde0ebf2d5676b981c96d9dba5477a0d862b66a69cdde2ab3275134f12fc925301d1ee SHA512 6cf1111e3d591acd3642ee225d448e7887549e0a396cd94b3edd76b368a35b28b1d25ae5a946998c087309117890810b9ede95d6a170ad9926d8948d9819fc74
+EBUILD protobuf-python-3.20.3.ebuild 1662 BLAKE2B f8c5468fa201273c2ad2b28a6f6bf72b1bc1a037b84362495ac4aca6761229e8a708cdfc4507e7e34a0f85966973b5552eb9c956ce70abe9cd12997fc3ae451a SHA512 13df3aeb24a661ed515faa085cfc1d55a19291d2b529c2388ffa566e64a0fe836bac68aea1db60fa8c3424ccb522727776d8828c8b106a2b1d00d546b8214489
+EBUILD protobuf-python-4.21.8.ebuild 1706 BLAKE2B 867e59c78fde17bc29be66af090835bd6f6550619005ac35b196631036353a22711f97d167628138636ef78df484e279c979297e3255bd3ef985f3d98d858792 SHA512 1250ad6e565da0ee24774d1610cf6012b9e03f6b10d641f458f7a0c668629082474a4bba1bbec717a450654042b41c9cfa126032d37d304669cb976a02f919e9
+EBUILD protobuf-python-9999.ebuild 1723 BLAKE2B a09d187382486e66c363b03a441e45168f4bd9d57e83e1c3cae81874da623c70a67af9de4dd09d7405b9b95c6cad757087c53ca6739714831386a0e0eb921a6f SHA512 dbc65d2d16248ead6e9cdba28cf19afa509286cf3759cc2fa7285c66c025523219f0845e7fbefad0b6cee9ab2d1091d279bcc0ab89b29f9f5a0c31619e7660d3
MISC metadata.xml 548 BLAKE2B 2468487e12d536d67daebf5b7a21cd63a9c4af321a8979132e63d9b8394bf577e347f891326c73bfa6907e82ca355ea0d4ec40a37bb297db0da1e55a62b6ef33 SHA512 c0c2556fbf8821f3a75ed344daa59b4fc355029f96efb8f9784f54c819916adeb46b2c5d8c2e8d405dc58395c2f18b30cda69c6d406948a066bd1d78a55df80b
diff --git a/dev-python/protobuf-python/files/protobuf-python-4.21.8-python311.patch b/dev-python/protobuf-python/files/protobuf-python-4.21.8-python311.patch
new file mode 100644
index 000000000000..b9aca40776c5
--- /dev/null
+++ b/dev-python/protobuf-python/files/protobuf-python-4.21.8-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/protobuf-python-3.19.6.ebuild b/dev-python/protobuf-python/protobuf-python-3.19.6.ebuild
new file mode 100644
index 000000000000..dc9a76ba6458
--- /dev/null
+++ b/dev-python/protobuf-python/protobuf-python-3.19.6.ebuild
@@ -0,0 +1,79 @@
+# Copyright 2008-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} )
+
+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 ~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/30"
+
+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=(
+ "${FILESDIR}/${PN}-3.19.0-google.protobuf.pyext._message.PyUnknownFieldRef.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
+}
diff --git a/dev-python/protobuf-python/protobuf-python-3.20.3.ebuild b/dev-python/protobuf-python/protobuf-python-3.20.3.ebuild
new file mode 100644
index 000000000000..80c782e2fbdc
--- /dev/null
+++ b/dev-python/protobuf-python/protobuf-python-3.20.3.ebuild
@@ -0,0 +1,78 @@
+# Copyright 2008-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..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 ~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/31"
+
+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-4.21.8.ebuild b/dev-python/protobuf-python/protobuf-python-4.21.8.ebuild
new file mode 100644
index 000000000000..572a571542c6
--- /dev/null
+++ b/dev-python/protobuf-python/protobuf-python-4.21.8.ebuild
@@ -0,0 +1,79 @@
+# Copyright 2008-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..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 ~hppa ~ia64 ~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}"/${P}-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-9999.ebuild b/dev-python/protobuf-python/protobuf-python-9999.ebuild
index 3541dfec56fd..21144493ec0e 100644
--- a/dev-python/protobuf-python/protobuf-python-9999.ebuild
+++ b/dev-python/protobuf-python/protobuf-python-9999.ebuild
@@ -4,57 +4,66 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_COMPAT=( python3_{8..11} )
inherit distutils-r1
-if [[ "${PV}" == "9999" ]]; then
+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"
+ 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 ~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://github.com/protocolbuffers/protobuf/
https://pypi.org/project/protobuf/
"
-if [[ "${PV}" != "9999" ]]; then
- SRC_URI="
- https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz
- -> protobuf-${PV}.tar.gz
- "
-fi
-S="${WORKDIR}/protobuf-${PV}/python"
LICENSE="BSD"
-SLOT="0/30"
-KEYWORDS=""
+SLOT="0/32"
+
+S="${WORKDIR}/${PARENT_P}/python"
BDEPEND="
- ${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}
+ dev-libs/protobuf:${SLOT}
dev-python/six[${PYTHON_USEDEP}]
"
DEPEND="
${PYTHON_DEPS}
- ~dev-libs/protobuf-${PV}
+ dev-libs/protobuf:${SLOT}
"
RDEPEND="
${BDEPEND}
- !dev-python/namespace-google
"
-if [[ "${PV}" == "9999" ]]; then
- EGIT_CHECKOUT_DIR="${WORKDIR}/protobuf-${PV}"
-fi
-
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
+ pushd "${WORKDIR}/${PARENT_P}" > /dev/null || die
+ [[ -n "${PARENT_PATCHES[@]}" ]] && eapply "${PARENT_PATCHES[@]}"
eapply_user
popd > /dev/null || die
@@ -62,7 +71,7 @@ python_prepare_all() {
}
src_configure() {
- DISTUTILS_ARGS=(--cpp_implementation)
+ DISTUTILS_ARGS=( --cpp_implementation )
}
python_compile() {