summaryrefslogtreecommitdiff
blob: 4a6d057b4f35f731cf58fb18b56d92ae161b3a32 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-fps/quakeforge/quakeforge-0.5.5-r1.ebuild,v 1.3 2007/04/09 18:10:52 nyhm Exp $

inherit eutils autotools games

DESCRIPTION="A new 3d engine based off of id Softwares's legendary Quake and QuakeWorld game engine"
HOMEPAGE="http://www.quakeforge.net/"
SRC_URI="mirror://sourceforge/quake/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~ppc ~x86"
IUSE="cdinstall debug 3dfx fbcon opengl sdl svga X ncurses vorbis zlib ipv6 xv dga alsa oss"
RESTRICT="userpriv"

RDEPEND="3dfx? ( media-libs/glide-v3 )
	opengl? ( virtual/opengl )
	sdl? ( media-libs/libsdl )
	svga? ( media-libs/svgalib )
	X? (
		x11-libs/libX11
		x11-libs/libXext
		x11-libs/libXxf86vm )
	ncurses? ( sys-libs/ncurses )
	vorbis? ( media-libs/libogg media-libs/libvorbis )
	zlib? ( sys-libs/zlib )
	xv? (
		x11-libs/libX11
		x11-libs/libXext
		x11-libs/libXxf86vm )
	dga? ( x11-libs/libXxf86dga )
	alsa? ( media-libs/alsa-lib )"
DEPEND="${RDEPEND}
	cdinstall? ( games-fps/quake1-data )
	sys-devel/bison
	sys-devel/flex"

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}/${PV}"-ipv6.patch \
		"${FILESDIR}/${P}"-gcc41.patch \
		"${FILESDIR}/${P}"-keys.patch
}

src_compile() {
	#i should do this at some point :x ... i guess if you disable all shared stuff
	#and enable all the static options explicitly, static works ... (or so ive been told)
	#if ! use static ; then
	#	myconf="${myconf} --enable-shared=yes --enable-static=no"
	#else
	#	myconf="${myconf} --enable-shared=no --enable-static=yes"
	#fi

	local debugopts
	use debug \
		&& debugopts="--enable-debug --disable-optimize --enable-profile" \
		|| debugopts="--disable-debug --disable-profile"

	local clients=${QF_CLIENTS}
	use 3dfx && clients="${clients},3dfx"
	use fbcon && clients="${clients},fbdev"
	use opengl && clients="${clients},glx"
	use sdl && clients="${clients},sdl,sdl32"
	use sdl && use opengl && clients="${clients},sgl"
	use svga && clients="${clients},svga"
	use X && clients="${clients},x11"
	use X && use opengl && clients="${clients},wgl"
	[ "${clients:0:1}" == "," ] && clients=${clients:1}

	local servers=${QF_SERVERS:-master,nq,qw,qtv}

	local tools=${QF_TOOLS:-all}

	local svgaconf	# use old school way for broken conf opts
	use svga \
		&& svgaconf="--with-svga=/usr" \
		|| svgaconf="--without-svga"

	addpredict "$(games_get_libdir)"
	egamesconf \
		$(use_enable ncurses curses) \
		$(use_enable vorbis) \
		$(use_enable zlib) \
		$(use_with ipv6) \
		$(use_with fbcon fbdev) \
		${svgaconf} \
		$(use_with X x) \
		$(use_enable xv vidmode) \
		$(use_enable dga) \
		$(use_enable sdl) \
		--disable-xmms \
		$(use_enable alsa) \
		$(use_enable oss) \
		--enable-sound \
		--disable-optimize \
		${debugopts} \
		--with-global-cfg="${GAMES_SYSCONFDIR}"/quakeforge.conf \
		--with-sharepath="${GAMES_DATADIR}"/quake1 \
		--with-clients=${clients} \
		--with-servers=${servers} \
		--with-tools=${tools} \
		|| die
	make || die "make failed"
}

src_install() {
	emake DESTDIR="${D}" install || die "install failed"
	mv "${D}/${GAMES_PREFIX}"/include "${D}"/usr/
	dodoc ChangeLog NEWS TODO doc/*
	prepgamesdirs
}

pkg_postinst() {
	# same warning used in quake1 / quakeforge / nprquake-sdl
	games_pkg_postinst
	echo
	elog "Before you can play, you must make sure"
	elog "${PN} can find your Quake .pak files"
	elog
	elog "You have 2 choices to do this"
	elog "1 Copy pak*.pak files to ${GAMES_DATADIR}/quake1/id1"
	elog "2 Symlink pak*.pak files in ${GAMES_DATADIR}/quake1/id1"
	elog
	elog "Example:"
	elog "my pak*.pak files are in /mnt/secondary/Games/Quake/Id1/"
	elog "ln -s /mnt/secondary/Games/Quake/Id1/pak0.pak ${GAMES_DATADIR}/quake1/id1/pak0.pak"
	elog
	elog "You only need pak0.pak to play the demo version,"
	elog "the others are needed for registered version"
}