]> Pileus Git - ~andy/sunrise/blob - games-fps/tremfusion/tremfusion-9999.ebuild
app-misc/autokey-gtk: Add ~amd64 keyword, EAPI bump
[~andy/sunrise] / games-fps / tremfusion / tremfusion-9999.ebuild
1 # Copyright 1999-2012 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 mercurial toolchain-funcs
8
9 MENU_PK3_VER="0.99r3"
10 DESCRIPTION="An enhanced modification of the free software first person shooter Tremulous, based on ioquake3"
11 HOMEPAGE="https://www.tremfusion.net/"
12 EHG_REPO_URI="http://tremfusion.net/hg/${PN}"
13 EHG_PROJECT="${P}"
14 SRC_URI="http://www.tremfusion.net/downloads/z-tremfusion-menu-${MENU_PK3_VER}.pk3"
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS=""
18 IUSE="dedicated openal +opengl tty +vorbis"
19
20 UIDEPEND="openal? ( media-libs/openal )
21         media-libs/libsdl
22         vorbis? ( media-libs/libogg media-libs/libvorbis )
23         virtual/opengl
24         sys-libs/ncurses"
25 RDEPEND="opengl? ( ${UIDEPEND} )
26         !opengl? ( !dedicated? ( ${UIDEPEND} ) )
27         media-libs/freetype
28         net-misc/curl
29         games-fps/tremulous"
30 DEPEND="${RDEPEND}
31         app-arch/unzip"
32
33 S=${WORKDIR}/${PN}
34
35 pkg_setup() {
36         buildit() { use $1 && echo 1 || echo 0 ; }
37 }
38
39 src_prepare() {
40         sed -i -e "s:release run-tremfusion.sh:run-tremfusion.sh:"  Makefile \
41                 || die "sed failed"
42 }
43
44 src_compile() {
45 # adjusting arch to x86_64 if arch is amd64
46         use amd64 && ARCH=x86_64
47
48         emake \
49                 BUILD_CLIENT=$(buildit opengl) \
50                 BUILD_SERVER=$(buildit dedicated) \
51                 BUILD_CLIENT_TTY=$(buildit tty) \
52                 BUILD_GAME_SO=0 \
53                 BUILD_GAME_QVM=0 \
54                 CC="$(tc-getCC)" \
55                 DEFAULT_BASEDIR="${GAMES_DATADIR}/${PN}" \
56                 USE_CODEC_VORBIS=$(buildit vorbis) \
57                 USE_OPENAL=$(buildit openal) \
58                 USE_LOCAL_HEADERS=0 \
59                 USE_SCM_VERSION=1 \
60                 || die "emake failed"
61 }
62
63 src_install() {
64         emake \
65                 BUILD_CLIENT=$(buildit opengl) \
66                 BUILD_SERVER=$(buildit dedicated) \
67                 BUILD_CLIENT_TTY=$(buildit tty) \
68                 INSTALL_PREFIX=/usr BUILDROOT="${D}" BINDIR="${GAMES_BINDIR}" DATADIR="${GAMES_DATADIR}" \
69                 install || die "emake install failed"
70         insinto "${GAMES_DATADIR}"/${PN}/${PN}/
71         doins "${DISTDIR}"/z-tremfusion-menu-${MENU_PK3_VER}.pk3 || die "doins failed"
72         dodoc README CC || die
73         doicon "${WORKDIR}"/tremfusion/misc/tremfusion.png
74         domenu misc/tremfusion.desktop
75         prepgamesdirs
76 }
77
78 pkg_postinst() {
79         games_pkg_postinst
80         elog "This is Tremfusion live mercurial ebuild"
81         elog "This package allows you to play on Tremulous servers"
82 }