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

EAPI=7

inherit desktop toolchain-funcs

DESCRIPTION="Puzzle game like the known tetromino and the average pipe games"
HOMEPAGE="https://tamentis.com/projects/rezerwar/"
SRC_URI="https://tamentis.com/projects/rezerwar/files/${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"

DEPEND="
	media-libs/libsdl[sound,joystick,video]
	media-libs/sdl-mixer[vorbis]"
RDEPEND="${DEPEND}"

PATCHES=(
	"${FILESDIR}"/${P}-gcc-CC.patch
	"${FILESDIR}"/${P}-gcc10.patch
)

src_prepare() {
	default
	sed -i \
		-e '/check_sdl$/d' \
		-e 's/-O2 //' \
		configure \
		|| die 'sed failed'
	sed -i \
		-e '/CC.*OBJECTS/s:$(CC):$(CC) $(LDFLAGS):' \
		mkfiles/Makefile.src \
		|| die "sed failed"
}

src_configure() {
	tc-export CC

	SDLCONFIG=sdl-config \
	TARGET_BIN="${EPREFIX}/usr/bin" \
	TARGET_DOC="${EPREFIX}/usr/share/doc/${PF}" \
	TARGET_DATA="${EPREFIX}/usr/share/${PN}" \
		./configure || die "configure failed"
	sed -i \
		-e '/TARGET_DOC/d' \
		Makefile \
		|| die "sed failed"
}

src_install() {
	dodir /usr/bin
	default
	dodoc doc/{CHANGES,README,TODO}
	make_desktop_entry rezerwar Rezerwar
}