dev-libs/cdk: ppc stable wrt bug #575040
[gentoo.git] / dev-libs / elfutils / elfutils-0.165.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 inherit eutils flag-o-matic multilib-minimal
8
9 DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
10 HOMEPAGE="https://fedorahosted.org/elfutils/"
11 SRC_URI="https://fedorahosted.org/releases/e/l/${PN}/${PV}/${P}.tar.bz2"
12
13 LICENSE="GPL-2-with-exceptions"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
16 IUSE="bzip2 lzma nls static-libs test +threads +utils"
17
18 # This pkg does not actually seem to compile currently in a uClibc
19 # environment (xrealloc errs), but we need to ensure that glibc never
20 # gets pulled in as a dep since this package does not respect virtual/libc
21 RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
22         bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
23         lzma? ( >=app-arch/xz-utils-5.0.5-r1[${MULTILIB_USEDEP}] )
24         !dev-libs/libelf
25         abi_x86_32? (
26                 !<=app-emulation/emul-linux-x86-baselibs-20130224-r11
27                 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
28         )"
29 # We need to require a newer glibc for its elf.h defs. #571814
30 DEPEND="${RDEPEND}
31         !<sys-libs/glibc-2.22
32         nls? ( sys-devel/gettext )
33         >=sys-devel/flex-2.5.4a
34         sys-devel/m4"
35
36 src_prepare() {
37         epatch "${FILESDIR}"/${PN}-0.118-PaX-support.patch
38         use static-libs || sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in
39         sed -i 's:-Werror::' */Makefile.in
40         # some patches touch both configure and configure.ac
41         find -type f -exec touch -r configure {} +
42 }
43
44 src_configure() {
45         use test && append-flags -g #407135
46         multilib-minimal_src_configure
47 }
48
49 multilib_src_configure() {
50         ECONF_SOURCE="${S}" econf \
51                 $(use_enable nls) \
52                 $(use_enable threads thread-safety) \
53                 --program-prefix="eu-" \
54                 --with-zlib \
55                 $(use_with bzip2 bzlib) \
56                 $(use_with lzma)
57 }
58
59 multilib_src_test() {
60         env     LD_LIBRARY_PATH="${BUILD_DIR}/libelf:${BUILD_DIR}/libebl:${BUILD_DIR}/libdw:${BUILD_DIR}/libasm" \
61                 LC_ALL="C" \
62                 emake check || die
63 }
64
65 multilib_src_install_all() {
66         einstalldocs
67         dodoc NOTES
68         # These build quick, and are needed for most tests, so don't
69         # disable their building when the USE flag is disabled.
70         use utils || rm -rf "${ED}"/usr/bin
71 }