]> git.draconx.ca Git - gentoo-draconx.git/blob - games-fps/quake3/quake3-1.36.ebuild
mesa: Add 7.11-rc1 with intel unfuckage.
[gentoo-draconx.git] / games-fps / quake3 / quake3-1.36.ebuild
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="2"
6
7 inherit eutils games toolchain-funcs
8 [[ "${PV}" == 9999* ]] && inherit subversion
9
10 MY_PN="ioquake3"
11 MY_PV="${PV}"
12 MY_P="${MY_PN}-${MY_PV}"
13
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"
18
19 LICENSE="GPL-2"
20 SLOT="0"
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"
24
25 # FIXME Add to UIDEPEND once USE_INTERNAL_SPEEX is 0
26 #       voice? ( media-libs/speex )
27 UIDEPEND="
28         virtual/opengl
29         media-libs/libsdl[joystick,opengl,video,X]
30         openal? ( media-libs/openal )
31         !openal? ( media-libs/libsdl[audio] )
32         vorbis? (
33                 media-libs/libogg
34                 media-libs/libvorbis
35         )
36         curl? ( net-misc/curl )
37 "
38 DEPEND="
39         opengl? ( ${UIDEPEND} )
40         !dedicated? ( ${UIDEPEND} )
41 "
42 RDEPEND="
43         ${DEPEND}
44         opengl? ( voice? ( mumble? ( media-sound/mumble ) ) )
45         !dedicated? ( voice? ( mumble? ( media-sound/mumble ) ) )
46         games-fps/quake3-data
47         teamarena? ( games-fps/quake3-teamarena )
48 "
49
50 if [[ "${PV}" == 9999* ]] ; then
51         S="${WORKDIR}/trunk"
52 else
53         S="${WORKDIR}/${MY_P}"
54 fi
55
56 my_arch() {
57         case "${ARCH}" in
58                 x86)    echo "i386" ;;
59                 amd64)  echo "x86_64" ;;
60                 *)      tc-arch-kernel ;;
61         esac
62 }
63
64 my_platform() {
65         case "${ARCH}" in
66                 amd64|ppc|x86)  echo "linux" ;;
67                 x86-fbsd)       echo "freebsd" ;; # Should be tested
68         esac
69 }
70
71 src_compile() {
72
73         buildit() {
74                 use $1 && echo 1 || echo 0
75         }
76
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)
80         ARCH="$(my_arch)" \
81         BUILD_CLIENT=$(( $(buildit opengl) | $(buildit !dedicated) )) \
82         BUILD_GAME_QVM=0 \
83         BUILD_GAME_SO=0 \
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) \
90         USE_CURL_DLOPEN=0 \
91         USE_INTERNAL_SPEEX=1 \
92         USE_INTERNAL_ZLIB=0 \
93         USE_LOCAL_HEADERS=0 \
94         USE_MUMBLE=$(buildit mumble) \
95         USE_OPENAL=$(buildit openal) \
96         USE_OPENAL_DLOPEN=0 \
97         USE_VOIP=$(buildit voice) \
98         emake || die "emake failed"
99 }
100
101 src_install() {
102         dodoc id-readme.txt TODO README BUGS ChangeLog md4-readme.txt || die "dodoc"
103         if use voice ; then
104                 dodoc voip-readme.txt || die "dodoc"
105         fi
106
107         if use opengl || ! use dedicated ; then
108                 doicon misc/quake3.svg || die "doicon"
109                 #if use smp; then
110                 #       make_desktop_entry quake3-smp "Quake III Arena"
111                 #else
112                         make_desktop_entry quake3 "Quake III Arena"
113                 #fi
114         fi
115
116         cd build/release-$(my_platform)-$(my_arch) || die
117         local exe target
118         for exe in {ioquake3,ioquake3-smp,ioq3ded}.$(my_arch) ; do
119                 if [[ -x ${exe} ]] ; then
120                         target=${exe%.*}
121                         newgamesbin ${exe} ${target} || die "newgamesbin ${target}"
122                         dosym ${target} "${GAMES_BINDIR}/${target/io}" || die "dosym ${target}"
123                 fi
124         done
125
126         prepgamesdirs
127 }
128
129 pkg_postinst() {
130         games_pkg_postinst
131
132         elog
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."
135 }