]> Pileus Git - ~andy/sunrise/blob - games-strategy/0ad/0ad-11339_alpha9.ebuild
punt old crap
[~andy/sunrise] / games-strategy / 0ad / 0ad-11339_alpha9.ebuild
1 # Copyright 1999-2013 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="0AD"
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         media-gfx/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         virtual/pkgconfig
44         test? ( dev-lang/perl )"
45
46 S=${WORKDIR}/${MY_P}
47
48 src_prepare() {
49         # respect flags for 3rd party fcollada
50         # fix test-phase
51         epatch "${FILESDIR}"/11339_alpha9-fcollada-makefile.patch \
52                 "${FILESDIR}"/11339_alpha9-test.patch
53 }
54
55 src_configure() {
56         cd build/workspaces || die
57
58         # custom configure script
59         local myconf
60         use fam || myconf="--without-fam"
61         use pch || myconf="${myconf} --without-pch"
62         use test || myconf="${myconf} --without-tests"
63         use audio || myconf="${myconf} --without-audio"
64
65         # don't use bundled sources
66         ./update-workspaces.sh \
67                 --with-system-nvtt \
68                 --with-system-enet \
69                 --with-system-mozjs185 \
70                 $(use_enable editor atlas) \
71                 --bindir="${GAMES_BINDIR}" \
72                 --libdir="$(games_get_libdir)"/${PN} \
73                 --datadir="${GAMES_DATADIR}"/${PN} \
74                 ${myconf} || die
75 }
76
77 src_compile() {
78         emake -C build/workspaces/gcc verbose=1 || die
79 }
80
81 src_test() {
82         cd binaries/system || die
83         ./test || die "test phase failed"
84 }
85
86 src_install() {
87         # bin
88         dogamesbin binaries/system/pyrogenesis || die
89
90         # libs
91         exeinto "$(games_get_libdir)"/${PN}
92         doexe binaries/system/libCollada.so || die
93         if use editor ; then
94                 doexe binaries/system/libAtlasUI.so || die
95         fi
96
97         # other
98         dodoc binaries/system/readme.txt || die
99         doicon build/resources/${PN}.png || die
100         games_make_wrapper ${PN} "${GAMES_BINDIR}/pyrogenesis"
101         make_desktop_entry ${PN} ${PN} ${PN}
102
103         # permissions
104         prepgamesdirs
105 }