commit:     500e56f73c763ea8b5bb061a522537a9c6ca5cc6
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Sun Jul  7 11:52:51 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jul  9 12:51:23 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=500e56f7

dev-cpp/protobuf: add 27.2, 26.1-r2, 25.3, 24.4, 23.4, 22.5-r2, 9999

Closes: https://bugs.gentoo.org/915325
Closes: https://bugs.gentoo.org/917303
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/protobuf/Manifest                |   4 +
 dev-libs/protobuf/metadata.xml            |  16 ++-
 dev-libs/protobuf/protobuf-22.5-r2.ebuild | 133 +++++++++++++++++++++++++
 dev-libs/protobuf/protobuf-23.4.ebuild    | 126 +++++++++++++++++++++++
 dev-libs/protobuf/protobuf-24.4.ebuild    | 125 +++++++++++++++++++++++
 dev-libs/protobuf/protobuf-25.3.ebuild    | 125 +++++++++++++++++++++++
 dev-libs/protobuf/protobuf-26.1-r2.ebuild | 125 +++++++++++++++++++++++
 dev-libs/protobuf/protobuf-27.2.ebuild    | 160 ++++++++++++++++++++++++++++++
 dev-libs/protobuf/protobuf-9999.ebuild    | 160 ++++++++++++++++++++++++++++++
 profiles/package.mask                     |   8 --
 10 files changed, 973 insertions(+), 9 deletions(-)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index 491e8fa19f28..af1849aaafc2 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -2,4 +2,8 @@ DIST protobuf-21.12.tar.gz 5141166 BLAKE2B 
33500612d103afb817062486a741e8e5503f8
 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
+DIST protobuf-23.4.tar.gz 5043507 BLAKE2B 
bf6a50771eb977ef92b779a32fd909693faae6394254c73e3c9b2729bce643f8cbfb5a1bd18b30abf3003b9fbfd24c074cea4085a6ccf14fdb6a3aeac9efcb89
 SHA512 
b93a4e0339ecbe085796de5b6c61feae35229d40db9019c043090bcaa483a1cce78a99487c5638482c68832fcede5579a0e5ec731221a88359b80db9bb6dc566
+DIST protobuf-24.4.tar.gz 5180235 BLAKE2B 
1c7e9035d9f3810886baaea7d679414c882463c79828c99dd8895a9549638c1ca17f9ab3b38d461019f3e1412d9cb9584b995b1da99866eb6fdbb8bdeb063e6f
 SHA512 
52b6ab5587d03cbd1f35cf3cdc388e1710fa50f3031559ac53cf754965407ded7602cdead56080444ab695588112cc3391a1d7fdd5e565d90d0af7ad08706315
+DIST protobuf-25.3.tar.gz 5878962 BLAKE2B 
9268f9bd993a1cfd6d3937a2ad56ba4cfe3d84923756513841cbf13039d4a07acb260468745cb1294f30334cb34b45c6fde272f5c40d9de63ac6a4ce5c263077
 SHA512 
1f73e237c919082e5423ae9e2ea8813dccf672c059051d1531fe89ffaa45872d3cf3052b8c3af26f674296ec17d7dc861c67b8f0834ed80261ce4a6a14ed7115
 DIST protobuf-26.1.tar.gz 5957903 BLAKE2B 
1a7faab2f56aa0995801a80f73a812c7fc38a00af0bf25bdd5eecf7aec27a86a575ea2fb8484787d19c9ac6e46007c9864e79464f529c446f31af732981feed1
 SHA512 
0363ac09f92d8e040491425d444c8dca0b9b430e02d2dff6e2b28a0c2b2bea0d33a47f50bc9e2e2d4e8e22b65a02009a20c0066fb89c75df93a7b703dda42ed4
+DIST protobuf-27.2.tar.gz 6282174 BLAKE2B 
86d12e9f87e8e1c2961ad517115c8689a8dd984722513816d8d626e59a76f5e7a698a90cbf6007daacf66c6053c9ff28108ff113579a442ce61cd221178bda44
 SHA512 
664c66b62cf1ed0c65d9b910d8e67d4d5d471113697f1b8edf1573cd5c0fc8e850ac53ce984e48e6c6b9cbbefa12f8530058384e7388e65a59c1e46d03772397

