dev-libs/libnfc: bump
[gentoo.git] / dev-libs / elfutils / elfutils-0.179.ebuild
1 # Copyright 2003-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
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 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
15 IUSE="bzip2 lzma nls static-libs test +threads +utils valgrind"
16
17 RDEPEND=">=sys-libs/zlib-1.2.8-r1[static-libs?,${MULTILIB_USEDEP}]
18         bzip2? ( >=app-arch/bzip2-1.0.6-r4[static-libs?,${MULTILIB_USEDEP}] )
19         lzma? ( >=app-arch/xz-utils-5.0.5-r1[static-libs?,${MULTILIB_USEDEP}] )
20         !dev-libs/libelf"
21 DEPEND="${RDEPEND}
22         valgrind? ( dev-util/valgrind )
23 "
24 BDEPEND="nls? ( sys-devel/gettext )
25         >=sys-devel/flex-2.5.4a
26         sys-devel/m4"
27
28 RESTRICT="!test? ( test )"
29
30 PATCHES=(
31         "${FILESDIR}"/${PN}-0.175-disable-biarch-test-PR24158.patch
32         "${FILESDIR}"/${PN}-0.177-disable-large.patch
33         "${FILESDIR}"/${PN}-0.179-PaX-support.patch
34 )
35
36 src_prepare() {
37         default
38
39         if ! use static-libs; then
40                 sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
41         fi
42         # https://sourceware.org/PR23914
43         sed -i 's:-Werror::' */Makefile.in || die
44 }
45
46 src_configure() {
47         use test && append-flags -g #407135
48
49         # Symbol aliases are implemented as asm statements.
50         # Will require porting: https://gcc.gnu.org/PR48200
51         filter-flags '-flto*'
52
53         multilib-minimal_src_configure
54 }
55
56 multilib_src_configure() {
57         ECONF_SOURCE="${S}" econf \
58                 $(use_enable nls) \
59                 $(use_enable threads thread-safety) \
60                 $(use_enable valgrind) \
61                 --disable-debuginfod \
62                 --program-prefix="eu-" \
63                 --with-zlib \
64                 $(use_with bzip2 bzlib) \
65                 $(use_with lzma)
66 }
67
68 multilib_src_test() {
69         env     LD_LIBRARY_PATH="${BUILD_DIR}/libelf:${BUILD_DIR}/libebl:${BUILD_DIR}/libdw:${BUILD_DIR}/libasm" \
70                 LC_ALL="C" \
71                 emake check VERBOSE=1
72 }
73
74 multilib_src_install_all() {
75         einstalldocs
76         dodoc NOTES
77         # These build quick, and are needed for most tests, so don't
78         # disable their building when the USE flag is disabled.
79         if ! use utils; then
80                 rm -rf "${ED}"/usr/bin || die
81         fi
82 }