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

EAPI=6

inherit flag-o-matic eutils

MY_PV=${PV/0./}
MY_PV=${MY_PV//./-}
SIMUPAK="simupak64-${MY_PV%-[0-9]*}.zip"

DESCRIPTION="A free Transport Tycoon clone"
HOMEPAGE="http://www.simutrans.com/"
SRC_URI="mirror://sourceforge/simutrans/simutrans-src-${MY_PV}.zip
	http://simutrans-germany.com/translator/data/tab/language_pack-Base+texts.zip
	mirror://sourceforge/simutrans/${SIMUPAK}"

LICENSE="Artistic"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86"
IUSE=""

RDEPEND="
	sys-libs/zlib
	app-arch/bzip2
	media-libs/sdl-mixer
	media-libs/libpng:0
	media-libs/libsdl[sound,video]"

DEPEND="
	${RDEPEND}
	app-arch/unzip"

S=${WORKDIR}

PATCHES=(
	"${FILESDIR}"/${P}-Makefile.patch
)

src_unpack() {
	unpack simutrans-src-${MY_PV}.zip
	unpack "${SIMUPAK}"

	# Bundled text files are incomplete, bug #580948
	cd "${S}/simutrans/text" || die
	unpack language_pack-Base+texts.zip
}

src_prepare() {
	default

	strip-flags # bug #293927
	printf "BACKEND=mixer_sdl\nCOLOUR_DEPTH=16\nOSTYPE=linux\nVERBOSE=1" \
		> config.default || die

	# make it look in the install location for the data
	sed -i \
		-e "s:argv\[0\]:\"/usr/share/${PN}/\":" \
		simmain.cc || die

	rm simutrans/*.txt || die
}

src_install() {
	newbin build/default/sim ${PN}
	insinto /usr/share/${PN}
	doins -r simutrans/*
	dodoc documentation/*
	doicon simutrans.ico
	make_desktop_entry simutrans Simutrans /usr/share/pixmaps/simutrans.ico
}