summaryrefslogtreecommitdiff
path: root/dev-libs/protobuf
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-02-03 23:44:18 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-02-03 23:44:18 +0000
commit9becec60cd1423a327b86686a981699c0522cd79 (patch)
tree45888e8316556b1667e06ec2555a87601353747e /dev-libs/protobuf
parentc44123f79f40edf5fe3d4b0d211d6aa68542abd2 (diff)
gentoo auto-resync : 03:02:2024 - 23:44:17
Diffstat (limited to 'dev-libs/protobuf')
-rw-r--r--dev-libs/protobuf/Manifest4
-rw-r--r--dev-libs/protobuf/files/protobuf-22.5-Use-the-same-ABI-for-static-and-shared-libraries-on-.patch71
-rw-r--r--dev-libs/protobuf/files/protobuf-22.5-fix-missing-PROTOBUF_EXPORT-for-public-symbols.patch32
-rw-r--r--dev-libs/protobuf/protobuf-22.5.ebuild117
4 files changed, 224 insertions, 0 deletions
diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index 8c34b01e042e..5d381b2e3565 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -1,6 +1,8 @@
AUX 70protobuf-gentoo.el 170 BLAKE2B 6d9a92bd3310ca09d18dd762bc0bbd4b0b36184c17f95c80c02183c457fe4ff1142ca1e3207e5a77c078fe5f768cb3e85abc712abc1f4c85774ca1ebf178059b SHA512 ed73cd6b1bf6c0019e4da73c3a480b0f917e949dfad2696336e805263c81610b2a8a0514840e389db0f0e78252cf053d754c5e07731dc5e9c93c9e88f0b2923c
AUX proto.vim 49 BLAKE2B 9b6d31105811a8f8cbcf76328172fda5b66b33351bb16573ed1ed08d4c553af2805962a6d6609fbdad4a2644bf9cecd1e771a557f138111ad2c0be959b497ee9 SHA512 65c1f49887c17973d1dfce07fa86d04c5079d2382826eaeb22e128570717f181c53d22ba50905252021f7e476a90ecd29f9d18799c1ccea64b01f4638323538e
AUX protobuf-21.9-disable-32-bit-tests.patch 5942 BLAKE2B dcc1d5474c704358287a5033aaae3474b57324e853aa670aa723dc1d3d8b8cdb14ac588e3d3b3c998878d9f346fc91347379bbc3d88057b761b02515582ebcbd SHA512 97d60343e96fe03fefae621b70787fa284e38db5f94b7d205927d0852e9d20e9176e07182caa0ffca704bc08e439854ae3d109c3eca61c3101ae178a0426624d
+AUX protobuf-22.5-Use-the-same-ABI-for-static-and-shared-libraries-on-.patch 4737 BLAKE2B e5e5d1fcf16f3e33b0ee6d83452cf471b9460e74b2d9152407ff140af3fe891c46a3592a55426234898d812594abc5af55bd356e1357043bf60932fc05620dd9 SHA512 93f9982bd2d92a4e222a2a1e596e044462b838062e941d7bf18d4ce4518b32f2b736ca5551aec59a46c321f3359a78d0e0a94728af7151387eb6d626e9d04d02
+AUX protobuf-22.5-fix-missing-PROTOBUF_EXPORT-for-public-symbols.patch 1188 BLAKE2B a09cd3beabcab37449b1c7ac03f9aa11d7f1f85f07b1149a04bf3b77c6c3e0a71e5345288178a1235f41fb57817880d1cd6d67e40769f9793214b6411a6ed4d6 SHA512 798f5edbb5e81c26b4216412fdc6d3cf1ffbac4936713e909e1cbd04e5a7be7187d456bf91c48e6ba0593235226be2ce843304058acd38d1907208bc0c323378
AUX protobuf-23.3-disable-32-bit-tests.patch 1261 BLAKE2B 95adb955991b3c181e15c985996d1d136bc6586a885987c526b3f83feb4afad7553e585f4281fd0928913284cc9251fce089ab79400af3a3e9e75f31db5c8e9c SHA512 42d3121c215190c249dfd0b9e8e2ca59d49fce73a49f113b958d7b7f73708ee758bbeff2dbdbdf1c744352b7f49caab6fb4acd806089b37cf8690dc3cb298289
AUX protobuf-23.3-static_assert-failure.patch 529 BLAKE2B 69452cf44106fdd7295bbb8d97011309c160f51fb30c233b9549d955d57c0a188b407b97ea7de7dc708a145bf76d5f15f1332bf641541a8830db96705a071701 SHA512 291d8cd318a0324e58c5dc83273ca67b55fd1446bd5111e3caaa9e2b08e3a2565de8030050df6555f300f7051668f5b8918e52009f826a653bb70f9931f12ebd
AUX protobuf-3.19.0-disable_no-warning-test.patch 1620 BLAKE2B e4f324ed59b2c31662cc625e9d3f1fdb20ee2a25769dbf86093e5000f73a01e11f05459989aaefeaf0414648cd52f1f1025b9d4f1423cdca4844e42e96f54836 SHA512 8c4bc72976a7eb3418b51e7a1c45b49d7ffaeb91a86f440008e6f162773b1db7afed4a6ae1d0b3510d49361c369b6552a9ba4976d104d804d825227aa7113d95
@@ -8,8 +10,10 @@ AUX protobuf-3.19.0-system_libraries.patch 7514 BLAKE2B 1ff5c226232c325ed48cf16e
AUX protobuf-3.20.2-protoc_input_output_files.patch 10080 BLAKE2B f52ea613b1104aa703e5e10eb5f968e33e46f05523e13fe84369a24ccbc16cecbcce3221b64b1acd624500864d224ccb59d1ce626157a0d0d77870f79ea64bd8 SHA512 dcf5dbd7be4a025d9ee96ed9be4566452ae4f946d0e1ae4c411a0dc3b7071fc156aca796497c0f2b67563a8ee884bded1a931d712cd7a3727301bbe37ec646f0
DIST protobuf-21.12.tar.gz 5141166 BLAKE2B 33500612d103afb817062486a741e8e5503f82c42c70054d47d1899e6bb79f3fdde2666cad5b8eff6e1bc539c3b0cdf9f2b125ce7e5d3a459a69e84d67ab535e SHA512 2dc8f552388438268d8b9f7a9e84c6abf1736be3d5031438c789c317410c9f4b5cedd25bf7da6d67b3ba32ca890869f9ddaab2284d6ac0e734a5b135ffbb1346
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
EBUILD protobuf-21.12.ebuild 2504 BLAKE2B b90c7eb65835f98825faf41fb70b7edcd40030c5c430be7faf13308a74cbc3576a910b83a73dcf593ebb248392900536b96152ba18d05f532b0632ad637b2ad8 SHA512 454f7104106edd5cbc9c1897cdc57fcef337fef51239d5e8832064a9a049b238bb3d4d549df88369098b26a350b4828131ecda74a65c832cf4aa9b1128445d7b
EBUILD protobuf-21.9.ebuild 4169 BLAKE2B 26d7458698701fc08d93a7fde27933b34d39975ae403531af31a7dfd8471e2ca20d9f471875ba15a88388616c353bb7b6fd29ed1a6d4b94391fccee2f448d4c5 SHA512 32699153aaf64ece98cd694826b6ba01e32af8a278143e8dacbe05a9eb23f37017a40807247eb1809a5be5e6300a922c8758f3e53be166a1d2e5d48735a63fad
+EBUILD protobuf-22.5.ebuild 2925 BLAKE2B 776506e726bcd13147612a3caa515db2a6c2fdae3c3588f9dec765d45b9e64b711f02dd74ba23476429aaec855ed852e61727ff03469064a75c346f9d35dc19f SHA512 198295678cc129d36834032a3ae5a068ba2c05bb3bdc907e99ee1b497c033df384ac3e232baaabd0b0d5a6a48d52f3361c5c73c0fbe05d0462220e9a2f2d8e87
EBUILD protobuf-23.3-r2.ebuild 2659 BLAKE2B 1535f90dedfe009e965f85ecb14b895172b300a81f1915493adb9f7ea73eeadf51f5b2e0615b0d5c2df877b6f915450ef0f44cb762c9ca3d7932985933c91f67 SHA512 6dbd449376734bb6e789b6771e117797e971a45b5829257324630fdedc0bbb7697a1f6e66a4f1ca9f9eb99986dae827309a81556089a7c61e10c58d642ce9147
MISC metadata.xml 595 BLAKE2B ba1b916e26b1e53f68e660f03d2e53fea8d22db04e8241ebec3ec20fbb251c2b164cf25d5fb6118423ce7721a822ae2302aab137b0748730e9a6860bf8e65668 SHA512 785e2550621b79b6350e1a6b52ed9992610769885fb29a9e92ee45a35158cc08707a3590dfcbece9ee9a5e16e1abfb614e8186132da7b942f2761b5e6ecfa827
diff --git a/dev-libs/protobuf/files/protobuf-22.5-Use-the-same-ABI-for-static-and-shared-libraries-on-.patch b/dev-libs/protobuf/files/protobuf-22.5-Use-the-same-ABI-for-static-and-shared-libraries-on-.patch
new file mode 100644
index 000000000000..4bbed7ecbaf5
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-22.5-Use-the-same-ABI-for-static-and-shared-libraries-on-.patch
@@ -0,0 +1,71 @@
+From 4329fde9cf3fab7d1b3a9abe0fbeee1ad8a8b111 Mon Sep 17 00:00:00 2001
+From: "Romain Geissler @ Amadeus" <romain.geissler@amadeus.com>
+Date: Tue, 6 Jun 2023 10:49:55 -0700
+Subject: [PATCH] Use the same ABI for static and shared libraries on
+ non-Windows platforms (#12983)
+
+Hi,
+
+It seems that until last year, the logic behind `PROTOBUF_USE_DLLS` was for Windows (MSCV) only. It was changed to all platforms here in https://github.com/protocolbuffers/protobuf/commit/5a0887fc6529596eff5c0f72febc602a9d494cc2
+
+Last month, the generated pkg config files were updated to reflect the protobuf build-time value of `PROTOBUF_USE_DLLS` as it was indeed noted that it changes the ABI. This was done in https://github.com/protocolbuffers/protobuf/pull/12700 In the commit message it is mentionned that most likely we shall rather have a stable ABI.
+
+Finally in https://github.com/protocolbuffers/protobuf/issues/12746 which at some point mentions https://issuetracker.google.com/issues/283987730#comment7 where a Google employee hits the linker issue:
+```
+undefined reference to `google::protobuf::internal::ThreadSafeArena::thread_cache_'
+```
+which denotes a mix of some .o or libs built `PROTOBUF_USE_DLLS` defined and some others build with `PROTOBUF_USE_DLLS` undefined, resulting in ABI incompatibilities.
+
+I also hit this issue while trying to include protobuf in a corporate environment using it's own proprietary build system in which it is expected that .a and .so use a compatible ABI.
+
+From my own understanding, ideally we should always use `thread_local` variables, but experience has shown that:
+ - old iOS (iOS < 9) didn't seem to accept `thread_local`, leading to the `GOOGLE_PROTOBUF_NO_THREADLOCAL` macro later renamed `PROTOBUF_NO_THREADLOCAL` which allowed to disable this, but it is not set anywhere in the protobuf code base. Also I doubt you still want to support such old iOS now, so maybe you should consider removing all `PROTOBUF_NO_THREADLOCAL` related code paths (this pull request doesn't do this).
+ - MSVC's DLL interface doesn't seem to accept exporting thread local variables (at least from what I understood, I know absolutely nothing about the Windows ecosystem), yet we can "hide" a thread local variable in a static function using a thread local variable. However in that case the access to TLS variable is not inlined, leading to worse performances, this hack shall be done only for Windows (actually when using MSVC) *AND* we build a shared library.
+ - In all other cases, a classical `thread_local` shall be used, no matter if we build a static or a shared library. In particular on Linux which I guess is the target Google cares the more about for its own production. This pull request achieves this.
+
+Am I right in my conclusion ?
+
+Closes #12983
+
+COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12983 from Romain-Geissler-1A:stable-abi-use-dll-non-windows dc23ff50f67cf0c8e45900a78700d1fc3e8bec39
+PiperOrigin-RevId: 538230923
+---
+ src/google/protobuf/arena.cc | 2 +-
+ src/google/protobuf/reflection_mode.cc | 2 +-
+ src/google/protobuf/reflection_mode.h | 10 ++++++----
+ src/google/protobuf/thread_safe_arena.h | 6 +++---
+ 4 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc
+index 51afdbdaf..6577a3669 100644
+--- a/src/google/protobuf/arena.cc
++++ b/src/google/protobuf/arena.cc
+@@ -519,7 +519,7 @@ ThreadSafeArena::ThreadCache& ThreadSafeArena::thread_cache() {
+ new internal::ThreadLocalStorage<ThreadCache>();
+ return *thread_cache_->Get();
+ }
+-#elif defined(PROTOBUF_USE_DLLS)
++#elif defined(PROTOBUF_USE_DLLS) && defined(_MSC_VER)
+ ThreadSafeArena::ThreadCache& ThreadSafeArena::thread_cache() {
+ static PROTOBUF_THREAD_LOCAL ThreadCache thread_cache;
+ return thread_cache;
+diff --git a/src/google/protobuf/thread_safe_arena.h b/src/google/protobuf/thread_safe_arena.h
+index e6e3b7fae..f53993a85 100644
+--- a/src/google/protobuf/thread_safe_arena.h
++++ b/src/google/protobuf/thread_safe_arena.h
+@@ -260,9 +260,9 @@ class PROTOBUF_EXPORT ThreadSafeArena {
+ // iOS does not support __thread keyword so we use a custom thread local
+ // storage class we implemented.
+ static ThreadCache& thread_cache();
+-#elif defined(PROTOBUF_USE_DLLS)
+- // Thread local variables cannot be exposed through DLL interface but we can
+- // wrap them in static functions.
++#elif defined(PROTOBUF_USE_DLLS) && defined(_MSC_VER)
++ // Thread local variables cannot be exposed through MSVC DLL interface but we
++ // can wrap them in static functions.
+ static ThreadCache& thread_cache();
+ #else
+ PROTOBUF_CONSTINIT static PROTOBUF_THREAD_LOCAL ThreadCache thread_cache_;
+--
+2.43.0
+
diff --git a/dev-libs/protobuf/files/protobuf-22.5-fix-missing-PROTOBUF_EXPORT-for-public-symbols.patch b/dev-libs/protobuf/files/protobuf-22.5-fix-missing-PROTOBUF_EXPORT-for-public-symbols.patch
new file mode 100644
index 000000000000..fcf39e1e3e8f
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-22.5-fix-missing-PROTOBUF_EXPORT-for-public-symbols.patch
@@ -0,0 +1,32 @@
+From fc1c5512e524e0c00a276aa9a38b2cdb8fdf45c7 Mon Sep 17 00:00:00 2001
+From: Protobuf Team Bot <protobuf-github-bot@google.com>
+Date: Thu, 1 Jun 2023 09:14:48 -0700
+Subject: [PATCH] fix: missing `PROTOBUF_EXPORT` for public symbols
+
+PiperOrigin-RevId: 537042088
+---
+ src/google/protobuf/io/strtod.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/google/protobuf/io/strtod.h b/src/google/protobuf/io/strtod.h
+index 851c8e621..b368e4d87 100644
+--- a/src/google/protobuf/io/strtod.h
++++ b/src/google/protobuf/io/strtod.h
+@@ -60,12 +60,12 @@ PROTOBUF_EXPORT std::string SimpleFtoa(float value);
+
+ // A locale-independent version of the standard strtod(), which always
+ // uses a dot as the decimal separator.
+-double NoLocaleStrtod(const char* str, char** endptr);
++PROTOBUF_EXPORT double NoLocaleStrtod(const char* str, char** endptr);
+
+ // Casts a double value to a float value. If the value is outside of the
+ // representable range of float, it will be converted to positive or negative
+ // infinity.
+-float SafeDoubleToFloat(double value);
++PROTOBUF_EXPORT float SafeDoubleToFloat(double value);
+
+ } // namespace io
+ } // namespace protobuf
+--
+2.43.0
+
diff --git a/dev-libs/protobuf/protobuf-22.5.ebuild b/dev-libs/protobuf/protobuf-22.5.ebuild
new file mode 100644
index 000000000000..dc99040c5f31
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-22.5.ebuild
@@ -0,0 +1,117 @@
+# 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
+
+if [[ "${PV}" == *9999 ]]; then
+ inherit git-r3
+
+ EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git"
+ EGIT_SUBMODULES=()
+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:* )"
+DEPEND="
+ >=dev-cpp/abseil-cpp-20230125:=[${MULTILIB_USEDEP}]
+ zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
+ test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+ >=dev-cpp/abseil-cpp-20230125:=[${MULTILIB_USEDEP}]
+ emacs? ( app-editors/emacs:* )
+ zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
+"
+
+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=(
+ -DCMAKE_CXX_STANDARD=17
+ -Dprotobuf_DISABLE_RTTI=ON
+ -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
+}
+
+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
+}