summaryrefslogtreecommitdiff
blob: 7920a08313c0de46671672d01b25f021aa879c28 (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit autotools desktop

DESCRIPTION="Heroes Enjoy Riding Over Empty Slabs: similar to Tron and Nibbles"
HOMEPAGE="http://heroes.sourceforge.net/"
SRC_URI="
	mirror://sourceforge/${PN}/${P}.tar.bz2
	mirror://sourceforge/${PN}/${PN}-data-1.5.tar.bz2
	mirror://sourceforge/${PN}/${PN}-sound-tracks-1.0.tar.bz2
	mirror://sourceforge/${PN}/${PN}-sound-effects-1.0.tar.bz2
	https://dev.gentoo.org/~ionen/distfiles/${PN}.png"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="ggi nls +sdl"
REQUIRED_USE="^^ ( ggi sdl )"
RESTRICT="test"

RDEPEND="
	ggi? (
		media-libs/libggi
		media-libs/libgii
		media-libs/libmikmod
	)
	nls? ( virtual/libintl )
	sdl? (
		media-libs/libsdl[joystick,sound,video]
		media-libs/sdl-mixer[mod]
	)"
DEPEND="${RDEPEND}"
BDEPEND="nls? ( sys-devel/gettext )"

PATCHES=(
	"${FILESDIR}"/${P}-autotools.patch
	"${FILESDIR}"/${P}-gcc4.patch
	"${FILESDIR}"/${P}-cvs-segfault-fix.patch
	"${FILESDIR}"/${P}-compilation.patch
	"${FILESDIR}"/${P}-gcc10.patch
)

src_prepare() {
	default

	eautoreconf
}

src_configure() {
	local econfargs=(
		$(use_enable nls)
		$(use_with ggi mikmod)
		$(use_with ggi)
		$(use_with sdl sdl-mixer)
		$(use_with sdl)
		--disable-heroes-debug
		--disable-optimizations
	)

	local pkg
	for pkg in ${A% *}; do
		cd "${WORKDIR}"/${pkg%.tar.bz2} || die
		econf "${econfargs[@]}"
	done
}

src_install() {
	local pkg
	for pkg in ${A% *}; do
		emake -C "${WORKDIR}"/${pkg%.tar.bz2} DESTDIR="${D}" install
	done

	einstalldocs

	doicon "${DISTDIR}"/${PN}.png
	make_desktop_entry ${PN} Heroes
}