dev-libs/protobuf: use dot-a.eclass

... to avoid installing broken static libraries w/ LTO.

Only libupb installs a static library. dot-a works by adding
-ffat-lto-objects, which builds everything twice, so -- just like for
packages which have USE=static-libs -- we skip using it based on USE
conditions.

Closes: https://bugs.gentoo.org/958064
Acked-by: Paul Zander <negril.nx+gentoo@gmail.com>
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
This commit is contained in:
Eli Schwartz
2025-06-17 12:24:50 -04:00
parent 096fff4932
commit f2c3eeb37e
5 changed files with 30 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
EAPI=8
inherit cmake-multilib elisp-common multilib
inherit cmake-multilib dot-a elisp-common multilib
# NOTE from https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
ABSEIL_BRANCH="lts_2023_08_02"
@@ -76,6 +76,10 @@ src_prepare() {
}
multilib_src_configure() {
# 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_ABSL_PROVIDER="package"
-Dprotobuf_JSONCPP_PROVIDER="package"
@@ -135,6 +139,7 @@ src_test() {
}
multilib_src_install_all() {
use libupb && strip-lto-bytecode
find "${ED}" -name "*.la" -delete || die
if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf$(get_libname ${SLOT#*/})" ]]; then

View File

@@ -3,7 +3,7 @@
EAPI=8
inherit cmake-multilib elisp-common multilib
inherit cmake-multilib dot-a elisp-common multilib
# NOTE from https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
ABSEIL_BRANCH="lts_2023_08_02"
@@ -78,6 +78,10 @@ src_prepare() {
}
multilib_src_configure() {
# 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_ABSL_PROVIDER="package"
-Dprotobuf_JSONCPP_PROVIDER="package"
@@ -138,6 +142,7 @@ src_test() {
}
multilib_src_install_all() {
use libupb && strip-lto-bytecode
find "${ED}" -name "*.la" -delete || die
if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf$(get_libname ${SLOT#*/})" ]]; then

View File

@@ -3,7 +3,7 @@
EAPI=8
inherit cmake-multilib elisp-common multilib
inherit cmake-multilib dot-a elisp-common multilib
# NOTE from https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
ABSEIL_BRANCH="lts_2023_08_02"
@@ -80,6 +80,10 @@ src_prepare() {
}
multilib_src_configure() {
# 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_ABSL_PROVIDER="package"
-Dprotobuf_JSONCPP_PROVIDER="package"
@@ -147,6 +151,7 @@ src_test() {
}
multilib_src_install_all() {
use libupb && strip-lto-bytecode
find "${ED}" -name "*.la" -delete || die
if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf$(get_libname ${SLOT#*/})" ]]; then

View File

@@ -3,7 +3,7 @@
EAPI=8
inherit cmake-multilib elisp-common multilib
inherit cmake-multilib dot-a elisp-common multilib
# NOTE from https://github.com/protocolbuffers/protobuf/blob/main/cmake/dependencies.cmake
ABSEIL_MIN_VER="20250127.0"
@@ -77,6 +77,10 @@ src_prepare() {
}
multilib_src_configure() {
# 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)"
@@ -143,6 +147,7 @@ src_test() {
}
multilib_src_install_all() {
use libupb && strip-lto-bytecode
find "${ED}" -name "*.la" -delete || die
if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf$(get_libname "${SLOT#*/}")" ]]; then

View File

@@ -3,7 +3,7 @@
EAPI=8
inherit cmake-multilib elisp-common multilib
inherit cmake-multilib dot-a elisp-common multilib
# NOTE from https://github.com/protocolbuffers/protobuf/blob/main/cmake/dependencies.cmake
ABSEIL_MIN_VER="20250127.0"
@@ -77,6 +77,10 @@ src_prepare() {
}
multilib_src_configure() {
# 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)"
@@ -143,6 +147,7 @@ src_test() {
}
multilib_src_install_all() {
use libupb && strip-lto-bytecode
find "${ED}" -name "*.la" -delete || die
if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf$(get_libname "${SLOT#*/}")" ]]; then