commit:     451bfa2b5635bd5188e0e847ef4b26c1a411a512
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Tue Sep 16 14:01:41 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Oct 22 11:34:43 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=451bfa2b

dev-libs/protobuf: add 32.1

Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44225
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/protobuf/Manifest                         |  1 +
 .../{protobuf-9999.ebuild => protobuf-32.1.ebuild} | 67 ++++++++++++++++------
 dev-libs/protobuf/protobuf-9999.ebuild             | 58 +++++++++++++------
 3 files changed, 89 insertions(+), 37 deletions(-)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index c0dbae2dbffd..02133b74f71d 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -4,3 +4,4 @@ DIST protobuf-28.0.tar.gz 9259114 BLAKE2B 
328e09ebffb296d838557ea72a4fc4da8e0ad5
 DIST protobuf-29.5.tar.gz 9338935 BLAKE2B 
cfffcab9e240047c1759f8304b0c2f553bf73c7dc2cfcf101eb1fad3a0f90991e9aa998ca34c7c9534cd4209edf50691e17b75208ae726565505cdb2ab229a7f
 SHA512 
3f3bc241c8babe5988678386d83ef2a75e202bb109f47d62b2ee7915c9b1c080590c2812f6635ba61c41e9570a0aeaa4789cdcba80c917c33ff52ba1817811bb
 DIST protobuf-30.2.tar.gz 9506934 BLAKE2B 
3a7d6bfa38500b16b1ce52b244fd9448fe7be2933a77224a1423a67e3ae3155846c0974ee1b6c579f6050f60b7784ace21b149b3cbdff2ef1e6bf954acbb1b51
 SHA512 
555d1b18d175eeaf17f3879f124d33080f490367840d35b34bfc4e4a5b383bf6a1d09f1570acb6af9c53ac4940a14572d46423b6e3dd0c712e7802c986fb6be6
 DIST protobuf-31.1.tar.gz 9583956 BLAKE2B 
cd15fc6d25bee71681602cf97c19dc04de9900594b0c0648decf418bdcc0cf787315b2238c18cb0b1eaf7b163ddbbfb7853cc5cff635b4841fcb8b20d94825fd
 SHA512 
5bf730e37183defcb29cf4831128f536ad8bcdce2b2b46b297d95f3de4a037b9ff3b6c57df66a039256dcefd828ba9d43c32b01a7a82aa5c881a9ae12cadb643
+DIST protobuf-32.1.tar.gz 9676391 BLAKE2B 
f6c1faa260ecb57c0a1a5d4be7d56e431cac9e325a02b86d9eecd0318a0964618063db218a4720fcb1121614016f112ba00880a5b743a5c34f19f79ea4420735
 SHA512 
e7f8fe01912ba30cc7ce101beac1cfbd089bcb57b159a57d4d90cabd1b29d978ad322f0607e1b955617f035a6b68d4e7bc940fa4afa67d255a21f513a2c62172

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild 
b/dev-libs/protobuf/protobuf-32.1.ebuild
similarity index 72%
copy from dev-libs/protobuf/protobuf-9999.ebuild
copy to dev-libs/protobuf/protobuf-32.1.ebuild
index d9d8b3bf7487..8c53aec0673c 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-32.1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit cmake-multilib dot-a elisp-common flag-o-matic multilib
+inherit cmake-multilib dot-a elisp-common flag-o-matic multilib toolchain-funcs
 
 # NOTE from 
https://github.com/protocolbuffers/protobuf/blob/main/cmake/dependencies.cmake
 ABSEIL_MIN_VER="20250127.0"
@@ -24,7 +24,7 @@ DESCRIPTION="Google's Protocol Buffers - Extensible mechanism 
for serializing st
 HOMEPAGE="https://protobuf.dev/";
 
 LICENSE="BSD"
-IUSE="conformance debug emacs examples +libprotoc libupb +protobuf +protoc 
test zlib"
+IUSE="conformance debug emacs examples +libprotoc +libupb +protobuf +protoc 
test zlib"
 
 # Require protobuf for the time being
 REQUIRED_USE="
@@ -33,6 +33,7 @@ REQUIRED_USE="
        examples? ( protobuf )
        libprotoc? ( protobuf )
        libupb? ( protobuf )
+       protoc? ( libupb )
 "
 
 RESTRICT="!test? ( test )"
@@ -64,7 +65,7 @@ RDEPEND="
 
 PATCHES=(
        "${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
-       "${FILESDIR}/${PN}-28.0-disable-test_upb-lto.patch"
+       # "${FILESDIR}/${PN}-28.0-disable-test_upb-lto.patch" # applied manually
        "${FILESDIR}/${PN}-30.0-findJsonCpp.patch"
 )
 