diff --git a/dev-libs/protobuf/metadata.xml b/dev-libs/protobuf/metadata.xml
index 8549a8aa96f0..8d3f48cb805e 100644
--- a/dev-libs/protobuf/metadata.xml
+++ b/dev-libs/protobuf/metadata.xml
@@ -1,7 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
 <pkgmetadata>
-       <!-- maintainer-needed -->
+       <maintainer type="person" proxied="yes">
+               <email>negril.nx+gen...@gmail.com</email>
+               <name>Paul Zander</name>
+       </maintainer>
+       <maintainer type="project" proxied="proxy">
+               <email>proxy-ma...@gentoo.org</email>
+               <name>Proxy Maintainers</name>
+       </maintainer>
        <slots>
                <subslots>Soname version number</subslots>
        </slots>
@@ -9,4 +16,11 @@
                <remote-id type="cpe">cpe:/a:google:protobuf</remote-id>
                <remote-id type="github">protocolbuffers/protobuf</remote-id>
        </upstream>
+       <use>
+               <flag name="conformance">Build conformance tests</flag>
+               <flag name="libprotoc">Build libprotoc</flag>
+               <flag name="libupb">Build libupb</flag>
+               <flag name="protobuf">Build protobuf libraries and protoc 
compiler</flag>
+               <flag name="protoc">Build libprotoc and protoc compiler</flag>
+       </use>
 </pkgmetadata>

diff --git a/dev-libs/protobuf/protobuf-22.5-r2.ebuild 
b/dev-libs/protobuf/protobuf-22.5-r2.ebuild
new file mode 100644
index 000000000000..b8dbe905360c
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-22.5-r2.ebuild
@@ -0,0 +1,133 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib elisp-common flag-o-matic toolchain-funcs
+
+ABSEIL_BRANCH="lts_2023_01_25" # NOTE from 
https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+
+ABSEIL_MIN_VER="${ABSEIL_BRANCH//lts_}"
+ABSEIL_MIN_VER="${ABSEIL_MIN_VER//_/}"
+
+if [[ "${PV}" == *9999 ]]; then
+       EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git";
+       EGIT_SUBMODULES=( '-*' )
+
+       inherit git-r3
+else
+       
SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> 
${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 - Extensible mechanism for serializing 
structured data"
+HOMEPAGE="https://protobuf.dev/";
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1-2).0"
+IUSE="emacs examples test zlib"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+       emacs? ( app-editors/emacs:* )
+"
+
+COMMON_DEPEND="
+       dev-libs/jsoncpp
+       >=dev-cpp/abseil-cpp-${ABSEIL_MIN_VER}:=[${MULTILIB_USEDEP}]
+       zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
+"
+
+DEPEND="
+       ${COMMON_DEPEND}
+       test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+       ${COMMON_DEPEND}
+       ${BDEPEND}
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-23.3-disable-32-bit-tests.patch"
+       "${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+       "${FILESDIR}/${P}-fix-missing-PROTOBUF_EXPORT-for-public-symbols.patch"
+       
"${FILESDIR}/${P}-Use-the-same-ABI-for-static-and-shared-libraries-on-.patch"
+)
+
+DOCS=( CONTRIBUTORS.txt README.md )
+
+src_prepare() {
+       eapply_user
+       append-cxxflags -std=c++17
+       cmake_src_prepare
+}
+
+src_configure() {
+       if tc-ld-is-gold; then
+               # https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+               tc-ld-disable-gold
+       fi
+
+       cmake-multilib_src_configure
+}
+
+multilib_src_configure() {
+       local mycmakeargs=(
+               -Dprotobuf_DISABLE_RTTI="yes" # TODO why?
+               -Dprotobuf_BUILD_EXAMPLES="$(usex examples)"
+               -Dprotobuf_WITH_ZLIB="$(usex zlib)"
+               -Dprotobuf_BUILD_TESTS="$(usex test)"
+               -Dprotobuf_ABSL_PROVIDER="package"
+       )
+       use test && mycmakeargs+=(-Dprotobuf_USE_EXTERNAL_GTEST=ON)
+
+       cmake_src_configure
+}
+
+src_compile() {
+       cmake-multilib_src_compile
+
+       if use emacs; then
+               elisp-compile editors/protobuf-mode.el
+       fi
+}
+
+src_test() {
+       local -x srcdir="${S}"/src
+       cmake-multilib_src_test
+}
+
+multilib_src_install_all() {
+       find "${ED}" -name "*.la" -delete || die
+
+       if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}" ]]; then
+               eerror "No matching library found with SLOT variable, currently 
set: ${SLOT}\n" \
+                       "Expected value: 
${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}"
+               die "Please update SLOT variable"
+       fi
+
+       insinto /usr/share/vim/vimfiles/syntax
+       doins editors/proto.vim
+       insinto /usr/share/vim/vimfiles/ftdetect
+       doins "${FILESDIR}/proto.vim"
+
+       if use emacs; then
+               elisp-install "${PN}" editors/protobuf-mode.el*
+               elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
+       fi
+
+       if use examples; then
+               DOCS+=(examples)
+               docompress -x "/usr/share/doc/${PF}/examples"
+       fi
+
+       einstalldocs
+}
+
+pkg_postinst() {
+       use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+       use emacs && elisp-site-regen
+}

