dev-libs/libxml2: arm64 stable (bug #701020)
[gentoo.git] / dev-libs / libx86 / libx86-1.1-r4.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 eutils toolchain-funcs flag-o-matic
7
8 DESCRIPTION="A hardware-independent library for executing real-mode x86 code"
9 HOMEPAGE="https://www.codon.org.uk/~mjg59/libx86/"
10 SRC_URI="https://www.codon.org.uk/~mjg59/${PN}/downloads/${P}.tar.gz"
11
12 LICENSE="BSD"
13 SLOT="0"
14 KEYWORDS="amd64 ~arm x86"
15 IUSE="static-libs"
16
17 src_prepare() {
18         # fix compile failure with linux-headers-2.6.26, bug 235599
19         eapply -p0 "${FILESDIR}/${PN}-0.99-ifmask.patch"
20         # Patch for bugs #236888 and #456648
21         eapply -p0 "${FILESDIR}/${P}-makefile.patch"
22         # Wider arch compatibility, bug #579682
23         eapply -p2 "${FILESDIR}/${P}-x86emu.patch"
24
25         eapply_user
26 }
27
28 src_configure() {
29         tc-export CC AR
30         append-flags -fno-delete-null-pointer-checks #523276
31 }
32
33 src_compile() {
34         local ARGS
35         use x86 || ARGS="BACKEND=x86emu"
36         emake ${ARGS} LIBRARY=shared shared
37         if use static-libs; then
38                 emake ${ARGS} objclean
39                 emake ${ARGS} LIBRARY=static static
40         fi
41 }
42
43 src_install() {
44         local install_static;
45         use static-libs && install_static='install-static'
46         emake \
47                 LIBDIR="/usr/$(get_libdir)" \
48                 DESTDIR="${D}" \
49                 install-header install-shared ${install_static}
50 }