@@ -73,18 +74,22 @@ DOCS=( CONTRIBUTORS.txt README.md )
 src_prepare() {
        cmake_src_prepare
 
+#      if tc-is-lto; then
+#              eapply "${FILESDIR}/${PN}-28.0-disable-test_upb-lto.patch"
+#      fi
+
        cp "${FILESDIR}/FindJsonCpp.cmake" "${S}/cmake" || die
 }
 
 multilib_src_configure() {
-       # bug #963340 (seems to only happen when upgrading from older pb,
-       # possibly w/o tests too).
-       filter-lto
+       use libupb && filter-lto
 
        # Currently, the only static library is libupb (and there is no
        # USE=static-libs), so optimize away the fat-lto build time penalty.
        use libupb && lto-guarantee-fat
 
+       use libupb && filter-lto
+
        local mycmakeargs=(
                -Dprotobuf_BUILD_CONFORMANCE="$(usex test "$(usex 
conformance)")"
                -Dprotobuf_BUILD_LIBPROTOC="$(usex libprotoc)"
@@ -126,32 +131,56 @@ src_compile() {
        fi
 }
 
+# we override here to inject env vars
+multilib_src_test() {
+       local -x TEST_TMPDIR="${T%/}/TEST_TMPDIR_${ABI}"
+       mkdir -p -m 770 "${TEST_TMPDIR}" || die
+
+       ln -srf "${S}/src" "${BUILD_DIR}/include" || die
+
+       cmake_src_test "${_cmake_args[@]}"
+}
+
 src_test() {
        local -x srcdir="${S}/src"
 
-       # we override here to inject env vars
-       multilib_src_test() {
-               local -x TEST_TMPDIR="${T%/}/TEST_TMPDIR_${ABI}"
-               mkdir -p -m 770 "${TEST_TMPDIR}" || die
-
-               ln -srf "${S}/src" "${BUILD_DIR}/include" || die
+#      local CMAKE_SKIP_TESTS=(
+#              "^full-test$"
+#      )
 
-               cmake_src_test "${_cmake_args[@]}"
-       }
+       local GTEST_SKIP_TESTS=(
+               "PackedTest/12.DecodeEmptyPackedField"
+       )
 
-       # Do headstands for LTO # 942985
-       local -x GTEST_FILTER
-       
GTEST_FILTER="-FileDescriptorSetSource/EncodeDecodeTest*:LazilyBuildDependenciesTest.GeneratedFile:PythonGeneratorTest/PythonGeneratorTest.PythonWithCppFeatures/*"
+       if tc-is-lto; then
+               # Do headstands for LTO # 942985
+               GTEST_SKIP_TESTS+=(
+                       "FileDescriptorSetSource/EncodeDecodeTest*"
+                       "LazilyBuildDependenciesTest.GeneratedFile"
+                       
"PythonGeneratorTest/PythonGeneratorTest.PythonWithCppFeatures/*"
+               )
+       fi
 
-       cmake-multilib_src_test
+       if [[ ! -v GTEST_FILTER ]]; then
+               local -x GTEST_FILTER
+       fi
 
-       GTEST_FILTER="${GTEST_FILTER//-/}"
+       [[ -n ${GTEST_RUN_TESTS[*]} ]] && GTEST_FILTER+="$(IFS=':' ; echo 
"${GTEST_SKIP_TESTS[*]}")"
+       [[ -n ${GTEST_SKIP_TESTS[*]} ]] && 
GTEST_FILTER+="${GTEST_FILTER+:}-$(IFS=':' ; echo "${GTEST_SKIP_TESTS[*]}")"
 
        cmake-multilib_src_test
+
+#      if tc-is-lto; then
+#              # GTEST_FILTER="${GTEST_FILTER//-/}"
+#              GTEST_FILTER="$(IFS=':' ; echo "${GTEST_SKIP_TESTS[*]}")"
+#
+#              cmake-multilib_src_test
+#      fi
 }
 
 multilib_src_install_all() {
        use libupb && strip-lto-bytecode
+
        find "${ED}" -name "*.la" -delete || die
 
        if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf$(get_libname 
"${SLOT#*/}")" ]]; then

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild 
b/dev-libs/protobuf/protobuf-9999.ebuild
index d9d8b3bf7487..1df6a650e0c0 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-9999.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit cmake-multilib dot-a elisp-common flag-o-matic multilib
+inherit cmake-multilib dot-a elisp-common flag-o-matic multilib toolchain-funcs
 
 # NOTE from 
https://github.com/protocolbuffers/protobuf/blob/main/cmake/dependencies.cmake
 ABSEIL_MIN_VER="20250127.0"
@@ -24,7 +24,7 @@ DESCRIPTION="Google's Protocol Buffers - Extensible mechanism 
for serializing st
 HOMEPAGE="https://protobuf.dev/";
 
 LICENSE="BSD"
-IUSE="conformance debug emacs examples +libprotoc libupb +protobuf +protoc 
test zlib"
+IUSE="conformance debug emacs examples +libprotoc +libupb +protobuf +protoc 
test zlib"
 
 # Require protobuf for the time being
 REQUIRED_USE="
@@ -33,6 +33,7 @@ REQUIRED_USE="
        examples? ( protobuf )
        libprotoc? ( protobuf )
        libupb? ( protobuf )
+       protoc? ( libupb )
 "
 
 RESTRICT="!test? ( test )"
@@ -64,7 +65,7 @@ RDEPEND="
 
 PATCHES=(
        "${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
-       "${FILESDIR}/${PN}-28.0-disable-test_upb-lto.patch"
+       # "${FILESDIR}/${PN}-28.0-disable-test_upb-lto.patch" # applied manually
        "${FILESDIR}/${PN}-30.0-findJsonCpp.patch"
 )
 
@@ -73,13 +74,17 @@ DOCS=( CONTRIBUTORS.txt README.md )
 src_prepare() {
        cmake_src_prepare
 
+#      if tc-is-lto; then
+#              eapply "${FILESDIR}/${PN}-28.0-disable-test_upb-lto.patch"
+#      fi
+
        cp "${FILESDIR}/FindJsonCpp.cmake" "${S}/cmake" || die
 }
 
 multilib_src_configure() {
        # bug #963340 (seems to only happen when upgrading from older pb,
        # possibly w/o tests too).
-       filter-lto
+       use libupb && filter-lto
 
        # Currently, the only static library is libupb (and there is no
        # USE=static-libs), so optimize away the fat-lto build time penalty.
@@ -126,28 +131,45 @@ src_compile() {
        fi
 }
 
-src_test() {
-       local -x srcdir="${S}/src"
+# we override here to inject env vars
+multilib_src_test() {
+       local -x TEST_TMPDIR="${T%/}/TEST_TMPDIR_${ABI}"
+       mkdir -p -m 770 "${TEST_TMPDIR}" || die
 
-       # we override here to inject env vars
-       multilib_src_test() {
-               local -x TEST_TMPDIR="${T%/}/TEST_TMPDIR_${ABI}"
-               mkdir -p -m 770 "${TEST_TMPDIR}" || die
+       ln -srf "${S}/src" "${BUILD_DIR}/include" || die
 
-               ln -srf "${S}/src" "${BUILD_DIR}/include" || die
+       cmake_src_test "${_cmake_args[@]}"
+}
 
-               cmake_src_test "${_cmake_args[@]}"
-       }
+src_test() {
+       local -x srcdir="${S}/src"
 
-       # Do headstands for LTO # 942985
-       local -x GTEST_FILTER
-       
GTEST_FILTER="-FileDescriptorSetSource/EncodeDecodeTest*:LazilyBuildDependenciesTest.GeneratedFile:PythonGeneratorTest/PythonGeneratorTest.PythonWithCppFeatures/*"
+       local GTEST_SKIP_TESTS=(
+               "PackedTest/12.DecodeEmptyPackedField"
+       )
 
-       cmake-multilib_src_test
+       if tc-is-lto; then
+               # Do headstands for LTO # 942985
+               GTEST_SKIP_TESTS+=(
+                       "FileDescriptorSetSource/EncodeDecodeTest*"
+                       "LazilyBuildDependenciesTest.GeneratedFile"
+                       
"PythonGeneratorTest/PythonGeneratorTest.PythonWithCppFeatures/*"
+               )
+       fi
 
-       GTEST_FILTER="${GTEST_FILTER//-/}"
+       if [[ ! -v GTEST_FILTER ]]; then
+               local -x GTEST_FILTER
+       fi
+       [[ -n ${GTEST_RUN_TESTS[*]} ]] && GTEST_FILTER+="$(IFS=':' ; echo 
"${GTEST_SKIP_TESTS[*]}")"
+       [[ -n ${GTEST_SKIP_TESTS[*]} ]] && 
GTEST_FILTER+="${GTEST_FILTER+:}-$(IFS=':' ; echo "${GTEST_SKIP_TESTS[*]}")"
 
        cmake-multilib_src_test
+
+#      if tc-is-lto; then
+#              GTEST_FILTER="${GTEST_FILTER//-/}"
+#
+#              cmake-multilib_src_test
+#      fi
 }
 
 multilib_src_install_all() {

Reply via email to