diff --git a/dev-libs/protobuf/protobuf-23.4.ebuild 
b/dev-libs/protobuf/protobuf-23.4.ebuild
new file mode 100644
index 000000000000..87f127940ad0
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-23.4.ebuild
@@ -0,0 +1,126 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib elisp-common toolchain-funcs
+
+ABSEIL_BRANCH="lts_2023_01_25" # NOTE from 
https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+
+ABSEIL_MIN_VER="${ABSEIL_BRANCH//lts_}"
+ABSEIL_MIN_VER="${ABSEIL_MIN_VER//_/}"
+
+if [[ "${PV}" == *9999 ]]; then
+       EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git";
+       EGIT_SUBMODULES=( '-*' )
+
+       inherit git-r3
+else
+       
SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> 
${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 - Extensible mechanism for serializing 
structured data"
+HOMEPAGE="https://protobuf.dev/";
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1-2).0"
+IUSE="emacs examples test zlib"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+       emacs? ( app-editors/emacs:* )
+"
+
+COMMON_DEPEND="
+       dev-libs/jsoncpp
+       >=dev-cpp/abseil-cpp-${ABSEIL_MIN_VER}:=[${MULTILIB_USEDEP}]
+       zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
+"
+
+DEPEND="
+       ${COMMON_DEPEND}
+       test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+       ${COMMON_DEPEND}
+       ${BDEPEND}
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-23.3-disable-32-bit-tests.patch"
+       "${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+       "${FILESDIR}/${PN}-23.3-messages_lite-template-instances.patch"
+)
+
+DOCS=( CONTRIBUTORS.txt README.md )
+
+src_configure() {
+       if tc-ld-is-gold; then
+               # https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+               tc-ld-disable-gold
+       fi
+
+       cmake-multilib_src_configure
+}
+
+multilib_src_configure() {
+       local mycmakeargs=(
+               -Dprotobuf_DISABLE_RTTI="yes" # TODO why?
+               -Dprotobuf_BUILD_EXAMPLES="$(usex examples)"
+               -Dprotobuf_WITH_ZLIB="$(usex zlib)"
+               -Dprotobuf_BUILD_TESTS="$(usex test)"
+               -Dprotobuf_ABSL_PROVIDER="package"
+       )
+       use test && mycmakeargs+=(-Dprotobuf_USE_EXTERNAL_GTEST=ON)
+
+       cmake_src_configure
+}
+
+src_compile() {
+       cmake-multilib_src_compile
+
+       if use emacs; then
+               elisp-compile editors/protobuf-mode.el
+       fi
+}
+
+src_test() {
+       local -x srcdir="${S}"/src
+       cmake-multilib_src_test
+}
+
+multilib_src_install_all() {
+       find "${ED}" -name "*.la" -delete || die
+
+       if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}" ]]; then
+               eerror "No matching library found with SLOT variable, currently 
set: ${SLOT}\n" \
+                       "Expected value: 
${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}"
+               die "Please update SLOT variable"
+       fi
+
+       insinto /usr/share/vim/vimfiles/syntax
+       doins editors/proto.vim
+       insinto /usr/share/vim/vimfiles/ftdetect
+       doins "${FILESDIR}/proto.vim"
+
+       if use emacs; then
+               elisp-install "${PN}" editors/protobuf-mode.el*
+               elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
+       fi
+
+       if use examples; then
+               DOCS+=(examples)
+               docompress -x "/usr/share/doc/${PF}/examples"
+       fi
+
+       einstalldocs
+}
+
+pkg_postinst() {
+       use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+       use emacs && elisp-site-regen
+}

