|
| 1 | +# Copyright 1999-2024 Gentoo Authors |
| 2 | +# Distributed under the terms of the GNU General Public License v2 |
| 3 | + |
| 4 | +EAPI=8 |
| 5 | + |
| 6 | +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/guillemjover.asc |
| 7 | +inherit flag-o-matic multilib multilib-minimal verify-sig |
| 8 | + |
| 9 | +DESCRIPTION="Library to provide useful functions commonly found on BSD systems" |
| 10 | +HOMEPAGE="https://libbsd.freedesktop.org/wiki/ https://gitlab.freedesktop.org/libbsd/libbsd" |
| 11 | +SRC_URI="https://${PN}.freedesktop.org/releases/${P}.tar.xz" |
| 12 | +SRC_URI+=" verify-sig? ( https://${PN}.freedesktop.org/releases/${P}.tar.xz.asc )" |
| 13 | + |
| 14 | +LICENSE="BEER-WARE BSD BSD-2 BSD-4 ISC MIT" |
| 15 | +SLOT="0" |
| 16 | +KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux" |
| 17 | +IUSE="static-libs" |
| 18 | + |
| 19 | +RDEPEND="app-crypt/libmd[${MULTILIB_USEDEP}]" |
| 20 | +DEPEND=" |
| 21 | + ${RDEPEND} |
| 22 | + || ( >=sys-kernel/linux-headers-3.17 virtual/os-headers ) |
| 23 | +" |
| 24 | +BDEPEND="verify-sig? ( sec-keys/openpgp-keys-guillemjover )" |
| 25 | + |
| 26 | +multilib_src_configure() { |
| 27 | + # Broken (still) with lld-17 (bug #922342, bug #915068) |
| 28 | + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) |
| 29 | + |
| 30 | + # bug #911726 |
| 31 | + filter-flags -fno-semantic-interposition |
| 32 | + |
| 33 | + # The build system will install libbsd-ctor.a despite USE="-static-libs" |
| 34 | + # which is correct, see: |
| 35 | + # https://gitlab.freedesktop.org/libbsd/libbsd/commit/c5b959028734ca2281250c85773d9b5e1d259bc8 |
| 36 | + ECONF_SOURCE="${S}" econf $(use_enable static-libs static) |
| 37 | +} |
| 38 | + |
| 39 | +multilib_src_install() { |
| 40 | + emake DESTDIR="${D}" install |
| 41 | + |
| 42 | + find "${ED}" -type f -name "*.la" -delete || die |
| 43 | + |
| 44 | + # ld scripts on standalone prefix (RAP) systems should have the prefix |
| 45 | + # stripped from any paths, as the sysroot is automatically prepended. |
| 46 | + local ldscript=${ED}/usr/$(get_libdir)/${PN}$(get_libname) |
| 47 | + if use prefix && ! use prefix-guest && grep -qIF "ld script" "${ldscript}" 2>/dev/null; then |
| 48 | + sed -i "s|${EPREFIX}/|/|g" "${ldscript}" || die |
| 49 | + fi |
| 50 | +} |
0 commit comments