From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1451698-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id A3052158021
	for <garchives@archives.gentoo.org>; Sun, 30 Oct 2022 22:05:04 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id B555CE07EF;
	Sun, 30 Oct 2022 22:05:03 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 993D2E07EF
	for <gentoo-commits@lists.gentoo.org>; Sun, 30 Oct 2022 22:05:03 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 79D27335D75
	for <gentoo-commits@lists.gentoo.org>; Sun, 30 Oct 2022 22:05:02 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id A3483629
	for <gentoo-commits@lists.gentoo.org>; Sun, 30 Oct 2022 22:05:00 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1667167488.322ac2dc68fbc79b20ad910a8d8c955c41b4e54d.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-libs/protobuf/Manifest dev-libs/protobuf/protobuf-21.9.ebuild
X-VCS-Directories: dev-libs/protobuf/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 322ac2dc68fbc79b20ad910a8d8c955c41b4e54d
X-VCS-Branch: master
Date: Sun, 30 Oct 2022 22:05:00 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: d6d4da7c-8752-43ea-8f5d-930d6a0a30aa
X-Archives-Hash: 746585692bccc75c6a9854bb5a993957

commit:     322ac2dc68fbc79b20ad910a8d8c955c41b4e54d
Author:     Thibaud CANALE <thican <AT> thican <DOT> net>
AuthorDate: Thu Oct 27 18:26:55 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 30 22:04:48 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=322ac2dc

dev-libs/protobuf: add 21.9

Bug: https://bugs.gentoo.org/878467

Signed-off-by: Thibaud CANALE <thican <AT> thican.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/protobuf/Manifest             |   1 +
 dev-libs/protobuf/protobuf-21.9.ebuild | 148 +++++++++++++++++++++++++++++++++
 2 files changed, 149 insertions(+)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index 74313749d43f..5dd5ef74895c 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -1,4 +1,5 @@
 DIST protobuf-21.8.tar.gz 5110670 BLAKE2B 3c1b0c857a86e9586481d63896341d0cb11290dbd710d87a6f7889d34f5f262abe2986a29ed19a730f8fa5df0b5c62d77a4db6aa415a72b239f7483ae8d6380c SHA512 cb17be759311e91172801add1f88fe7a0291b547170c40d2e3303f5c248570dddeade96bd48740edd628215f55269c97475e2f4c4a41c50f1018d525f52036cb
+DIST protobuf-21.9.tar.gz 5110670 BLAKE2B a4f5b7f58e1c5904ca990b100a72992f6f56177b28773f8de8c99e4158391d33cfb8aa8575915887fc9ae4294faf81d4ff6b470bc07b394bfd5885a09ba0fafe SHA512 6954b42d21921e630173b7848c056ab95635627d8eddec960f3db2ddda13eedde00520a9b350722e76e2998649eb8ebe10758e1db938b6a91e38ff3295b1b7c1
 DIST protobuf-3.19.3.tar.gz 5293258 BLAKE2B c05b70ffca97f7166ea6a511a36907eed125edf1ebf17f908718221d9b851be84dfb2b1b39973f2faf35f6ade630e6ba4f9e8b91b8fbc922c5db97079323ee6e SHA512 1c003e7cbc8eae6a038f46e688b401ee202ba47f502561e909df79770f6e8b7daf3dc1ccc727e31bfb5b52cd04cb4fef7d2d2a28d650c13f396872ad4aa076c6
 DIST protobuf-3.19.6.tar.gz 5299501 BLAKE2B 3121f76b95f83c5309ce49ce296b738eff7be9d3a5093c564fbe2339fb5f3729e406f1b44bfcc05feb0d31ab63838bb4f54685017977c73a33b91215a6776072 SHA512 8f92242f2be8e1bbfba41341c87709ad91ad83b8b3e3df88bb430411541d3399295f49291fd52b50e3487b0fce33181cb4d175685fd25aac72adfaee26a612d4
 DIST protobuf-3.20.1.tar.gz 5368262 BLAKE2B 1ce1aef2e4c4f3ea4863629cc75d89fe17d0c7ac0c342ac641c787456fd4a12756c2892a27ddadedc94a7201494ec84566638ce33a03cb0c867b04e9eee0edb3 SHA512 fde3eb9f13946887ddfd87df428c5615ad09aaf191e4478b24e98e5e13231feeff4e70b4ca6a2ff7d9b9b2e2c60bc1d5479526edeafa78f9a8ed3bef2e0bacb0