diff --git a/dev-libs/protobuf/protobuf-24.4.ebuild 
b/dev-libs/protobuf/protobuf-24.4.ebuild
new file mode 100644
index 000000000000..c3681d98ce72
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-24.4.ebuild
@@ -0,0 +1,125 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib elisp-common toolchain-funcs
+
+ABSEIL_BRANCH="lts_2023_01_25" # NOTE from 
https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+
+ABSEIL_MIN_VER="${ABSEIL_BRANCH//lts_}"
+ABSEIL_MIN_VER="${ABSEIL_MIN_VER//_/}"
+
+if [[ "${PV}" == *9999 ]]; then
+       EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git";
+       EGIT_SUBMODULES=( '-*' )
+
+       inherit git-r3
+else
+       
SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> 
${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 - Extensible mechanism for serializing 
structured data"
+HOMEPAGE="https://protobuf.dev/";
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1-2).0"
+IUSE="emacs examples test zlib"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+       emacs? ( app-editors/emacs:* )
+"
+
+COMMON_DEPEND="
+       dev-libs/jsoncpp
+       >=dev-cpp/abseil-cpp-${ABSEIL_MIN_VER}:=[${MULTILIB_USEDEP}]
+       zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
+"
+
+DEPEND="
+       ${COMMON_DEPEND}
+       test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+       ${COMMON_DEPEND}
+       ${BDEPEND}
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-26.1-disable-32-bit-tests.patch"
+       "${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+)
+
+DOCS=( CONTRIBUTORS.txt README.md )
+
+src_configure() {
+       if tc-ld-is-gold; then
+               # https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+               tc-ld-disable-gold
+       fi
+
+       cmake-multilib_src_configure
+}
+
+multilib_src_configure() {
+       local mycmakeargs=(
+               -Dprotobuf_DISABLE_RTTI="yes" # TODO why?
+               -Dprotobuf_BUILD_EXAMPLES="$(usex examples)"
+               -Dprotobuf_WITH_ZLIB="$(usex zlib)"
+               -Dprotobuf_BUILD_TESTS="$(usex test)"
+               -Dprotobuf_ABSL_PROVIDER="package"
+       )
+       use test && mycmakeargs+=(-Dprotobuf_USE_EXTERNAL_GTEST=ON)
+
+       cmake_src_configure
+}
+
+src_compile() {
+       cmake-multilib_src_compile
+
+       if use emacs; then
+               elisp-compile editors/protobuf-mode.el
+       fi
+}
+
+src_test() {
+       local -x srcdir="${S}"/src
+       cmake-multilib_src_test
+}
+
+multilib_src_install_all() {
+       find "${ED}" -name "*.la" -delete || die
+
+       if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}" ]]; then
+               eerror "No matching library found with SLOT variable, currently 
set: ${SLOT}\n" \
+                       "Expected value: 
${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}"
+               die "Please update SLOT variable"
+       fi
+
+       insinto /usr/share/vim/vimfiles/syntax
+       doins editors/proto.vim
+       insinto /usr/share/vim/vimfiles/ftdetect
+       doins "${FILESDIR}/proto.vim"
+
+       if use emacs; then
+               elisp-install "${PN}" editors/protobuf-mode.el*
+               elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
+       fi
+
+       if use examples; then
+               DOCS+=(examples)
+               docompress -x "/usr/share/doc/${PF}/examples"
+       fi
+
+       einstalldocs
+}
+
+pkg_postinst() {
+       use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+       use emacs && elisp-site-regen
+}

