dev-util/clair: 2.1.3 bump
[gentoo.git] / games-emulation / advancemame / advancemame-3.9.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit autotools flag-o-matic
7
8 DESCRIPTION="GNU/Linux port of the MAME emulator with GUI menu"
9 HOMEPAGE="http://www.advancemame.it/"
10 SRC_URI="https://github.com/amadvance/advancemame/releases/download/v${PV}/${P}.tar.gz"
11
12 LICENSE="GPL-2 XMAME"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="alsa fbcon ncurses oss slang truetype"
16
17 DEPEND="
18         dev-libs/expat
19         media-libs/libsdl2[video]
20         sys-libs/zlib
21         alsa? ( media-libs/alsa-lib )
22         ncurses? ( sys-libs/ncurses:= )
23         slang? ( sys-libs/slang )
24         truetype? ( media-libs/freetype:2 )
25 "
26 RDEPEND="
27         ${DEPEND}
28         app-arch/unzip
29         app-arch/zip
30 "
31 BDEPEND="
32         sys-devel/autoconf-archive
33         virtual/pkgconfig
34         x86? ( >=dev-lang/nasm-0.98 )
35 "
36
37 PATCHES=(
38         "${FILESDIR}"/${PN}-pic.patch
39         "${FILESDIR}"/${PN}-verboselog.patch
40
41         # Patches from upstream
42         "${FILESDIR}"/${P}-pkgconfig_for_ncurses_and_slang.patch
43         "${FILESDIR}"/${P}-blank-flags.patch
44         "${FILESDIR}"/${P}-DESTDIR.patch
45         "${FILESDIR}"/${P}-FHS.patch
46 )
47
48 src_prepare() {
49         default
50
51         # AC_CHECK_CC_OPT is obsolete, superseded by AX_CHECK_COMPILE_FLAG
52         sed -i -e 's/AC_CHECK_CC_OPT/AX_CHECK_COMPILE_FLAG/' configure.ac || die
53
54         eautoreconf
55 }
56
57 src_configure() {
58         # Fix for bug #78030
59         use ppc && append-ldflags "-Wl,--relax"
60
61         ac_cv_prog_ASM=nasm \
62         econf \
63                 --enable-expat \
64                 --enable-sdl2 \
65                 --disable-sdl \
66                 --enable-zlib \
67                 --disable-slang \
68                 --disable-svgalib \
69                 $(use_enable alsa) \
70                 $(use_enable fbcon fb) \
71                 $(use_enable ncurses) \
72                 $(use_enable oss) \
73                 $(use_enable slang) \
74                 $(use_enable truetype freetype) \
75                 $(use_enable x86 asm)
76 }
77
78 src_compile() {
79         emake \
80                 VERSION="${PV}"
81 }
82
83 src_install() {
84         emake -j1 install \
85                 VERSION="${PV}" \
86                 DESTDIR="${D}"
87 }