]> Pileus Git - ~andy/sunrise/blob - games-strategy/0ad/0ad-99999.ebuild
punt old crap
[~andy/sunrise] / games-strategy / 0ad / 0ad-99999.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 subversion 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 ESVN_REPO_URI="http://svn.wildfiregames.com/public/ps/trunk"
17
18 LICENSE="0AD"
19 SLOT="0"
20 KEYWORDS=""
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
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}/trunk
47
48 pkg_setup() {
49         games_pkg_setup
50
51         if ! use pch ; then
52                 eerror "pch useflag is potentially broken"
53                 eerror "see http://trac.wildfiregames.com/ticket/1313"
54         fi
55 }
56
57 src_unpack() {
58         subversion_src_unpack
59 }
60
61 src_configure() {
62         cd build/workspaces || die
63
64         # custom configure script
65         local myconf
66         use fam || myconf="--without-fam"
67         use pch || myconf="${myconf} --without-pch"
68         use test || myconf="${myconf} --without-tests"
69         use audio || myconf="${myconf} --without-audio"
70
71         # don't use bundled sources
72         ./update-workspaces.sh \
73                 --with-system-nvtt \
74                 --with-system-enet \
75                 --with-system-mozjs185 \
76                 $(use_enable editor atlas) \
77                 --bindir="${GAMES_BINDIR}" \
78                 --libdir="$(games_get_libdir)"/${PN} \
79                 --datadir="${GAMES_DATADIR}"/${PN} \
80                 ${myconf} || die
81 }
82
83 src_compile() {
84         emake -C build/workspaces/gcc verbose=1 || die
85 }
86
87 src_test() {
88         cd binaries/system || die
89         ./test || die "test phase failed"
90 }
91
92 src_install() {
93         # data
94         insinto "${GAMES_DATADIR}"/${PN}
95         doins -r binaries/data/* || die
96
97         # bin
98         dogamesbin binaries/system/pyrogenesis || die
99
100         # libs
101         exeinto "$(games_get_libdir)"/${PN}
102         doexe binaries/system/libCollada.so || die
103         if use editor ; then
104                 doexe binaries/system/libAtlasUI.so || die
105         fi
106
107         # other
108         dodoc binaries/system/readme.txt || die
109         doicon build/resources/${PN}.png || die
110         games_make_wrapper ${PN} "${GAMES_BINDIR}/pyrogenesis"
111         make_desktop_entry ${PN} ${PN} ${PN}
112
113         # permissions
114         prepgamesdirs
115 }