commit:     410197e34e6a385937b0d00898916d6dd11d0e73
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 14 08:18:18 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 14 08:18:18 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=410197e3

dev-libs/protobuf: backport template instantiation fix

Closes: https://bugs.gentoo.org/917046
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...buf-23.3-messages_lite-template-instances.patch | 66 ++++++++++++++++++++++
 ...obuf-23.3-r3.ebuild => protobuf-23.3-r4.ebuild} |  1 +
 2 files changed, 67 insertions(+)

diff --git 
a/dev-libs/protobuf/files/protobuf-23.3-messages_lite-template-instances.patch 
b/dev-libs/protobuf/files/protobuf-23.3-messages_lite-template-instances.patch
new file mode 100644
index 000000000000..3869ad95993c
--- /dev/null
+++ 
b/dev-libs/protobuf/files/protobuf-23.3-messages_lite-template-instances.patch
@@ -0,0 +1,66 @@
+https://bugs.gentoo.org/917046
+https://github.com/protocolbuffers/protobuf/commit/e6f8b9d1026996f6463d4f014d7760256b757227
+
+From e6f8b9d1026996f6463d4f014d7760256b757227 Mon Sep 17 00:00:00 2001
+From: Protobuf Team Bot <protobuf-github-...@google.com>
+Date: Wed, 8 Nov 2023 09:20:10 -0800
+Subject: [PATCH] message_lite.h: Use PROTOBUF_EXPORT_TEMPLATE_DECLARE with
+ extern template
+
+Export extern templates in message_lite.h to avoid missing symbols when
+linking protobuf-lite.so.
+
+PiperOrigin-RevId: 580556084
+--- a/src/google/protobuf/message_lite.h
++++ b/src/google/protobuf/message_lite.h
+@@ -616,22 +616,22 @@ namespace internal {
+ template <bool alias>
+ bool MergeFromImpl(absl::string_view input, MessageLite* msg,
+                    MessageLite::ParseFlags parse_flags);
+-extern template bool MergeFromImpl<false>(absl::string_view input,
+-                                          MessageLite* msg,
+-                                          MessageLite::ParseFlags 
parse_flags);
+-extern template bool MergeFromImpl<true>(absl::string_view input,
+-                                         MessageLite* msg,
+-                                         MessageLite::ParseFlags parse_flags);
++extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<false>(
++    absl::string_view input, MessageLite* msg,
++    MessageLite::ParseFlags parse_flags);
++extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<true>(
++    absl::string_view input, MessageLite* msg,
++    MessageLite::ParseFlags parse_flags);
+ 
+ template <bool alias>
+ bool MergeFromImpl(io::ZeroCopyInputStream* input, MessageLite* msg,
+                    MessageLite::ParseFlags parse_flags);
+-extern template bool MergeFromImpl<false>(io::ZeroCopyInputStream* input,
+-                                          MessageLite* msg,
+-                                          MessageLite::ParseFlags 
parse_flags);
+-extern template bool MergeFromImpl<true>(io::ZeroCopyInputStream* input,
+-                                         MessageLite* msg,
+-                                         MessageLite::ParseFlags parse_flags);
++extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<false>(
++    io::ZeroCopyInputStream* input, MessageLite* msg,
++    MessageLite::ParseFlags parse_flags);
++extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<true>(
++    io::ZeroCopyInputStream* input, MessageLite* msg,
++    MessageLite::ParseFlags parse_flags);
+ 
+ struct BoundedZCIS {
+   io::ZeroCopyInputStream* zcis;
+@@ -641,10 +641,10 @@ struct BoundedZCIS {
+ template <bool alias>
+ bool MergeFromImpl(BoundedZCIS input, MessageLite* msg,
+                    MessageLite::ParseFlags parse_flags);
+-extern template bool MergeFromImpl<false>(BoundedZCIS input, MessageLite* msg,
+-                                          MessageLite::ParseFlags 
parse_flags);
+-extern template bool MergeFromImpl<true>(BoundedZCIS input, MessageLite* msg,
+-                                         MessageLite::ParseFlags parse_flags);
++extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<false>(
++    BoundedZCIS input, MessageLite* msg, MessageLite::ParseFlags parse_flags);
++extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<true>(
++    BoundedZCIS input, MessageLite* msg, MessageLite::ParseFlags parse_flags);
+ 
+ template <typename T>
+ struct SourceWrapper;
+

diff --git a/dev-libs/protobuf/protobuf-23.3-r3.ebuild 
b/dev-libs/protobuf/protobuf-23.3-r4.ebuild
similarity index 97%
rename from dev-libs/protobuf/protobuf-23.3-r3.ebuild
rename to dev-libs/protobuf/protobuf-23.3-r4.ebuild
index 6ef5f8f482f1..f44655dc1c74 100644
--- a/dev-libs/protobuf/protobuf-23.3-r3.ebuild
+++ b/dev-libs/protobuf/protobuf-23.3-r4.ebuild
@@ -40,6 +40,7 @@ RDEPEND="
 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 )

Reply via email to