diff --git a/dev-libs/protobuf/protobuf-25.3.ebuild 
b/dev-libs/protobuf/protobuf-25.3.ebuild
new file mode 100644
index 000000000000..422310009a83
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-25.3.ebuild
@@ -0,0 +1,125 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib elisp-common toolchain-funcs
+
+ABSEIL_BRANCH="lts_2023_08_02" # NOTE from 
https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+
+ABSEIL_MIN_VER="${ABSEIL_BRANCH//lts_}"
+ABSEIL_MIN_VER="${ABSEIL_MIN_VER//_/}"
+
+if [[ "${PV}" == *9999 ]]; then
+       EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git";
+       EGIT_SUBMODULES=( '-*' )
+
+       inherit git-r3
+else
+       
SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> 
${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 - Extensible mechanism for serializing 
structured data"
+HOMEPAGE="https://protobuf.dev/";
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1-2).0"
+IUSE="emacs examples test zlib"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+       emacs? ( app-editors/emacs:* )
+"
+
+COMMON_DEPEND="
+       dev-libs/jsoncpp
+       >=dev-cpp/abseil-cpp-${ABSEIL_MIN_VER}:=[${MULTILIB_USEDEP}]
+       zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
+"
+
+DEPEND="
+       ${COMMON_DEPEND}
+       test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+       ${COMMON_DEPEND}
+       ${BDEPEND}
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-26.1-disable-32-bit-tests.patch"
+       "${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+)
+
+DOCS=( CONTRIBUTORS.txt README.md )
+
+src_configure() {
+       if tc-ld-is-gold; then
+               # https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+               tc-ld-disable-gold
+       fi
+
+       cmake-multilib_src_configure
+}
+
+multilib_src_configure() {
+       local mycmakeargs=(
+               -Dprotobuf_DISABLE_RTTI="yes" # TODO why?
+               -Dprotobuf_BUILD_EXAMPLES="$(usex examples)"
+               -Dprotobuf_WITH_ZLIB="$(usex zlib)"
+               -Dprotobuf_BUILD_TESTS="$(usex test)"
+               -Dprotobuf_ABSL_PROVIDER="package"
+       )
+       use test && mycmakeargs+=(-Dprotobuf_USE_EXTERNAL_GTEST=ON)
+
+       cmake_src_configure
+}
+
+src_compile() {
+       cmake-multilib_src_compile
+
+       if use emacs; then
+               elisp-compile editors/protobuf-mode.el
+       fi
+}
+
+src_test() {
+       local -x srcdir="${S}"/src
+       cmake-multilib_src_test
+}
+
+multilib_src_install_all() {
+       find "${ED}" -name "*.la" -delete || die
+
+       if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}" ]]; then
+               eerror "No matching library found with SLOT variable, currently 
set: ${SLOT}\n" \
+                       "Expected value: 
${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}"
+               die "Please update SLOT variable"
+       fi
+
+       insinto /usr/share/vim/vimfiles/syntax
+       doins editors/proto.vim
+       insinto /usr/share/vim/vimfiles/ftdetect
+       doins "${FILESDIR}/proto.vim"
+
+       if use emacs; then
+               elisp-install "${PN}" editors/protobuf-mode.el*
+               elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
+       fi
+
+       if use examples; then
+               DOCS+=(examples)
+               docompress -x "/usr/share/doc/${PF}/examples"
+       fi
+
+       einstalldocs
+}
+
+pkg_postinst() {
+       use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+       use emacs && elisp-site-regen
+}

