dev-libs/libbsd: x86 stable (bug #666842)
[gentoo.git] / dev-libs / libbsd / libbsd-0.8.6.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit multilib-minimal
6
7 DESCRIPTION="An library to provide useful functions commonly found on BSD systems"
8 HOMEPAGE="https://libbsd.freedesktop.org/wiki/"
9 SRC_URI="https://${PN}.freedesktop.org/releases/${P}.tar.xz"
10
11 LICENSE="BSD BSD-2 BSD-4 ISC"
12 SLOT="0"
13 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux"
14 IUSE="static-libs"
15
16 DEPEND=">=sys-kernel/linux-headers-3.17"
17 RDEPEND=""
18
19 PATCHES=(
20         "${FILESDIR}/${PN}-0.8.6-sparc.patch"
21 )
22
23 pkg_setup() {
24         local f="${EROOT}/usr/$(get_libdir)/${PN}.a"
25         local m="You need to remove ${f} by hand or re-emerge sys-libs/glibc first."
26         if ! has_version ${CATEGORY}/${PN}; then
27                 if [[ -e ${f} ]]; then
28                         eerror "${m}"
29                         die "${m}"
30                 fi
31         fi
32 }
33
34 multilib_src_configure() {
35         # The build system will install libbsd-ctor.a despite of USE="-static-libs"
36         # which is correct, see:
37         # https://cgit.freedesktop.org/libbsd/commit/?id=c5b959028734ca2281250c85773d9b5e1d259bc8
38         ECONF_SOURCE="${S}" econf $(use_enable static-libs static)
39 }
40
41 multilib_src_install() {
42         emake DESTDIR="${D}" install
43         find "${ED}" -name "*.la" -delete || die
44 }