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

EAPI=8

inherit desktop flag-o-matic toolchain-funcs

DESCRIPTION="Multi-player 2D client/server space game"
HOMEPAGE="http://www.xpilot.org/"
SRC_URI="
	https://dev.gentoo.org/~ionen/distfiles/${PN}.png
	https://downloads.sourceforge.net/xpilotgame/${P}.tar.bz2"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~x86"

RDEPEND="
	x11-libs/libX11
	x11-libs/libXext"
DEPEND="
	${RDEPEND}
	x11-base/xorg-proto"
BDEPEND="
	app-text/rman
	sys-devel/gcc
	x11-misc/gccmakedep
	>=x11-misc/imake-1.0.8-r1"

DOCS=(
	README.txt
	doc/{ChangeLog,CREDITS,FAQ,TODO}
	doc/README.{MAPS,MAPS2,SHIPS,sounds,talkmacros}
)

src_prepare() {
	default

	sed -i \
		-e "/^INSTMAN/s|=.*|=${EPREFIX}/usr/share/man/man6|" \
		-e "/^INSTLIB/s|=.*|=${EPREFIX}/usr/share/${PN}|" \
		-e "/^INSTBIN/s|=.*|=${EPREFIX}/usr/bin|" \
		Local.config || die

	# work with glibc-2.20
	sed -i \
		-e 's/getline/lgetline/' \
		src/client/textinterface.c || die
}

src_configure() {
	append-cflags -std=gnu89 # old codebase, incompatible with c2x

	CC="$(tc-getBUILD_CC)" LD="$(tc-getLD)" \
		IMAKECPP="${IMAKECPP:-${CHOST}-gcc -E}" xmkmf -a || die
}

src_compile() {
	emake \
		AR="$(tc-getAR) cq" \
		CC="$(tc-getCC)" \
		RANLIB="$(tc-getRANLIB)" \
		CDEBUGFLAGS="${CFLAGS}" \
		LOCAL_LDFLAGS="${LDFLAGS}"
}

src_install() {
	default
	emake DESTDIR="${D}" install.man

	doicon "${DISTDIR}"/${PN}.png
	make_desktop_entry ${PN} XPilot
}