1 # Copyright 1999-2019 Gentoo Authors
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
60 "${FILESDIR}"/${PN}-0.0.23b-header_includes_fix.patch
66 --with-system-miniupnpc
68 $(usex nvtt "" "--without-nvtt")
69 $(usex pch "" "--without-pch")
70 $(usex test "" "--without-tests")
71 $(usex editor "--atlas" "")
72 $(usex lobby "" "--without-lobby")
75 --libdir="/usr/$(get_libdir)"/${PN}
76 --datadir="/usr/share/${PN}"
79 # stock premake4 does not work, use the shipped one
80 emake -C "${S}"/build/premake/premake4/build/gmake.unix
82 # regenerate scripts.c so our patch applies
83 cd "${S}"/build/premake/premake4 || die
84 "${S}"/build/premake/premake4/bin/release/premake4 embed || die
86 # rebuild premake again... this is the most stupid build system
87 emake -C "${S}"/build/premake/premake4/build/gmake.unix clean
88 emake -C "${S}"/build/premake/premake4/build/gmake.unix
90 # run premake to create build scripts
91 cd "${S}"/build/premake || die
92 "${S}"/build/premake/premake4/bin/release/premake4 \
93 --file="premake4.lua" \
94 --outpath="../workspaces/gcc/" \
95 --platform=$(usex amd64 "x64" "x32") \
98 gmake || die "Premake failed"
104 # build bundled and patched spidermonkey
105 cd libraries/source/spidermonkey || die
106 JOBS="${MAKEOPTS}" ./build.sh || die
109 # build 3rd party fcollada
110 emake -C libraries/source/fcollada/src
113 emake -C build/workspaces/gcc verbose=1
117 cd binaries/system || die
118 ./test -libdir "${S}/binaries/system" || die "test phase failed"
122 newbin binaries/system/pyrogenesis 0ad
123 use editor && newbin binaries/system/ActorEditor 0ad-ActorEditor
125 insinto /usr/share/${PN}
126 doins -r binaries/data/l10n
128 exeinto /usr/$(get_libdir)/${PN}
129 doexe binaries/system/libCollada.so
130 doexe libraries/source/spidermonkey/lib/*.so
131 use editor && doexe binaries/system/libAtlasUI.so
133 dodoc binaries/system/readme.txt
134 doicon -s 128 build/resources/${PN}.png
135 make_desktop_entry ${PN}
143 gnome2_icon_cache_update
147 gnome2_icon_cache_update