summaryrefslogtreecommitdiff
blob: f0facf3cb4d15e2a87951124e5d03d2ee22fed0d (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-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header$

inherit eutils games

DESCRIPTION="port of the original FreeSpace2"
HOMEPAGE="http://icculus.org/projects/freespace2/"
SRC_URI="mirror://gentoo/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE="debug mve"

RDEPEND="virtual/x11
	media-libs/libsdl
	media-libs/openal
	virtual/opengl"
DEPEND="${RDEPEND}
	>=sys-apps/sed-4"

src_unpack() {
	unpack ${A}

	# configure
	cd ${S}

	# disable debug
	if !(use debug); then
	    einfo "Disabling debug..."
	    sed -i \
		-e "s/^#CFLAGS+=-DNDEBUG/CFLAGS+=-DNDEBUG/" \
		Makefile
	fi

	# enable movie playing codes
	if (use mve); then
	    einfo "Enabling movies..."
	    sed -i \
		-e "s/^MVE=false/MVE=true/" \
		Makefile
	fi
}

src_compile() {
	emake || die "make error"
}

src_install() {
	dir=${GAMES_PREFIX_OPT}/${PN}

	dodir ${dir}
	exeinto ${dir}
	docinto ${dir}

	doexe freespace2
	dodoc README
	games_make_wrapper freespace2 ./freespace2 ${dir}

	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst
	einfo "Copy the data files from a FreeSpace2 Windows full installation"
	einfo "into ${dir}"
	einfo " Example: cp -r /mnt/winc/Games/FreeSpace2/* ${dir}"
	echo
	einfo "You can change resolution from 640x480 to 1024x768 if you edit"
	einfo " ~/.freespace2/FreeSpace2.ini (created on the first run)"
}