summaryrefslogtreecommitdiff
blob: a0c04dabff667185b61c50929940e4aa1c91b57a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit autotools flag-o-matic

DESCRIPTION="GNU/Linux port of the MAME emulator with GUI menu"
HOMEPAGE="http://www.advancemame.it/"
SRC_URI="https://github.com/amadvance/advancemame/releases/download/v${PV}/${P}.tar.gz"

LICENSE="GPL-2 XMAME"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="alsa fbcon ncurses oss slang truetype"

DEPEND="
	dev-libs/expat
	media-libs/libsdl2[video]
	sys-libs/zlib
	alsa? ( media-libs/alsa-lib )
	ncurses? ( sys-libs/ncurses:= )
	slang? ( sys-libs/slang )
	truetype? ( media-libs/freetype:2 )
"
RDEPEND="
	${DEPEND}
	app-arch/unzip
	app-arch/zip
"
BDEPEND="
	virtual/pkgconfig
	x86? ( >=dev-lang/nasm-0.98 )
"

PATCHES=(
	"${FILESDIR}"/${PN}-pic.patch
	"${FILESDIR}"/${PN}-verboselog.patch

	# Patches from upstream
	"${FILESDIR}"/${P}-pkgconfig_for_ncurses_and_slang.patch
	"${FILESDIR}"/${P}-blank-flags.patch
	"${FILESDIR}"/${P}-DESTDIR.patch
	"${FILESDIR}"/${P}-FHS.patch
)

src_prepare() {
	default

	# AC_CHECK_CC_OPT is obsolete, superseded by AX_CHECK_COMPILE_FLAG
	sed -i -e 's/AC_CHECK_CC_OPT/AX_CHECK_COMPILE_FLAG/' configure.ac || die

	eautoreconf
}

src_configure() {
	# Fix for bug #78030
	use ppc && append-ldflags "-Wl,--relax"

	ac_cv_prog_ASM=nasm \
	econf \
		--enable-expat \
		--enable-sdl2 \
		--disable-sdl \
		--enable-zlib \
		--disable-slang \
		--disable-svgalib \
		$(use_enable alsa) \
		$(use_enable fbcon fb) \
		$(use_enable ncurses) \
		$(use_enable oss) \
		$(use_enable slang) \
		$(use_enable truetype freetype) \
		$(use_enable x86 asm)
}

src_compile() {
	emake \
		VERSION="${PV}"
}

src_install() {
	emake install \
		VERSION="${PV}" \
		DESTDIR="${D}"
}