summaryrefslogtreecommitdiff
blob: 9d9aa34a2387c73145bce8edbbfe5b7ace7360bb (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit desktop flag-o-matic toolchain-funcs

MY_P="ChickensForLinux-Linux-${PV}"

DESCRIPTION="Target chickens with rockets and shotguns. Funny"
HOMEPAGE="http://www.chickensforlinux.com/"
SRC_URI="http://www.chickensforlinux.com/${MY_P}.tar.gz"
S="${WORKDIR}/${PN}"

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

RDEPEND="
	acct-group/gamestat
	media-libs/allegro:0[X]"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"

PATCHES=(
	"${FILESDIR}"/${P}-bitmap.patch
	"${FILESDIR}"/${P}-settings.patch
)

src_prepare() {
	default

	# sed kept for historical reasons
	sed -i 's|....\(.\)\(_\)\(.*.4x0\)\(.\)|M\4\2\x42\x6Fn\1s\2|' HighScores || die

	sed -i "s|HighScores|${EPREFIX}/var/games/${PN}.hs|" highscore.cpp || die

	sed -e "s|options.cfg|${EPREFIX}/etc/${PN}/&|" \
		-e "s|sound/|${EPREFIX}/usr/share/${PN}/&|" \
		-e "s|dat/|${EPREFIX}/usr/share/${PN}/&|" \
		-i main.cpp README || die
}

src_configure() {
	: # this configure file does no good
}

src_compile() {
	local obj=([!m]*.cpp)
	tc-export CXX
	append-cppflags $($(tc-getPKG_CONFIG) --cflags allegro || die)
	append-libs $($(tc-getPKG_CONFIG) --libs allegro || die)
	emake -E "main: ${obj[*]/.cpp/.o}" LDLIBS="${LIBS}"
}

src_install() {
	newbin main ${PN}
	dodoc AUTHOR README

	insinto /usr/share/${PN}
	doins -r dat sound

	insinto /etc/${PN}
	doins options.cfg

	insinto /var/games
	newins HighScores ${PN}.hs

	fowners :gamestat /usr/bin/${PN} /var/games/${PN}.hs
	fperms g+s /usr/bin/${PN}
	fperms 660  /var/games/${PN}.hs

	make_desktop_entry ${PN} ${PN^} applications-games
}