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

EAPI=6

inherit cmake-utils eutils gnome2-utils

DESCRIPTION="A kart racing game starring Tux, the linux penguin (TuxKart fork)"
HOMEPAGE="https://supertuxkart.net/"
SRC_URI="mirror://sourceforge/${PN}/SuperTuxKart/${PV}/${P}-src.tar.xz
	mirror://gentoo/${PN}.png"

LICENSE="GPL-2 GPL-3 CC-BY-SA-3.0 CC-BY-2.0 public-domain ZLIB"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="debug fribidi wiimote"

# don't unbundle irrlicht and bullet
# both are modified and system versions will break the game
# https://sourceforge.net/p/irrlicht/feature-requests/138/

RDEPEND="
	media-libs/glew:0=
	media-libs/libpng:0=
	media-libs/libvorbis
	media-libs/openal
	net-libs/enet:1.3=
	net-misc/curl
	sys-libs/zlib
	virtual/glu
	virtual/jpeg:0
	virtual/libintl
	virtual/opengl
	x11-libs/libX11
	x11-libs/libXxf86vm
	fribidi? ( dev-libs/fribidi )
	wiimote? ( net-wireless/bluez )"
DEPEND="${RDEPEND}
	sys-devel/gettext
	virtual/pkgconfig"

PATCHES=(
	"${FILESDIR}"/${PN}-0.9.2-unbundle-enet.patch
	"${FILESDIR}"/${PN}-0.9.2-unbundle-libs.patch
	"${FILESDIR}"/${PN}-0.9.2-fix-angelscript.patch
	"${FILESDIR}"/${PN}-0.9.2-irrlicht-arch-support.patch
	"${FILESDIR}"/${PN}-0.9.2-irrlicht-as-needed.patch
	"${FILESDIR}"/${PN}-0.9.2-irrlicht-bundled-libs.patch
	"${FILESDIR}"/${PN}-0.9.2-irrlicht-system-libs.patch
	"${FILESDIR}"/${PN}-0.9.2-fix-buildsystem.patch
)

src_prepare() {
	cmake-utils_src_prepare

	# remove bundled libraries, just to be sure
	rm -r lib/{enet,glew,jpeglib,libpng,zlib} || die
}

src_configure() {
	local mycmakeargs=(
		# system dev-libs/angelscript leads
		# to failed assert segfaults
		-DUSE_SYSTEM_ANGELSCRIPT=OFF
		-DUSE_FRIBIDI=$(usex fribidi)
		-DUSE_WIIUSE=$(usex wiimote)
		-DSTK_INSTALL_BINARY_DIR=bin
		-DSTK_INSTALL_DATA_DIR=share/${PN}
	)
	cmake-utils_src_configure
}

src_install() {
	cmake-utils_src_install
	dodoc CHANGELOG.md TODO.md

	doicon -s 64 "${DISTDIR}"/${PN}.png
}

pkg_preinst() {
	gnome2_icon_savelist
}

pkg_postinst() {
	gnome2_icon_cache_update
}

pkg_postrm() {
	gnome2_icon_cache_update
}