summaryrefslogtreecommitdiff
blob: a041e913a4c23112e72eb68c1eebec09f122096a (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
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-fps/legends/legends-0.4.1.43-r1.ebuild,v 1.4 2015/04/21 17:39:47 pacho Exp $

EAPI=5
inherit eutils unpacker games

MY_P=${PN}_linux-${PV}
dir=${GAMES_PREFIX_OPT}/${PN}

DESCRIPTION="Fast-paced first-person-shooter online multiplayer game, similar to Tribes"
HOMEPAGE="http://legendsthegame.net/"
SRC_URI="http://legendsthegame.net/files/${MY_P}.run
	mirror://gentoo/${PN}.png"

LICENSE="Legends LGPL-2.1+"
SLOT="0"
KEYWORDS="-* amd64 x86"
IUSE="+dedicated"
RESTRICT="strip"

QA_TEXTRELS="${dir:1}/libSDL-1.3.so.0"
QA_FLAGS_IGNORED="${dir:1}/libSDL-1.3.so.0 ${dir:1}/LinLegends ${dir:1}/lindedicated"

DEPEND=""
RDEPEND="sys-libs/glibc
	amd64? ( sys-libs/glibc[multilib] )
	media-fonts/font-adobe-75dpi
	|| (
	(
		media-libs/libsdl[video,sound,opengl,abi_x86_32(-)]
		x11-libs/libX11[abi_x86_32(-)]
		x11-libs/libXext[abi_x86_32(-)]
		media-libs/libogg[abi_x86_32(-)]
		media-libs/libvorbis[abi_x86_32(-)]
		media-libs/openal[abi_x86_32(-)]
	)
	(
		>=app-emulation/emul-linux-x86-sdl-2.1[-abi_x86_32(-)]
		>=app-emulation/emul-linux-x86-soundlibs-2.1[-abi_x86_32(-)]
		app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
		app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
	) )
"

S=${WORKDIR}

src_unpack() {
	unpack_makeself ${MY_P}.run
	cd "${S}"

	# keep libSDL-1.3.so because legends requires it as of 0.4.0, and
	# 1.2.6 is highest in portage
	# rm libSDL-*.so*
	rm runlegends libSDL-1.2.so.0 libopenal.so libogg.so.0 libvorbis.so.0 *.DLL
}

src_install() {
	insinto "${dir}"
	doins -r * || die "doins * failed"

	rm "${D}/${dir}/"/{lindedicated,LinLegends,*.so.0}
	exeinto "${dir}"
	doexe lindedicated LinLegends *.so.0 || die "doexe failed"

	games_make_wrapper ${PN} "./LinLegends" "${dir}" "${dir}"
	if use dedicated ; then
		games_make_wrapper ${PN}-ded "./lindedicated" "${dir}" "${dir}"
	fi

	doicon "${DISTDIR}"/${PN}.png || die "doicon failed"
	make_desktop_entry legends "Legends"

	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst

	ewarn "Version ${PV} of ${PN} may give problems if there are"
	ewarn "config-files from earlier versions.  Removing the ~/.legends dir"
	ewarn "and restarting will solve this."
	echo
}