1 | # Copyright 1999-2012 Gentoo Foundation
|
---|
2 | # Distributed under the terms of the GNU General Public License v2
|
---|
3 | # $Header: $
|
---|
4 |
|
---|
5 | EAPI=5
|
---|
6 |
|
---|
7 | WX_GTK_VER="2.8"
|
---|
8 |
|
---|
9 | inherit eutils wxwidgets toolchain-funcs games
|
---|
10 |
|
---|
11 | MY_P=0ad-0.0.12-alpha
|
---|
12 | DESCRIPTION="A free, real-time strategy game"
|
---|
13 | HOMEPAGE="http://play0ad.com/"
|
---|
14 | SRC_URI="http://releases.wildfiregames.com/${MY_P}-unix-build.tar.xz"
|
---|
15 |
|
---|
16 | LICENSE="GPL-2 LGPL-2.1 MIT CCPL-Attribution-ShareAlike-3.0 as-is"
|
---|
17 | SLOT="0"
|
---|
18 | KEYWORDS="~amd64 ~x86 -*"
|
---|
19 | IUSE="+audio editor fam pch test"
|
---|
20 |
|
---|
21 | RDEPEND="
|
---|
22 | ~dev-lang/spidermonkey-1.8.5
|
---|
23 | dev-libs/boost
|
---|
24 | dev-libs/libxml2
|
---|
25 | ~games-strategy/0ad-data-${PV}
|
---|
26 | media-gfx/nvidia-texture-tools
|
---|
27 | media-libs/libpng:0
|
---|
28 | media-libs/libsdl[X,opengl,video]
|
---|
29 | net-libs/enet:1.3
|
---|
30 | net-misc/curl
|
---|
31 | sys-libs/zlib
|
---|
32 | virtual/jpeg
|
---|
33 | virtual/opengl
|
---|
34 | x11-libs/libX11
|
---|
35 | audio? ( media-libs/libogg
|
---|
36 | media-libs/libvorbis
|
---|
37 | media-libs/openal )
|
---|
38 | editor? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] )"
|
---|
39 | DEPEND="${RDEPEND}
|
---|
40 | virtual/pkgconfig
|
---|
41 | test? ( dev-lang/perl )"
|
---|
42 |
|
---|
43 | S=${WORKDIR}/${MY_P}
|
---|
44 |
|
---|
45 | src_prepare() {
|
---|
46 | epatch "${FILESDIR}"/${P}-gentoo.patch \
|
---|
47 | "${FILESDIR}"/${P}-clang.patch
|
---|
48 | }
|
---|
49 |
|
---|
50 | src_configure() {
|
---|
51 | local myconf=(
|
---|
52 | --with-system-nvtt
|
---|
53 | --with-system-enet
|
---|
54 | --with-system-mozjs185
|
---|
55 | --minimal-flags
|
---|
56 | $(usex pch "" "--without-pch")
|
---|
57 | $(usex test "" "--without-tests")
|
---|
58 | $(usex audio "" "--without-audio")
|
---|
59 | $(usex editor "--atlas" "")
|
---|
60 | --collada
|
---|
61 | --bindir="${GAMES_BINDIR}"
|
---|
62 | --libdir="$(games_get_libdir)"/${PN}
|
---|
63 | --datadir="${GAMES_DATADIR}"/${PN}
|
---|
64 | )
|
---|
65 |
|
---|
66 | # stock premake4 does not work, use the shipped one
|
---|
67 | emake -C "${S}"/build/premake/premake4/build/gmake.unix
|
---|
68 |
|
---|
69 | # regenerate scripts.c so our patch applies
|
---|
70 | cd "${S}"/build/premake/premake4 || die
|
---|
71 | "${S}"/build/premake/premake4/bin/release/premake4 embed || die
|
---|
72 |
|
---|
73 | # rebuild premake again... this is the most stupid build system
|
---|
74 | emake -C "${S}"/build/premake/premake4/build/gmake.unix clean
|
---|
75 | emake -C "${S}"/build/premake/premake4/build/gmake.unix
|
---|
76 |
|
---|
77 | # run premake to create build scripts
|
---|
78 | cd "${S}"/build/premake || die
|
---|
79 | "${S}"/build/premake/premake4/bin/release/premake4 \
|
---|
80 | --file="premake4.lua" \
|
---|
81 | --outpath="../workspaces/gcc/" \
|
---|
82 | --platform=$(usex amd64 "x64" "x32") \
|
---|
83 | --os=linux \
|
---|
84 | "${myconf[@]}" \
|
---|
85 | gmake || die "Premake failed"
|
---|
86 | }
|
---|
87 |
|
---|
88 | src_compile() {
|
---|
89 | # build 3rd party fcollada
|
---|
90 | emake -C libraries/fcollada/src
|
---|
91 |
|
---|
92 | # build 0ad
|
---|
93 | emake -C build/workspaces/gcc verbose=1
|
---|
94 | }
|
---|
95 |
|
---|
96 | src_test() {
|
---|
97 | cd binaries/system || die
|
---|
98 | ./test -libdir "${S}/binaries/system" || die "test phase failed"
|
---|
99 | }
|
---|
100 |
|
---|
101 | src_install() {
|
---|
102 | dogamesbin binaries/system/pyrogenesis
|
---|
103 |
|
---|
104 | exeinto "$(games_get_libdir)"/${PN}
|
---|
105 | doexe binaries/system/libCollada.so
|
---|
106 | use editor && doexe binaries/system/libAtlasUI.so
|
---|
107 |
|
---|
108 | dodoc binaries/system/readme.txt
|
---|
109 | doicon build/resources/${PN}.png
|
---|
110 | games_make_wrapper ${PN} "${GAMES_BINDIR}/pyrogenesis"
|
---|
111 | make_desktop_entry ${PN}
|
---|
112 |
|
---|
113 | prepgamesdirs
|
---|
114 | }
|
---|