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

EAPI=3

inherit eutils games

DESCRIPTION="2D battles of flying machines equipped with various slashing, piercing and blunt weaponry"
HOMEPAGE="http://www.koshutin.com/"
SRC_URI="hf-linux-${PV:4}${PV:0:4}-bin"

LICENSE="HPND"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="linguas_ru"

DEPEND="app-arch/unzip"
RDEPEND="media-libs/libsdl[joystick,sound,video]
	media-libs/openal"

RESTRICT="fetch"

S="${WORKDIR}"/data
dir="${GAMES_PREFIX_OPT}/${PN}"

pkg_nofetch() {
	ewarn
	ewarn "Place ${A} to ${DISTDIR}"
	ewarn
}

src_unpack() {
	unzip -q "${DISTDIR}"/${A}
	[ $? -gt 1 ] && die "unpacking failed"
}

src_install() {

	if use linguas_ru ; then
		einfo "Russian is chosen for primary language"
		mv Data/Dialogs/{russian,english}.seria
	fi

	insinto "${dir}"
	doins -r Data Media Objects Saves media.script strings.txt Config.ini \
		|| die "doins failed"

	if use amd64 ; then
		local exe=Hammerfight-amd64
	fi
	if use x86 ; then
		local exe=Hammerfight-x86
	fi
	exeinto "${dir}"
	doexe ${exe} || die "doexe failed"

	games_make_wrapper ${PN} ./${exe} "${dir}" "${dir}"
	doicon ${PN}.png
	make_desktop_entry ${PN} "Hammerfight" ${PN}

	prepgamesdirs
}