diff --git a/dev-libs/protobuf/protobuf-26.1-r2.ebuild 
b/dev-libs/protobuf/protobuf-26.1-r2.ebuild
new file mode 100644
index 000000000000..422310009a83
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-26.1-r2.ebuild
@@ -0,0 +1,125 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib elisp-common toolchain-funcs
+
+ABSEIL_BRANCH="lts_2023_08_02" # NOTE from 
https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+
+ABSEIL_MIN_VER="${ABSEIL_BRANCH//lts_}"
+ABSEIL_MIN_VER="${ABSEIL_MIN_VER//_/}"
+
+if [[ "${PV}" == *9999 ]]; then
+       EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git";
+       EGIT_SUBMODULES=( '-*' )
+
+       inherit git-r3
+else
+       
SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> 
${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 - Extensible mechanism for serializing 
structured data"
+HOMEPAGE="https://protobuf.dev/";
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1-2).0"
+IUSE="emacs examples test zlib"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+       emacs? ( app-editors/emacs:* )
+"
+
+COMMON_DEPEND="
+       dev-libs/jsoncpp
+       >=dev-cpp/abseil-cpp-${ABSEIL_MIN_VER}:=[${MULTILIB_USEDEP}]
+       zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
+"
+
+DEPEND="
+       ${COMMON_DEPEND}
+       test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+       ${COMMON_DEPEND}
+       ${BDEPEND}
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-26.1-disable-32-bit-tests.patch"
+       "${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+)
+
+DOCS=( CONTRIBUTORS.txt README.md )
+
+src_configure() {
+       if tc-ld-is-gold; then
+               # https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+               tc-ld-disable-gold
+       fi
+
+       cmake-multilib_src_configure
+}
+
+multilib_src_configure() {
+       local mycmakeargs=(
+               -Dprotobuf_DISABLE_RTTI="yes" # TODO why?
+               -Dprotobuf_BUILD_EXAMPLES="$(usex examples)"
+               -Dprotobuf_WITH_ZLIB="$(usex zlib)"
+               -Dprotobuf_BUILD_TESTS="$(usex test)"
+               -Dprotobuf_ABSL_PROVIDER="package"
+       )
+       use test && mycmakeargs+=(-Dprotobuf_USE_EXTERNAL_GTEST=ON)
+
+       cmake_src_configure
+}
+
+src_compile() {
+       cmake-multilib_src_compile
+
+       if use emacs; then
+               elisp-compile editors/protobuf-mode.el
+       fi
+}
+
+src_test() {
+       local -x srcdir="${S}"/src
+       cmake-multilib_src_test
+}
+
+multilib_src_install_all() {
+       find "${ED}" -name "*.la" -delete || die
+
+       if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}" ]]; then
+               eerror "No matching library found with SLOT variable, currently 
set: ${SLOT}\n" \
+                       "Expected value: 
${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}"
+               die "Please update SLOT variable"
+       fi
+
+       insinto /usr/share/vim/vimfiles/syntax
+       doins editors/proto.vim
+       insinto /usr/share/vim/vimfiles/ftdetect
+       doins "${FILESDIR}/proto.vim"
+
+       if use emacs; then
+               elisp-install "${PN}" editors/protobuf-mode.el*
+               elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
+       fi
+
+       if use examples; then
+               DOCS+=(examples)
+               docompress -x "/usr/share/doc/${PF}/examples"
+       fi
+
+       einstalldocs
+}
+
+pkg_postinst() {
+       use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+       use emacs && elisp-site-regen
+}

