From 6e8f2ebdce568f2c6c7870edbb9db5324a0e300f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 27 Oct 2022 03:56:50 +0100 Subject: gentoo auto-resync : 27:10:2022 - 03:56:50 --- dev-python/protobuf-python/Manifest | 6 +- .../files/protobuf-python-3.20.3-python311.patch | 132 +++++++++++++++++++++ .../files/protobuf-python-4.21.8-python311.patch | 132 --------------------- .../protobuf-python/protobuf-python-3.20.3.ebuild | 1 + .../protobuf-python/protobuf-python-4.21.8.ebuild | 2 +- 5 files changed, 137 insertions(+), 136 deletions(-) create mode 100644 dev-python/protobuf-python/files/protobuf-python-3.20.3-python311.patch delete mode 100644 dev-python/protobuf-python/files/protobuf-python-4.21.8-python311.patch (limited to 'dev-python/protobuf-python') diff --git a/dev-python/protobuf-python/Manifest b/dev-python/protobuf-python/Manifest index 25ad3bd0c713..b0a899d4d4a9 100644 --- a/dev-python/protobuf-python/Manifest +++ b/dev-python/protobuf-python/Manifest @@ -1,5 +1,5 @@ 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 +AUX protobuf-python-3.20.3-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 @@ -9,7 +9,7 @@ EBUILD protobuf-python-3.19.3-r2.ebuild 1521 BLAKE2B fa114bf35d495311e22ba3c14c5 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-3.20.3.ebuild 1662 BLAKE2B f8c5468fa201273c2ad2b28a6f6bf72b1bc1a037b84362495ac4aca6761229e8a708cdfc4507e7e34a0f85966973b5552eb9c956ce70abe9cd12997fc3ae451a SHA512 13df3aeb24a661ed515faa085cfc1d55a19291d2b529c2388ffa566e64a0fe836bac68aea1db60fa8c3424ccb522727776d8828c8b106a2b1d00d546b8214489 -EBUILD protobuf-python-4.21.8.ebuild 1706 BLAKE2B 867e59c78fde17bc29be66af090835bd6f6550619005ac35b196631036353a22711f97d167628138636ef78df484e279c979297e3255bd3ef985f3d98d858792 SHA512 1250ad6e565da0ee24774d1610cf6012b9e03f6b10d641f458f7a0c668629082474a4bba1bbec717a450654042b41c9cfa126032d37d304669cb976a02f919e9 +EBUILD protobuf-python-3.20.3.ebuild 1706 BLAKE2B 938d6441352ad78d933fe61e96d68a0506b44fbc6d5838ac511fed9a89a2eee4fa3b98cd7f5de5cbc093903cc0c1648381dc450d676cc35699d86b2b74c8e6d3 SHA512 dd90ddfa5303159bc10c966e3ef245e57f0068e0bc6185aacd94be11e1a249ebe884bee33d4450a4f98c5a472d5ebcbdb6e249036faab5ae8a89bbc9837eab78 +EBUILD protobuf-python-4.21.8.ebuild 1714 BLAKE2B e500f0ecf1821870d298b997665112b67a356a4bdb8a87d7214a2a51992d0730f175c62efcf56face417bda61aaedf026a43104b3f399e83abb1da3288ab3365 SHA512 cd533b3bf62bf1e55376d11ca8684ff51597c8ded9fb6559469759459653c5139da6c3c442287f1ebbbb99b0058f533cf1be49f7df01f8b8ce47c80608431a69 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-3.20.3-python311.patch b/dev-python/protobuf-python/files/protobuf-python-3.20.3-python311.patch new file mode 100644 index 000000000000..b9aca40776c5 --- /dev/null +++ b/dev-python/protobuf-python/files/protobuf-python-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 +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/files/protobuf-python-4.21.8-python311.patch b/dev-python/protobuf-python/files/protobuf-python-4.21.8-python311.patch deleted file mode 100644 index b9aca40776c5..000000000000 --- a/dev-python/protobuf-python/files/protobuf-python-4.21.8-python311.patch +++ /dev/null @@ -1,132 +0,0 @@ -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 -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.20.3.ebuild b/dev-python/protobuf-python/protobuf-python-3.20.3.ebuild index 80c782e2fbdc..3b2a8fa16265 100644 --- a/dev-python/protobuf-python/protobuf-python-3.20.3.ebuild +++ b/dev-python/protobuf-python/protobuf-python-3.20.3.ebuild @@ -57,6 +57,7 @@ PARENT_PATCHES=( # Here for patches within "python/" subdirectory. PATCHES=( + "${FILESDIR}"/${PN}-3.20.3-python311.patch ) python_prepare_all() { diff --git a/dev-python/protobuf-python/protobuf-python-4.21.8.ebuild b/dev-python/protobuf-python/protobuf-python-4.21.8.ebuild index 572a571542c6..884546edf04c 100644 --- a/dev-python/protobuf-python/protobuf-python-4.21.8.ebuild +++ b/dev-python/protobuf-python/protobuf-python-4.21.8.ebuild @@ -57,7 +57,7 @@ PARENT_PATCHES=( # Here for patches within "python/" subdirectory. PATCHES=( - "${FILESDIR}"/${P}-python311.patch + "${FILESDIR}"/${PN}-3.20.3-python311.patch ) python_prepare_all() { -- cgit v1.2.3