dev-libs/elfutils: revert "arm stable, bug #676794"
[gentoo.git] / dev-libs / elfutils / elfutils-0.173.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit flag-o-matic multilib-minimal
7
8 DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
9 HOMEPAGE="http://elfutils.org/"
10 SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
11
12 LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
15 IUSE="bzip2 lzma nls static-libs test +threads +utils"
16
17 RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
18         bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
19         lzma? ( >=app-arch/xz-utils-5.0.5-r1[${MULTILIB_USEDEP}] )
20         !dev-libs/libelf"
21 DEPEND="${RDEPEND}
22         nls? ( sys-devel/gettext )
23         >=sys-devel/flex-2.5.4a
24         sys-devel/m4"
25
26 PATCHES=("${FILESDIR}"/${PN}-0.118-PaX-support.patch)
27
28 src_prepare() {
29         default
30
31         if ! use static-libs; then
32                 sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
33         fi
34         sed -i 's:-Werror::' */Makefile.in || die
35 }
36
37 src_configure() {
38         use test && append-flags -g #407135
39         multilib-minimal_src_configure
40 }
41
42 multilib_src_configure() {
43         ECONF_SOURCE="${S}" econf \
44                 $(use_enable nls) \
45                 $(use_enable threads thread-safety) \
46                 --program-prefix="eu-" \
47                 --with-zlib \
48                 $(use_with bzip2 bzlib) \
49                 $(use_with lzma)
50 }
51
52 multilib_src_test() {
53         env     LD_LIBRARY_PATH="${BUILD_DIR}/libelf:${BUILD_DIR}/libebl:${BUILD_DIR}/libdw:${BUILD_DIR}/libasm" \
54                 LC_ALL="C" \
55                 emake check VERBOSE=1
56 }
57
58 multilib_src_install_all() {
59         einstalldocs
60         dodoc NOTES
61         # These build quick, and are needed for most tests, so don't
62         # disable their building when the USE flag is disabled.
63         if ! use utils; then
64                 rm -rf "${ED}"/usr/bin || die
65         fi
66 }