summaryrefslogtreecommitdiff
blob: a48411c2dc0b4b507bc786538a2d45f270280394 (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
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-fps/quake1/quake1-2.40.ebuild,v 1.7 2004/11/20 09:33:44 mr_bones_ Exp $

inherit eutils gcc games

DESCRIPTION="The original Quake engine straight from id !"
HOMEPAGE="http://www.idsoftware.com/games/quake/quake/"
SRC_URI="ftp://ftp.idsoftware.com/idstuff/source/q1source.zip"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE="X opengl svga 3dfx"

RDEPEND="X? ( virtual/x11 )
	opengl? ( virtual/opengl )
	svga? ( media-libs/svgalib )
	3dfx? ( media-libs/glide-v3 )"
DEPEND="${RDEPEND}
	app-arch/unzip"

S=${WORKDIR}

pkg_setup() {
	games_pkg_setup
	echo
	ewarn "You probably want games-fps/quakeforge if you're"
	ewarn "looking for a quake1 client ..."
}

src_unpack() {
	unpack ${A}

	epatch "${FILESDIR}/fix-sys_printf.patch"

	mv WinQuake/Makefile{.linuxi386,}
	mv QW/Makefile{.Linux,}

	epatch "${FILESDIR}/makefile-path-fixes.patch"

	[ $(gcc-major-version) -eq 3 ] \
		&& epatch "${FILESDIR}/makefile-gcc3-cflags.patch" \
		|| epatch "${FILESDIR}/makefile-gcc2-cflags.patch"
	sed -i "s:GENTOO_CFLAGS:${CFLAGS} -DGL_EXT_SHARED=1:" {WinQuake,QW}/Makefile
	cp QW/client/glquake.h{,.orig}
	(echo "#define APIENTRY";cat QW/client/glquake.h.orig) > QW/client/glquake.h

	epatch "${FILESDIR}/makefile-sedable.patch"
	if ! use 3dfx ; then
		sed -i 's:^   $(BUILDDIR)/bin/glquake ::' WinQuake/Makefile
		sed -i 's:^   $(BUILDDIR)/bin/glquake.3dfxgl ::' WinQuake/Makefile
		sed -i 's:^   $(BUILDDIR)/glqwcl ::' QW/Makefile
	fi
	if ! use X ; then
		sed -i 's:^   $(BUILDDIR)/bin/quake.x11 ::' WinQuake/Makefile
		sed -i 's:^   $(BUILDDIR)/qwcl.x11 ::' QW/Makefile
	fi
	if ! use opengl ; then
		sed -i 's:^   $(BUILDDIR)/bin/quake.glx ::' WinQuake/Makefile
		sed -i 's:^   $(BUILDDIR)/glqwcl.glx ::' QW/Makefile
	fi
	if ! use svga ; then
		sed -i 's:^   $(BUILDDIR)/bin/squake ::' WinQuake/Makefile
		sed -i 's:^   $(BUILDDIR)/qwcl ::' QW/Makefile
	fi
}

src_compile() {
	make -C "${S}/WinQuake" build_release || die "failed to build WinQuake"
	make -C "${S}/QW" build_release || die "failed to build QW"
}

src_install() {
	dogamesbin WinQuake/release*/bin/* QW/release*/*qw* || die "dogamesbin failed"
	dodoc readme.txt {WinQuake,QW}/*.txt
	prepgamesdirs
}