diff --git a/dev-libs/protobuf/protobuf-27.2.ebuild 
b/dev-libs/protobuf/protobuf-27.2.ebuild
new file mode 100644
index 000000000000..d9b11f9f0d6a
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-27.2.ebuild
@@ -0,0 +1,160 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib elisp-common toolchain-funcs
+
+ABSEIL_BRANCH="lts_2023_08_02" # NOTE from 
https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+
+ABSEIL_MIN_VER="${ABSEIL_BRANCH//lts_}"
+ABSEIL_MIN_VER="${ABSEIL_MIN_VER//_/}"
+
+if [[ "${PV}" == *9999 ]]; then
+       EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git";
+       EGIT_SUBMODULES=( '-*' )
+       MY_SLOT="27.2"
+
+       inherit git-r3
+else
+       
SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~sparc 
~x86 ~amd64-linux ~x86-linux ~x64-macos"
+       MY_SLOT=$(ver_cut 1-2)
+fi
+
+DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing 
structured data"
+HOMEPAGE="https://protobuf.dev/";
+
+LICENSE="BSD"
+SLOT="0/${MY_SLOT}.0"
+IUSE="conformance emacs examples +libprotoc libupb +protobuf +protoc test zlib"
+
+REQUIRED_USE="
+       || (
+               libprotoc
+               libupb
+               protobuf
+               protoc
+       )
+"
+
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+       emacs? ( app-editors/emacs:* )
+       !protobuf? (
+               >=dev-libs/protobuf-${PV}
+       )
+"
+
+COMMON_DEPEND="
+       dev-libs/jsoncpp
+       >=dev-cpp/abseil-cpp-${ABSEIL_MIN_VER}:=[${MULTILIB_USEDEP}]
+       zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
+"
+
+DEPEND="
+       ${COMMON_DEPEND}
+       test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+       ${COMMON_DEPEND}
+       ${BDEPEND}
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-26.1-disable-32-bit-tests.patch"
+       "${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+)
+
+DOCS=( CONTRIBUTORS.txt README.md )
+
+# src_prepare() {
+#      rm "${S}/third_party/utf8_range/" -rf || die
+#      cmake_src_prepare
+# }
+
+src_configure() {
+       if tc-ld-is-gold; then
+               # https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+               tc-ld-disable-gold
+       fi
+
+       cmake-multilib_src_configure
+}
+
+multilib_src_configure() {
+       local mycmakeargs=(
+               -Dprotobuf_ABSL_PROVIDER="package"
+               -Dprotobuf_JSONCPP_PROVIDER="package"
+
+               -Dprotobuf_BUILD_CONFORMANCE="$(usex test "$(usex 
conformance)")"
+               -Dprotobuf_BUILD_EXAMPLES="$(usex examples)"
+               -Dprotobuf_BUILD_LIBPROTOC="$(usex libprotoc)"
+               -Dprotobuf_BUILD_LIBUPB="$(usex libupb)"
+               -Dprotobuf_BUILD_PROTOBUF_BINARIES="$(usex protobuf)"
+               -Dprotobuf_BUILD_PROTOC_BINARIES="$(usex protoc)"
+               -Dprotobuf_BUILD_SHARED_LIBS="yes"
+               -Dprotobuf_BUILD_TESTS="$(usex test)"
+
+               -Dprotobuf_DISABLE_RTTI="no"
+
+               -Dprotobuf_INSTALL="yes"
+               -Dprotobuf_INSTALL_EXAMPLES="$(usex examples)"
+               -Dprotobuf_TEST_XML_OUTDIR="$(usex test)"
+
+               -Dprotobuf_WITH_ZLIB="$(usex zlib)"
+               -Dprotobuf_VERBOSE="yes"
+       )
+       use test && mycmakeargs+=( -Dprotobuf_USE_EXTERNAL_GTEST="yes" )
+
+       cmake_src_configure
+}
+
+src_compile() {
+       cmake-multilib_src_compile
+
+       if use emacs; then
+               elisp-compile editors/protobuf-mode.el
+       fi
+}
+
+src_test() {
+       local -x srcdir="${S}"/src
+       cmake-multilib_src_test
+}
+
+multilib_src_install_all() {
+       find "${ED}" -name "*.la" -delete || die
+
+       if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}" ]]; then
+               eerror "No matching library found with SLOT variable, currently 
set: ${SLOT}\n" \
+                       "Expected value: 
${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}"
+               die "Please update SLOT variable"
+       fi
+
+       insinto /usr/share/vim/vimfiles/syntax
+       doins editors/proto.vim
+       insinto /usr/share/vim/vimfiles/ftdetect
+       doins "${FILESDIR}/proto.vim"
+
+       if use emacs; then
+               elisp-install "${PN}" editors/protobuf-mode.el*
+               elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
+       fi
+
+       if use examples; then
+               DOCS+=(examples)
+               docompress -x "/usr/share/doc/${PF}/examples"
+       fi
+
+       einstalldocs
+}
+
+pkg_postinst() {
+       use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+       use emacs && elisp-site-regen
+}

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild 
b/dev-libs/protobuf/protobuf-9999.ebuild
new file mode 100644
index 000000000000..c2a90ff0480c
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-9999.ebuild
@@ -0,0 +1,160 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib elisp-common toolchain-funcs
+
+ABSEIL_BRANCH="lts_2023_08_02" # NOTE from 
https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+
+ABSEIL_MIN_VER="${ABSEIL_BRANCH//lts_}"
+ABSEIL_MIN_VER="${ABSEIL_MIN_VER//_/}"
+
+if [[ "${PV}" == *9999 ]]; then
+       EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git";
+       EGIT_SUBMODULES=( '-*' )
+       MY_SLOT="28.0"
+
+       inherit git-r3
+else
+       
SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~sparc 
~x86 ~amd64-linux ~x86-linux ~x64-macos"
+       MY_SLOT=$(ver_cut 1-2)
+fi
+
+DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing 
structured data"
+HOMEPAGE="https://protobuf.dev/";
+
+LICENSE="BSD"
+SLOT="0/${MY_SLOT}.0"
+IUSE="conformance emacs examples +libprotoc libupb +protobuf +protoc test zlib"
+
+REQUIRED_USE="
+       || (
+               libprotoc
+               libupb
+               protobuf
+               protoc
+       )
+"
+
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+       emacs? ( app-editors/emacs:* )
+       !protobuf? (
+               >=dev-libs/protobuf-${PV}
+       )
+"
+
+COMMON_DEPEND="
+       dev-libs/jsoncpp
+       >=dev-cpp/abseil-cpp-${ABSEIL_MIN_VER}:=[${MULTILIB_USEDEP}]
+       zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
+"
+
+DEPEND="
+       ${COMMON_DEPEND}
+       test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+       ${COMMON_DEPEND}
+       ${BDEPEND}
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-26.1-disable-32-bit-tests.patch"
+       "${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+)
+
+DOCS=( CONTRIBUTORS.txt README.md )
+
+# src_prepare() {
+#      rm "${S}/third_party/utf8_range/" -rf || die
+#      cmake_src_prepare
+# }
+
+src_configure() {
+       if tc-ld-is-gold; then
+               # https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+               tc-ld-disable-gold
+       fi
+
+       cmake-multilib_src_configure
+}
+
+multilib_src_configure() {
+       local mycmakeargs=(
+               -Dprotobuf_ABSL_PROVIDER="package"
+               -Dprotobuf_JSONCPP_PROVIDER="package"
+
+               -Dprotobuf_BUILD_CONFORMANCE="$(usex test "$(usex 
conformance)")"
+               -Dprotobuf_BUILD_EXAMPLES="$(usex examples)"
+               -Dprotobuf_BUILD_LIBPROTOC="$(usex libprotoc)"
+               -Dprotobuf_BUILD_LIBUPB="$(usex libupb)"
+               -Dprotobuf_BUILD_PROTOBUF_BINARIES="$(usex protobuf)"
+               -Dprotobuf_BUILD_PROTOC_BINARIES="$(usex protoc)"
+               -Dprotobuf_BUILD_SHARED_LIBS="yes"
+               -Dprotobuf_BUILD_TESTS="$(usex test)"
+
+               -Dprotobuf_DISABLE_RTTI="no"
+
+               -Dprotobuf_INSTALL="yes"
+               -Dprotobuf_INSTALL_EXAMPLES="$(usex examples)"
+               -Dprotobuf_TEST_XML_OUTDIR="$(usex test)"
+
+               -Dprotobuf_WITH_ZLIB="$(usex zlib)"
+               -Dprotobuf_VERBOSE="yes"
+       )
+       use test && mycmakeargs+=( -Dprotobuf_USE_EXTERNAL_GTEST="yes" )
+
+       cmake_src_configure
+}
+
+src_compile() {
+       cmake-multilib_src_compile
+
+       if use emacs; then
+               elisp-compile editors/protobuf-mode.el
+       fi
+}
+
+src_test() {
+       local -x srcdir="${S}"/src
+       cmake-multilib_src_test
+}
+
+multilib_src_install_all() {
+       find "${ED}" -name "*.la" -delete || die
+
+       if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}" ]]; then
+               eerror "No matching library found with SLOT variable, currently 
set: ${SLOT}\n" \
+                       "Expected value: 
${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}"
+               die "Please update SLOT variable"
+       fi
+
+       insinto /usr/share/vim/vimfiles/syntax
+       doins editors/proto.vim
+       insinto /usr/share/vim/vimfiles/ftdetect
+       doins "${FILESDIR}/proto.vim"
+
+       if use emacs; then
+               elisp-install "${PN}" editors/protobuf-mode.el*
+               elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
+       fi
+
+       if use examples; then
+               DOCS+=(examples)
+               docompress -x "/usr/share/doc/${PF}/examples"
+       fi
+
+       einstalldocs
+}
+
+pkg_postinst() {
+       use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+       use emacs && elisp-site-regen
+}

diff --git a/profiles/package.mask b/profiles/package.mask
index 64515849a449..206bba4cc17f 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -544,14 +544,6 @@ sci-libs/h5part
 # Removal on 2024-07-09.  Bugs #933241, #889912, #880267, #562822, #930500.
 net-mail/gnubiff
 
-# Sam James <s...@gentoo.org> (2024-05-28)
-# Breaks reverse dependencies like protobuf-c (bug #932857) and protobuf-26.1
-# itself isn't compatible with this abseil-cpp version (bug #932848).
-# In addition, we still need to establish a new approach like a virtual
-# for protobuf because of its abseil dependency - see the discussion in bug 
#912819.
-~dev-libs/protobuf-26.1
-~dev-cpp/abseil-cpp-20240116.2
-
 # Sam James <s...@gentoo.org> (2024-04-28)
 # Masked for testing. Tracker bug: bug #930805.
 >=sys-libs/ncurses-6.5

Reply via email to