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

EAPI=8

PYTHON_COMPAT=( python3_{10..12} )
inherit desktop python-single-r1

MY_P=${PN}-$(ver_cut 1-2)

DESCRIPTION="Action/arcade recreation of SolarFox"
HOMEPAGE="https://www.pygame.org/shredwheat/solarwolf/index.shtml"
SRC_URI="
	http://www.pygame.org/shredwheat/solarwolf/${MY_P}.tar.gz
	mirror://debian/pool/main/s/solarwolf/${MY_P/-/_}+dfsg1-${PV/*_p}.debian.tar.xz
"
S=${WORKDIR}/${MY_P}

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~hppa ~x86"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

RDEPEND="
	${PYTHON_DEPS}
	$(python_gen_cond_dep 'dev-python/pygame[${PYTHON_USEDEP}]')
	media-libs/sdl2-image[gif,png]
	media-libs/sdl2-mixer[mod,vorbis]
"
BDEPEND="${PYTHON_DEPS}"

PATCHES=(
	"${WORKDIR}"/debian/patches
)

src_prepare() {
	default

	sed -e "/CODEDIR = \"/s|= .*|= \"${EPREFIX}/usr/share/${PN}/code\"|" \
		-e "/DATADIR = \"/s|= .*|= \"${EPREFIX}/usr/share/${PN}\"|" \
		-i ${PN}.py || die
	python_fix_shebang ${PN}.py

	# default to windowed given it forces resolution and menus can be invisible
	sed -i '/^display = 1/s/1/0/' code/game.py || die

	rm -r data/.xvpics || die
	gzip -d dist/${PN}.6.gz || die
}

src_install() {
	newbin ${PN}.py ${PN}
	doman dist/${PN}.6

	insinto /usr/share/${PN}
	doins -r code data

	dodoc readme.txt

	newicon data/ship-big.png ${PN}.png
	make_desktop_entry ${PN} SolarWolf
}