]> Pileus Git - ~andy/sunrise/blob - games-strategy/0ad/0ad-11339_alpha9.ebuild
games-strategy/0ad: fix test phase (was referring to non-existent useflag)
[~andy/sunrise] / games-strategy / 0ad / 0ad-11339_alpha9.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=3
6
7 WX_GTK_VER="2.8"
8
9 inherit eutils wxwidgets games
10
11 MY_PV="r${PV%_*}-alpha"
12 MY_P=${PN}-${MY_PV}
13
14 DESCRIPTION="A free, real-time strategy game"
15 HOMEPAGE="http://wildfiregames.com/0ad/"
16 SRC_URI="mirror://sourceforge/zero-ad/${MY_P}-unix-build.tar.xz"
17
18 LICENSE="GPL-2 LGPL-2.1 MIT CCPL-Attribution-ShareAlike-3.0 as-is"
19 SLOT="0"
20 KEYWORDS="~amd64"
21 IUSE="+audio +editor fam pch test"
22
23 RDEPEND="
24         ~dev-lang/spidermonkey-1.8.5
25         dev-libs/boost
26         dev-libs/libxml2
27         dev-util/nvidia-texture-tools
28         ~games-strategy/0ad-data-${PV}
29         media-libs/libpng:0
30         media-libs/libsdl[X,opengl,video]
31         net-libs/enet:1.3
32         net-misc/curl
33         sys-libs/zlib
34         virtual/jpeg
35         virtual/opengl
36         audio? ( media-libs/libogg
37                 media-libs/libvorbis
38                 media-libs/openal )
39         editor? ( x11-libs/wxGTK:$WX_GTK_VER[X,opengl] )
40         fam? ( virtual/fam )
41         "
42 DEPEND="${RDEPEND}
43         dev-util/pkgconfig
44         test? ( dev-lang/perl )"
45
46 S=${WORKDIR}/${MY_P}
47
48 src_prepare() {
49         # respect flags for 3rd party fcollada
50         epatch "${FILESDIR}"/11339_alpha9-fcollada-makefile.patch
51 }
52
53 src_configure() {
54         cd build/workspaces || die
55
56         # custom configure script
57         local myconf
58         use fam || myconf="--without-fam"
59         use pch || myconf="${myconf} --without-pch"
60         use test || myconf="${myconf} --without-tests"
61         use audio || myconf="${myconf} --without-audio"
62
63         # don't use bundled sources
64         ./update-workspaces.sh \
65                 --with-system-nvtt \
66                 --with-system-enet \
67                 --with-system-mozjs185 \
68                 $(use_enable editor atlas) \
69                 --bindir="${GAMES_BINDIR}" \
70                 --libdir="$(games_get_libdir)"/${PN} \
71                 --datadir="${GAMES_DATADIR}"/${PN} \
72                 ${myconf} || die
73 }
74
75 src_compile() {
76         emake -C build/workspaces/gcc verbose=1 || die
77 }
78
79 src_test() {
80         cd binaries/system || die
81         ./test || die "test phase failed"
82 }
83
84 src_install() {
85         # bin
86         dogamesbin binaries/system/pyrogenesis || die
87
88         # libs
89         exeinto "$(games_get_libdir)"/${PN}
90         doexe binaries/system/libCollada.so || die
91         if use editor ; then
92                 doexe binaries/system/libAtlasUI.so || die
93         fi
94
95         # other
96         dodoc binaries/system/readme.txt || die
97         doicon build/resources/${PN}.png || die
98         games_make_wrapper ${PN} "${GAMES_BINDIR}/pyrogenesis"
99         make_desktop_entry ${PN} ${PN} ${PN}
100
101         # permissions
102         prepgamesdirs
103 }