1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 PYTHON_COMPAT=( python2_7 )
9 PYTHON_REQ_USE="threads,ssl"
11 inherit eutils wxwidgets toolchain-funcs gnome2-utils python-any-r1
14 DESCRIPTION="A free, real-time strategy game"
15 HOMEPAGE="https://play0ad.com/"
16 SRC_URI="http://releases.wildfiregames.com/${MY_P}-unix-build.tar.xz"
18 LICENSE="GPL-2 LGPL-2.1 MIT CC-BY-SA-3.0 ZLIB"
20 KEYWORDS="~amd64 ~x86"
21 IUSE="editor +lobby nvtt pch test"
30 ~games-strategy/0ad-data-${PV}
32 media-libs/libsdl2[X,opengl,video]
43 editor? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] )
44 lobby? ( >=net-libs/gloox-1.0.20 )
45 nvtt? ( media-gfx/nvidia-texture-tools )"
49 test? ( dev-lang/perl )"
51 S="${WORKDIR}/${MY_P}"
54 python-any-r1_pkg_setup
55 use editor && setup-wxwidgets
59 "${FILESDIR}"/${PN}-0.0.21_alpha-gentoo.patch
65 --with-system-miniupnpc
67 $(usex nvtt "" "--without-nvtt")
68 $(usex pch "" "--without-pch")
69 $(usex test "" "--without-tests")
70 $(usex editor "--atlas" "")
71 $(usex lobby "" "--without-lobby")
74 --libdir="/usr/$(get_libdir)"/${PN}
75 --datadir="/usr/share/${PN}"
78 # stock premake4 does not work, use the shipped one
79 emake -C "${S}"/build/premake/premake4/build/gmake.unix
81 # regenerate scripts.c so our patch applies
82 cd "${S}"/build/premake/premake4 || die
83 "${S}"/build/premake/premake4/bin/release/premake4 embed || die
85 # rebuild premake again... this is the most stupid build system
86 emake -C "${S}"/build/premake/premake4/build/gmake.unix clean
87 emake -C "${S}"/build/premake/premake4/build/gmake.unix
89 # run premake to create build scripts
90 cd "${S}"/build/premake || die
91 "${S}"/build/premake/premake4/bin/release/premake4 \
92 --file="premake4.lua" \
93 --outpath="../workspaces/gcc/" \
94 --platform=$(usex amd64 "x64" "x32") \
97 gmake || die "Premake failed"
103 # build bundled and patched spidermonkey
104 cd libraries/source/spidermonkey || die
105 JOBS="${MAKEOPTS}" ./build.sh || die
108 # build 3rd party fcollada
109 emake -C libraries/source/fcollada/src
112 emake -C build/workspaces/gcc verbose=1
116 cd binaries/system || die
117 ./test -libdir "${S}/binaries/system" || die "test phase failed"
121 newbin binaries/system/pyrogenesis 0ad
122 use editor && newbin binaries/system/ActorEditor 0ad-ActorEditor
124 insinto /usr/share/${PN}
125 doins -r binaries/data/l10n
127 exeinto /usr/$(get_libdir)/${PN}
128 doexe binaries/system/libCollada.so
129 doexe libraries/source/spidermonkey/lib/*.so
130 use editor && doexe binaries/system/libAtlasUI.so
132 dodoc binaries/system/readme.txt
133 doicon -s 128 build/resources/${PN}.png
134 make_desktop_entry ${PN}
142 gnome2_icon_cache_update
146 gnome2_icon_cache_update