diff --git a/dev-libs/protobuf/protobuf-21.9.ebuild b/dev-libs/protobuf/protobuf-21.9.ebuild
new file mode 100644
index 000000000000..523c763c265c
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-21.9.ebuild
@@ -0,0 +1,148 @@
+# Copyright 2008-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools elisp-common flag-o-matic multilib-minimal 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 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+fi
+
+DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
+HOMEPAGE="
+	https://developers.google.com/protocol-buffers/
+"
+
+LICENSE="BSD"
+SLOT="0/32"
+IUSE="emacs examples static-libs test zlib"
+RESTRICT="!test? ( test )"
+
+BDEPEND="emacs? ( app-editors/emacs:* )"
+DEPEND="test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
+RDEPEND="emacs? ( app-editors/emacs:* )
+	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-3.19.0-disable_no-warning-test.patch"
+	"${FILESDIR}/${PN}-3.19.0-system_libraries.patch"
+	"${FILESDIR}/${PN}-3.20.2-protoc_input_output_files.patch"
+)
+
+DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
+
+src_prepare() {
+	default
+
+	# https://github.com/protocolbuffers/protobuf/issues/7413
+	sed -e "/^AC_PROG_CXX_FOR_BUILD$/d" -i configure.ac || die
+
+	# https://github.com/protocolbuffers/protobuf/issues/8082
+	sed -e "/^TEST_F(IoTest, LargeOutput) {$/,/^}$/d" -i src/google/protobuf/io/zero_copy_stream_unittest.cc || die
+
+	# https://github.com/protocolbuffers/protobuf/issues/8459
+	sed \
+		-e "/^TEST(ArenaTest, BlockSizeSmallerThanAllocation) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" \
+		-e "/^TEST(ArenaTest, SpaceAllocated_and_Used) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" \
+		-i src/google/protobuf/arena_unittest.cc || die
+
+	# https://github.com/protocolbuffers/protobuf/issues/8460
+	sed -e "/^TEST(AnyTest, TestPackFromSerializationExceedsSizeLimit) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" -i src/google/protobuf/any_test.cc || die
+
+	# https://github.com/protocolbuffers/protobuf/issues/9433
+	sed -e "/^[[:space:]]*static_assert(alignof(U) <= 8, \"\");$/d" -i src/google/protobuf/descriptor.cc || die
+
+	eautoreconf
+}
+
+src_configure() {
+	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
+
+	if tc-ld-is-gold; then
+		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+		tc-ld-disable-gold
+	fi
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local options=(
+		$(use_enable static-libs static)
+		$(use_with zlib)
+	)
+
+	if tc-is-cross-compiler; then
+		# Build system uses protoc when building, so protoc copy runnable on host is needed.
+		mkdir -p "${WORKDIR}/build" || die
+		pushd "${WORKDIR}/build" > /dev/null || die
+		ECONF_SOURCE="${S}" econf_build "${options[@]}"
+		options+=(--with-protoc="$(pwd)/src/protoc")
+		popd > /dev/null || die
+	fi
+
+	ECONF_SOURCE="${S}" econf "${options[@]}"
+}
+
+src_compile() {
+	multilib-minimal_src_compile
+
+	if use emacs; then
+		elisp-compile editors/protobuf-mode.el
+	fi
+}
+
+multilib_src_compile() {
+	if tc-is-cross-compiler; then
+		emake -C "${WORKDIR}/build/src" protoc
+	fi
+
+	default
+}
+
+multilib_src_test() {
+	emake check
+}
+
+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
+}