media-libs/leptonica: remove local webp use flag
[gentoo.git] / sys-libs / binutils-libs / binutils-libs-2.28.1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 PATCHVER="1.0"
7
8 inherit eutils toolchain-funcs multilib-minimal
9
10 MY_PN="binutils"
11 MY_P="${MY_PN}-${PV}"
12
13 DESCRIPTION="Core binutils libraries (libbfd, libopcodes, libiberty) for external packages"
14 HOMEPAGE="https://sourceware.org/binutils/"
15 SRC_URI="mirror://gnu/binutils/${MY_P}.tar.bz2
16         mirror://gentoo/${MY_P}-patches-${PATCHVER}.tar.xz"
17
18 LICENSE="|| ( GPL-3 LGPL-3 )"
19 # The shared lib SONAMEs use the ${PV} in them.
20 SLOT="0/${PV}"
21 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
22 IUSE="64-bit-bfd multitarget nls static-libs"
23
24 COMMON_DEPEND="sys-libs/zlib[${MULTILIB_USEDEP}]"
25 DEPEND="${COMMON_DEPEND}
26         >=sys-apps/texinfo-4.7
27         nls? ( sys-devel/gettext )"
28 # Need a newer binutils-config that'll reset include/lib symlinks for us.
29 RDEPEND="${COMMON_DEPEND}
30         >=sys-devel/binutils-config-5
31         nls? ( !<sys-devel/gdb-7.10-r1[nls] )"
32
33 S="${WORKDIR}/${MY_P}"
34
35 MULTILIB_WRAPPED_HEADERS=(
36         /usr/include/bfd.h
37 )
38
39 src_prepare() {
40         EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
41 }
42
43 pkgversion() {
44         printf "Gentoo ${PVR}"
45         [[ -n ${PATCHVER} ]] && printf " p${PATCHVER}"
46 }
47
48 multilib_src_configure() {
49         local myconf=(
50                 --enable-obsolete
51                 --enable-shared
52                 --enable-threads
53                 # Newer versions (>=2.24) make this an explicit option. #497268
54                 --enable-install-libiberty
55                 --disable-werror
56                 --with-bugurl="https://bugs.gentoo.org/"
57                 --with-pkgversion="$(pkgversion)"
58                 $(use_enable static-libs static)
59                 # The binutils eclass enables this flag for all bi-arch builds,
60                 # but other tools often don't care about that support.  Put it
61                 # beyond a flag if people really want it, but otherwise leave
62                 # it disabled as it can slow things down on 32bit arches. #438522
63                 $(use_enable 64-bit-bfd)
64                 # This only disables building in the zlib subdir.
65                 # For binutils itself, it'll use the system version. #591516
66                 --without-zlib
67                 --with-system-zlib
68                 # We only care about the libs, so disable programs. #528088
69                 --disable-{binutils,etc,ld,gas,gold,gprof}
70                 # Disable modules that are in a combined binutils/gdb tree. #490566
71                 --disable-{gdb,libdecnumber,readline,sim}
72                 # Strip out broken static link flags.
73                 # https://gcc.gnu.org/PR56750
74                 --without-stage1-ldflags
75         )
76
77         use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
78
79         use nls \
80                 && myconf+=( --without-included-gettext ) \
81                 || myconf+=( --disable-nls )
82
83         ECONF_SOURCE=${S} \
84         econf "${myconf[@]}"
85 }
86
87 multilib_src_install() {
88         default
89         # Provide libiberty.h directly.
90         dosym libiberty/libiberty.h /usr/include/libiberty.h
91 }
92
93 multilib_src_install_all() {
94         use static-libs || find "${ED}"/usr -name '*.la' -delete
95 }