mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-libs/protobuf: add 34.2
Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com> Part-of: https://codeberg.org/gentoo/gentoo/pulls/635 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -8,3 +8,4 @@ DIST protobuf-32.1.tar.gz 9676391 BLAKE2B f6c1faa260ecb57c0a1a5d4be7d56e431cac9e
|
||||
DIST protobuf-33.0.tar.gz 6872665 BLAKE2B 5d456c000117b590dea5b7e721a8b8d00d9e7067ba2156f082e4959a17fcf8d4f2e306f90335aad97e1a94dfd2491544d67cb29670f0022034fde574140a8066 SHA512 2956270a81631895ab6ed8c3c2a22b353a461b0827ee17a1c569b24374307a8e2525a06db6728140bff759a40e47a1d2a291cfb34293b364fe279f10468f3cb9
|
||||
DIST protobuf-33.1.tar.gz 6865436 BLAKE2B 101bf4a67fe0d08ab5f6b3c984193e8b031c521b374bd1bc134f9c2df90f995af73c7689de03d3b4b2d8ce77fc94392fc552942d158df9d2c65ce3e74ac47d0a SHA512 c0b8bd54fe7bd287b2225c3e50e995bc0160d7c0a7712fd047325361613ffb917f4ab838933b1505b07d404e1adb80ea681503bdfc83ce9846d03f5539b481be
|
||||
DIST protobuf-33.4.tar.gz 6887338 BLAKE2B cb92bbce07ea457f3bc809ac74a892c90c925e950c5fe58e8071320f578409226d95236b688fe153612e0ec4774bc6361629319e7a8c087fa31ce5e7f918f04e SHA512 96b1f048cccf188a17ff308d144fa55c931e14522bf077e835c17fa344050bd762f0bbb0a4efed35fe5ea9bdeaf0fbe346ca8fbabcbdb0a3ee727eac77ccb9fd
|
||||
DIST protobuf-34.2.tar.gz 7036403 BLAKE2B 71c584454fb26fec1b2972feca614219960e184b064dbb0c3397d5b112b645f577ab20f92cc7a2e9412cc855d3c102f5ab4f7d5d5d71052930bb45ab34dcad5a SHA512 a79027ea37cb223107825e027dbe93a5960ffd77cd21908ee47f1a4a6fd90ff7fdbb6515c2b630d41d14dfb721e2b52c4f2591a7e6dd40ca3d098a62ee28fe57
|
||||
|
||||
196
dev-libs/protobuf/protobuf-34.2.ebuild
Normal file
196
dev-libs/protobuf/protobuf-34.2.ebuild
Normal file
@@ -0,0 +1,196 @@
|
||||
# Copyright 2008-2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
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"
|
||||
|
||||
if [[ "${PV}" == *9999 ]]; then
|
||||
EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git"
|
||||
EGIT_SUBMODULES=( '-*' )
|
||||
SLOT="0/9999"
|
||||
|
||||
inherit git-r3
|
||||
else
|
||||
SRC_URI="https://github.com/protocolbuffers/protobuf/releases/download/v${PV}/${P}.tar.gz"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos"
|
||||
SLOT="0/$(ver_cut 1-2).0"
|
||||
fi
|
||||
|
||||
DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
|
||||
HOMEPAGE="https://protobuf.dev/"
|
||||
|
||||
LICENSE="BSD"
|
||||
IUSE="conformance debug emacs examples +libprotoc +libupb +protobuf +protoc test zlib"
|
||||
|
||||
# Require protobuf for the time being
|
||||
REQUIRED_USE="
|
||||
protobuf
|
||||
protobuf? ( protoc )
|
||||
examples? ( protobuf )
|
||||
libprotoc? ( protobuf )
|
||||
libupb? ( protobuf )
|
||||
protoc? ( libupb )
|
||||
"
|
||||
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
BDEPEND="
|
||||
emacs? ( app-editors/emacs:* )
|
||||
"
|
||||
|
||||
COMMON_DEPEND="
|
||||
>=dev-cpp/abseil-cpp-${ABSEIL_MIN_VER}:=[${MULTILIB_USEDEP}]
|
||||
zlib? ( virtual/zlib:=[${MULTILIB_USEDEP}] )
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
${COMMON_DEPEND}
|
||||
conformance? ( dev-libs/jsoncpp[${MULTILIB_USEDEP}] )
|
||||
test? (
|
||||
|| (
|
||||
dev-cpp/abseil-cpp[test-helpers(-)]
|
||||
dev-cpp/abseil-cpp[test]
|
||||
)
|
||||
dev-cpp/gtest[${MULTILIB_USEDEP}]
|
||||
)
|
||||
"
|
||||
RDEPEND="
|
||||
${COMMON_DEPEND}
|
||||
${BDEPEND}
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
|
||||
"${FILESDIR}/${PN}-30.0-findJsonCpp.patch"
|
||||
)
|
||||
|
||||
DOCS=( CONTRIBUTORS.txt README.md )
|
||||
|
||||
src_prepare() {
|
||||
cmake_src_prepare
|
||||
|
||||
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).
|
||||
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
|
||||
|
||||
local mycmakeargs=(
|
||||
-Dprotobuf_BUILD_CONFORMANCE="$(usex test "$(usex conformance)")"
|
||||
-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_TEST_XML_OUTDIR="$(usex test)"
|
||||
|
||||
-Dprotobuf_WITH_ZLIB="$(usex zlib)"
|
||||
-Dprotobuf_VERBOSE="$(usex debug)"
|
||||
-DCMAKE_MODULE_PATH="${S}/cmake"
|
||||
|
||||
-Dprotobuf_LOCAL_DEPENDENCIES_ONLY="yes"
|
||||
# -Dprotobuf_FORCE_FETCH_DEPENDENCIES="no"
|
||||
)
|
||||
if use protobuf ; then
|
||||
if use examples ; then
|
||||
mycmakeargs+=(
|
||||
-Dprotobuf_BUILD_EXAMPLES="$(usex examples)"
|
||||
-Dprotobuf_INSTALL_EXAMPLES="$(usex examples)"
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
cmake-multilib_src_compile
|
||||
|
||||
if use emacs; then
|
||||
elisp-compile editors/protobuf-mode.el
|
||||
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
|
||||
|
||||
# needed to fix CommandLineInterfaceTest.DescriptorSetOptionRetention failures
|
||||
cp "${S}/src/google/protobuf/descriptor.proto" "${BUILD_DIR}/src/google/protobuf/" || die
|
||||
|
||||
if [[ ${ABI} == x86 ]]; then
|
||||
GTEST_SKIP_TESTS+=(
|
||||
"GenerateEnumDataTest.DebugChecks"
|
||||
)
|
||||
fi
|
||||
|
||||
[[ -n ${GTEST_RUN_TESTS[*]} ]] && GTEST_FILTER+="$(IFS=':' ; echo "${GTEST_RUN_TESTS[*]}")"
|
||||
[[ -n ${GTEST_SKIP_TESTS[*]} ]] && GTEST_FILTER+="${GTEST_FILTER+:}-$(IFS=':' ; echo "${GTEST_SKIP_TESTS[*]}")"
|
||||
|
||||
cmake_src_test "${_cmake_args[@]}"
|
||||
}
|
||||
|
||||
src_test() {
|
||||
local -x srcdir="${S}/src"
|
||||
|
||||
local GTEST_SKIP_TESTS=()
|
||||
|
||||
if [[ ! -v GTEST_FILTER ]]; then
|
||||
local -x GTEST_FILTER
|
||||
fi
|
||||
|
||||
cmake-multilib_src_test
|
||||
}
|
||||
|
||||
multilib_src_install_all() {
|
||||
use libupb && strip-lto-bytecode
|
||||
|
||||
find "${ED}" -name "*.la" -delete || die
|
||||
|
||||
if ! tc-is-cross-compiler && [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf$(get_libname "${SLOT#*/}")" ]]; then
|
||||
eerror "No matching library found with SLOT variable, currently set: ${SLOT}\n" \
|
||||
"Expected value: ${ED}/usr/$(get_libdir)/libprotobuf$(get_libname "${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
|
||||
}
|
||||
Reference in New Issue
Block a user