summaryrefslogtreecommitdiff
blob: 1f56094d1317255cad1f27cfe8ed732dd5e78676 (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
91
92
93
94
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-strategy/savage-bin/savage-bin-2.00e-r1.ebuild,v 1.2 2014/06/25 17:28:07 mgorny Exp $

EAPI=5
inherit eutils games

DESCRIPTION="Unique mix of strategy and FPS"
HOMEPAGE="http://www.s2games.com/savage/
	http://www.notforidiots.com/SFE/
	http://www.newerth.com/"
SRC_URI="http://www.newerth.com/?id=downloads&op=downloadFile&file=SFE-Standalone.tar.gz&mirrorid=1 -> SFE-Standalone.tar.gz
	http://www.newerth.com/?id=downloads&op=downloadFile&file=SFE-Standalone.tar.gz&mirrorid=2 -> SFE-Standalone.tar.gz
	http://www.newerth.com/?id=downloads&op=downloadFile&file=SFE-Standalone.tar.gz&mirrorid=3 -> SFE-Standalone.tar.gz
	http://www.newerth.com/?id=downloads&op=downloadFile&file=lin-client-auth-patch.zip&mirrorid=1 -> lin-client-auth-patch.zip
	http://www.newerth.com/?id=downloads&op=downloadFile&file=lin-client-auth-patch.zip&mirrorid=2 -> lin-client-auth-patch.zip
	http://www.newerth.com/?id=downloads&op=downloadFile&file=lin-client-auth-patch.zip&mirrorid=3 -> lin-client-auth-patch.zip"

LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
RESTRICT="mirror bindist strip"

RDEPEND="
	|| (
		(
			>=media-libs/freetype-2.5.0.1[abi_x86_32(-)]
			>=media-libs/libsdl-1.2.15-r4[abi_x86_32(-)]
			>=virtual/jpeg-62:62[abi_x86_32(-)]
			>=virtual/opengl-7.0-r1[abi_x86_32(-)]
		)
		amd64? (
			(
				app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
				app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
				app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
				app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
			)
		)
	)"
DEPEND="app-arch/unzip"

S=${WORKDIR}

dir=${GAMES_PREFIX_OPT}/savage

QA_TEXTRELS="${dir:1}/libs/libfmod.so
	${dir:1}/libs/libfmod-3.75.so
	${dir:1}/game/game.so"
QA_EXECSTACK="${dir:1}/libs/libfmod.so
	${dir:1}/libs/libfmod-3.75.so"

src_prepare() {
	cp -f lin-client-auth-patch/silverback.bin .
	cp -f lin-client-auth-patch/game/game.so game/.
	cp -f lin-client-auth-patch/libs/libpng12.so.0 libs/.
	rm -rf lin-client-auth-patch/
	rm -f graveyard/game.dll *.sh
	sed -e "s:%GAMES_PREFIX_OPT%:${GAMES_PREFIX_OPT}:" \
		-e 's/^exec /__GL_ExtensionStringVersion=17700 exec /' \
		"${FILESDIR}"/savage > "${T}"/savage || die
	# Here, we default to the best resolution
	sed -i \
		-e 's/setsave vid_mode -1/setsave vid_mode 1/' \
		game/settings/default.cfg || die
}

src_install() {
	insinto "${dir}"
	doins -r *
	fperms g+x "${dir}"/silverback.bin
	dosym /dev/null "${dir}"/scripts.log

	dogamesbin "${T}"/savage
	make_desktop_entry savage "Savage: The Battle For Newerth"

	games_make_wrapper savage-graveyard "./silverback.bin set mod graveyard" \
		"${dir}" "${dir}"/libs
	sed -i \
		-e 's/^exec /__GL_ExtensionStringVersion=17700 exec /' \
		"${D}/${GAMES_BINDIR}/savage-graveyard" || die
	make_desktop_entry savage-graveyard "Savage: Graveyard"

	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst
	elog "In order to play \"Savage: The Battle For Newerth\", use:"
	elog "savage"
	elog "In order to start Editor, use:"
	elog "savage-graveyard"
}