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

EAPI="2"

inherit d-games

MY_PD=gunroar
MY_PDV=0_15
MY_PDPV=0.15
MY_PN=gr_hi
MY_PV=${PV//./_}

DESCRIPTION="Guns, Guns, Guns! 360-degree gunboat shooter, fork of ABAs 'Gunroar'"
HOMEPAGE="http://www.edit.ne.jp/~otoyan/soft/gr_hi.html"
SRC_URI="http://www.edit.ne.jp/~otoyan/soft/gr_hi/${MY_PN}${MY_PV}.zip
	mirror://debian/pool/main/g/${MY_PD}/${MY_PD}_${MY_PDPV}.dfsg1-3.diff.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~ppc ~x86"
IUSE=""

RDEPEND="media-libs/libsdl
	media-libs/mesa
	media-libs/sdl-mixer"

DEPEND="${RDEPEND}"

S=${WORKDIR}/${MY_PN}

src_prepare(){
	# using frostworks patches with debian's cleanups and minor patches
	epatch "${WORKDIR}"/${MY_PD}_${MY_PDPV}.dfsg1-3.diff
	sed -i -e "s:a7xpg-0.11.dfsg1/::g" -i "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/makefile.patch
	sed -i -e "s:${MY_PD}:${PN}:g" -i "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/makefile.patch
	sed -i -e "s:${MY_PD}_${MY_PDPV}.dfsg1.orig/:old-gr:g" -i "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/03_put_prefs_in_home_dir.diff
	sed -i -e "s:${MY_PD}_${MY_PDPV}.dfsg1/:new-gr:g" -i "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/03_put_prefs_in_home_dir.diff
	sed -i -e "s:${MY_PD}_${MY_PDPV}.dfsg1.hi.orig/:old-gr:g" -i "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/gunroar-hot-iron.patch
	sed -i -e "s:${MY_PD}_${MY_PDPV}.dfsg1.hi/:new-gr:g" -i "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/gunroar-hot-iron.patch
	epatch "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/01_sdl_fix_imports.diff
	epatch "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/02_d_language_changes.diff
	epatch "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/04_adapt_build_file_to_linux.diff
	epatch "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/windowed.patch
	epatch "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/makefile.patch
	epatch "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/gdc-0.24-semantics-for-version.patch
	epatch "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/window-resizing.patch
	epatch "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/patches/avoid-segfault-when-sdl-fails.patch
	epatch "${FILESDIR}"/03_put_prefs_in_home_dir.diff
	sed -i \
	-e 's:"\(images/[^"]*\)":"'${GAMES_DATADIR}'/'${PN}'/\1":g' -i src/abagames/util/sdl/texture.d \
	-e 's:"\(sounds/[^"]*\)":"'${GAMES_DATADIR}'/'${PN}'/\1":g' -i src/abagames/util/sdl/sound.d \
		|| die "sed failed"
}

src_install() {
	dogamesbin ${PN}

	local datadir="${GAMES_DATADIR}"/${PN}
	dodir ${datadir}
	insinto "${GAMES_DATADIR}"/${PN}
	doins -r images sounds || die
	newicon "${S}"/${MY_PD}-${MY_PDPV}.dfsg1/debian/${MY_PD}.xpm ${PN}.xpm
	make_desktop_entry ${PN} ${PN}
	dodoc readme*
	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst
}