1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils games toolchain-funcs
8 [[ "${PV}" == 9999* ]] && inherit subversion
12 MY_P="${MY_PN}-${MY_PV}"
14 DESCRIPTION="Quake III Arena - 3rd installment of the classic id 3D first-person shooter"
15 HOMEPAGE="http://ioquake3.org/"
16 [[ "${PV}" != 9999* ]] && SRC_URI="http://ioquake3.org/files/${MY_PV}/${MY_P}.tar.bz2"
17 ESVN_REPO_URI="svn://svn.icculus.org/quake3/trunk"
21 KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd"
22 # 'smp' doesn't currently work on Linux
23 IUSE="dedicated opengl teamarena +openal curl vorbis voice mumble"
25 # FIXME Add to UIDEPEND once USE_INTERNAL_SPEEX is 0
26 # voice? ( media-libs/speex )
29 media-libs/libsdl[joystick,opengl,video,X]
30 openal? ( media-libs/openal )
31 !openal? ( media-libs/libsdl[audio] )
36 curl? ( net-misc/curl )
39 opengl? ( ${UIDEPEND} )
40 !dedicated? ( ${UIDEPEND} )
44 opengl? ( voice? ( mumble? ( media-sound/mumble ) ) )
45 !dedicated? ( voice? ( mumble? ( media-sound/mumble ) ) )
47 teamarena? ( games-fps/quake3-teamarena )
50 if [[ "${PV}" == 9999* ]] ; then
53 S="${WORKDIR}/${MY_P}"
59 amd64) echo "x86_64" ;;
66 amd64|ppc|x86) echo "linux" ;;
67 x86-fbsd) echo "freebsd" ;; # Should be tested
74 use $1 && echo 1 || echo 0
77 # FIXME Set USE_INTERNAL_SPEEX=0 once it works with media-libs/speex
78 # FIXME Add BUILD_CLIENT_SMP once smp support works
79 # FIXME Add FULLBINEXT (currently only in SVN)
81 BUILD_CLIENT=$(( $(buildit opengl) | $(buildit !dedicated) )) \
84 BUILD_SERVER=$(buildit dedicated) \
85 DEFAULT_BASEDIR="${GAMES_DATADIR}/${PN}" \
86 GENERATE_DEPENDENCIES=0 \
87 PLATFORM="$(my_platform)" \
88 USE_CODEC_VORBIS=$(buildit vorbis) \
89 USE_CURL=$(buildit curl) \
91 USE_INTERNAL_SPEEX=1 \
94 USE_MUMBLE=$(buildit mumble) \
95 USE_OPENAL=$(buildit openal) \
97 USE_VOIP=$(buildit voice) \
98 emake || die "emake failed"
102 dodoc id-readme.txt TODO README BUGS ChangeLog md4-readme.txt || die "dodoc"
104 dodoc voip-readme.txt || die "dodoc"
107 if use opengl || ! use dedicated ; then
108 doicon misc/quake3.svg || die "doicon"
110 # make_desktop_entry quake3-smp "Quake III Arena"
112 make_desktop_entry quake3 "Quake III Arena"
116 cd build/release-$(my_platform)-$(my_arch) || die
118 for exe in {ioquake3,ioquake3-smp,ioq3ded}.$(my_arch) ; do
119 if [[ -x ${exe} ]] ; then
121 newgamesbin ${exe} ${target} || die "newgamesbin ${target}"
122 dosym ${target} "${GAMES_BINDIR}/${target/io}" || die "dosym ${target}"
133 ewarn "The source version of Quake III Arena will not work with PunkBuster."
134 ewarn "If you need PB support, then use the games-fps/quake3-bin package."