Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-strategy/0ad/
Date: Sat, 28 Aug 2021 03:39:41
Message-Id: 1630119710.0b79a1e7483b8d7b5df57942265bba7ffc76e5ae.sam@gentoo
1 commit: 0b79a1e7483b8d7b5df57942265bba7ffc76e5ae
2 Author: Nils Freydank <holgersson <AT> posteo <DOT> de>
3 AuthorDate: Fri Aug 27 11:25:01 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 28 03:01:50 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b79a1e7
7
8 games-strategy/0ad: Bump to alpha25b and EAPI=8
9
10 Upstream bumped 0ad with some fixes, quoting upstream:
11
12 - Ranked matches did not longer grant points in the lobby.
13 - Mod installation no longer require restart.
14 - Mod installation no longer prints errors when installing mods
15 by double-clicking
16 - Mod installation now overwrites the existing mods to allow
17 for easier updates.
18 - Fishes are now easier to spot on lowest settings with
19 the addition of seagulls.
20
21 For their full announcement see:
22 https://play0ad.com/re-release-of-0-a-d-alpha-25-yauna/
23
24 This bump hops to EAPI=8 as all used eclasses support it now
25 and the bump drops an forgotten comment about the bundled premake5.
26
27 Additionally it adds distfile signature verification using
28 the verify-sig eclass calling app-crypt/minisign manually.
29
30 Package-Manager: Portage-3.0.22, Repoman-3.0.3
31 Signed-off-by: Nils Freydank <holgersson <AT> posteo.de>
32 Signed-off-by: Sam James <sam <AT> gentoo.org>
33
34 games-strategy/0ad/0ad-0.0.25b_alpha.ebuild | 259 ++++++++++++++++++++++++++++
35 games-strategy/0ad/Manifest | 4 +
36 2 files changed, 263 insertions(+)
37
38 diff --git a/games-strategy/0ad/0ad-0.0.25b_alpha.ebuild b/games-strategy/0ad/0ad-0.0.25b_alpha.ebuild
39 new file mode 100644
40 index 00000000000..e7258e9b6f8
41 --- /dev/null
42 +++ b/games-strategy/0ad/0ad-0.0.25b_alpha.ebuild
43 @@ -0,0 +1,259 @@
44 +# Copyright 2014-2021 Gentoo Authors
45 +# Distributed under the terms of the GNU General Public License v2
46 +
47 +EAPI=8
48 +
49 +WX_GTK_VER="3.0-gtk3"
50 +PYTHON_COMPAT=( python3_{7..9} )
51 +inherit desktop toolchain-funcs multiprocessing python-any-r1 verify-sig wxwidgets xdg
52 +
53 +DESCRIPTION="A free, real-time strategy game"
54 +HOMEPAGE="https://play0ad.com/"
55 +LICENSE="BitstreamVera CC-BY-SA-3.0 GPL-2 LGPL-2.1 LPPL-1.3c MIT ZLIB"
56 +# Upstream signs releases (and only them) with app-crypt/minisign.
57 +# The (public) key can be found on https://play0ad.com/download/source.
58 +if [[ ${PV} == *9999 ]]; then
59 + inherit git-r3
60 + EGIT_REPO_URI="https://github.com/0ad/0ad"
61 + S="${WORKDIR}/${P}"
62 +elif [[ ${PV} == *_pre* ]]; then
63 + ZEROAD_GIT_REVISION="c7d07d3979f969b969211a5e5748fa775f6768a7"
64 + SRC_URI="https://github.com/0ad/0ad/archive/${ZEROAD_GIT_REVISION}.tar.gz -> ${P}.tar.gz"
65 + S="${WORKDIR}/${PN}-${ZEROAD_GIT_REVISION}"
66 +else
67 + inherit verify-sig
68 + IUSE+="verify-sig"
69 + MINISIGN_KEY="RWT0hFWv57I2RFoJwLVjxEr44JOq/RkEx1oT0IA3PPPICnSF7HFKW1CT"
70 + MY_P="0ad-${PV/_/-}"
71 + SRC_URI="
72 + http://releases.wildfiregames.com/${MY_P}-unix-build.tar.xz
73 + https://releases.wildfiregames.com/${MY_P}-unix-data.tar.xz
74 + verify-sig? (
75 + http://releases.wildfiregames.com/${MY_P}-unix-build.tar.xz.minisig
76 + http://releases.wildfiregames.com/${MY_P}-unix-data.tar.xz.minisig
77 + )
78 + "
79 + S="${WORKDIR}/${MY_P}"
80 +fi
81 +SLOT="0"
82 +KEYWORDS="~amd64 ~x86"
83 +IUSE="editor +lobby nvtt pch test"
84 +
85 +RESTRICT="test"
86 +CHECKREQS_DISK_BUILD="9000M" # 8769732 KiB (8.3 GiB) for alpha 25
87 +CHECKREQS_DISK_USR="3500M" # 3545972 KiB (3.3 GiB)
88 +
89 +# Premake adds '-s' to some LDFLAGS. Simply sed'ing it out leads to
90 +# build and/or startup issues.
91 +QA_PRESTRIPPED="/usr/lib64/0ad/libCollada.so /usr/bin/0ad"
92 +
93 +# virtual/rust is for bundled SpiderMonkey.
94 +# Build-time Python dependency is for SM, too.
95 +BDEPEND="
96 + ${PYTHON_DEPS}
97 + >=dev-util/premake-5.0.0_alpha12:5
98 + virtual/pkgconfig
99 + virtual/rust
100 + test? ( dev-lang/perl )
101 +"
102 +# Upstream uses minisign which is not supported by verify-sign, bug #783066.
103 +# Signatures are only provided for releases.
104 +if [[ ( ${PV} != *9999 ) && ( ${PV} != *_p* ) ]]; then
105 + BDEPEND+="app-crypt/minisign"
106 +fi
107 +
108 +# Removed dependency on nvtt as we use the bundled one.
109 +# bug #768930
110 +DEPEND="
111 + dev-libs/boost:=
112 + dev-libs/icu:=
113 + dev-libs/libfmt:0=
114 + dev-libs/libsodium
115 + dev-libs/libxml2
116 + media-libs/libpng:0
117 + media-libs/libsdl2[X,opengl,video]
118 + media-libs/libvorbis
119 + media-libs/openal
120 + net-libs/enet:1.3
121 + net-libs/miniupnpc:=
122 + net-misc/curl
123 + sys-libs/zlib
124 + virtual/opengl
125 + x11-libs/libX11
126 + editor? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] )
127 + lobby? ( net-libs/gloox )
128 +"
129 +RDEPEND="
130 + ${DEPEND}
131 + !games-strategy/0ad-data
132 +"
133 +
134 +PATCHES=(
135 + "${FILESDIR}"/${PN}-0.0.24b_alpha-respect-tc.patch
136 +)
137 +
138 +pkg_setup() {
139 + use editor && setup-wxwidgets
140 +}
141 +
142 +src_unpack() {
143 + if [[ ( ${PV} != *9999 ) && ( ${PV} != *_p* ) ]]; then
144 + if use verify-sig; then
145 + elog "Verifying both signatures using app-crypt/minisign."
146 + minisign -V \
147 + -P "${MINISIGN_KEY}" \
148 + -x "${DISTDIR}/${MY_P}-unix-build.tar.xz.minisig" \
149 + -m "${DISTDIR}/${MY_P}-unix-build.tar.xz" \
150 + || die "Failed to verify engine distfile using minisign!"
151 + minisign -V \
152 + -P "${MINISIGN_KEY}" \
153 + -x "${DISTDIR}/${MY_P}-unix-data.tar.xz.minisig" \
154 + -m "${DISTDIR}/${MY_P}-unix-data.tar.xz" \
155 + || die "Failed to verify data distfile using minisign!"
156 + fi
157 + # Unpack manually until an eclass supports minisign and unpacks
158 + # if signatures match.
159 + default
160 + else
161 + # Unpack distfiles without checking as this is no official release.
162 + default
163 + fi
164 +}
165 +
166 +src_prepare() {
167 + default
168 +
169 + # SpiderMonkey's configure no longer recognises --build for
170 + # the build tuple
171 + sed -i -e "/--build/d" libraries/source/spidermonkey/build.sh || die
172 +
173 + # Originally from 0ad-data
174 + rm binaries/data/tools/fontbuilder/fonts/*.txt || die
175 +}
176 +
177 +src_configure() {
178 + # 0AD uses premake:5 to generate the Makefiles, so let's
179 + # 1. configure the configure args,
180 + # 2. export some toolchain args,
181 + # 3. configure premake args,
182 + # 4. run premake5.
183 + local myconf=(
184 + --minimal-flags
185 + $(usex nvtt "" "--without-nvtt")
186 + $(usex pch "" "--without-pch")
187 + $(usex test "" "--without-tests")
188 + $(usex editor "--atlas" "")
189 + $(usex lobby "" "--without-lobby")
190 + --bindir="/usr/bin"
191 + --libdir="/usr/$(get_libdir)"/${PN}
192 + --datadir="/usr/share/${PN}"
193 + )
194 +
195 + tc-export AR CC CXX RANLIB
196 +
197 + local mypremakeargs=(
198 + --outpath="../workspace/gcc"
199 + --os=linux
200 + --verbose
201 + )
202 +
203 + cd "${S}/build/premake" || die "Could not enter premake directory"
204 +
205 + /usr/bin/premake5 "${mypremakeargs[@]}" "${myconf[@]}" gmake2 \
206 + || die "Premake failed"
207 +}
208 +
209 +src_compile() {
210 + # Build 3rd party fcollada
211 + einfo "Building bundled fcollada"
212 + emake -C libraries/source/fcollada/src
213 +
214 + # Build bundled NVTT
215 + # nvtt is abandoned upstream and 0ad has forked it and added fixes.
216 + # Use their copy. bug #768930
217 + if use nvtt ; then
218 + cd libraries/source/nvtt || die
219 + elog "Building bundled NVTT (bug #768930)"
220 + JOBS="-j$(makeopts_jobs)" ./build.sh || die "Failed to build bundled NVTT"
221 + cd "${S}" || die
222 + fi
223 +
224 + # Build bundled SpiderMonkey
225 + # We really can't use the system SpiderMonkey right now.
226 + # Breakages occur even on minor bumps in upstream SM,
227 + # e.g. bug #768840.
228 + cd libraries/source/spidermonkey || die
229 + elog "Building bundled SpiderMonkey (bug #768840)"
230 + XARGS="${EPREFIX}/usr/bin/xargs" \
231 + JOBS="-j$(makeopts_jobs)" \
232 + ./build.sh \
233 + || die "Failed to build bundled SpiderMonkey"
234 +
235 + cd "${S}" || die
236 +
237 + # Build 0ad itself!
238 + elog "Building 0ad"
239 + JOBS="-j$(makeopts_jobs)" emake -C build/workspace/gcc verbose=1
240 +
241 + # Build assets
242 + # (We only do this if we're using a snapshot/non-release)
243 + # See bug #771147 (comment 3) and the old 0ad-data ebuild
244 + # Warning: fragile!
245 + if [[ ${PV} == 9999 || ${PV} == *_pre* ]]; then
246 + # source/lib/sysdep/os/linux/ldbg.cpp:debug_SetThreadName() tries to open /proc/self/task/${TID}/comm for writing.
247 + addpredict /proc/self/task
248 +
249 + # Based on source/tools/dist/build-archives.sh used by source/tools/dist/build.sh.
250 + local archivebuild_input archivebuild_output mod_name
251 + for archivebuild_input in binaries/data/mods/[A-Za-z0-9]*; do
252 + mod_name="${archivebuild_input##*/}"
253 + archivebuild_output="archives/${mod_name}"
254 +
255 + mkdir -p "${archivebuild_output}" || die
256 +
257 + einfo pyrogenesis -archivebuild="${archivebuild_input}" -archivebuild-output="${archivebuild_output}/${mod_name}.zip"
258 + LD_LIBRARY_PATH="binaries/system" binaries/system/pyrogenesis \
259 + -archivebuild="${archivebuild_input}" \
260 + -archivebuild-output="${archivebuild_output}/${mod_name}.zip" \
261 + || die "Failed to build assets"
262 +
263 + if [[ -f "${archivebuild_input}/mod.json" ]]; then
264 + cp "${archivebuild_input}/mod.json" "${archivebuild_output}" || die
265 + fi
266 +
267 + rm -r "${archivebuild_input}" || die
268 + mv "${archivebuild_output}" "${archivebuild_input}" || die
269 + done
270 +
271 + # Based on source/tools/dist/build-unix-win32.sh used by source/tools/dist/build.sh.
272 + rm binaries/data/config/dev.cfg || die
273 + rm -r binaries/data/mods/_test.* || die
274 + fi
275 +}
276 +
277 +src_test() {
278 + cd binaries/system || die
279 + ./test -libdir "${S}/binaries/system" || die "Failed tests"
280 +}
281 +
282 +src_install() {
283 + newbin binaries/system/pyrogenesis 0ad
284 + use editor && newbin binaries/system/ActorEditor 0ad-ActorEditor
285 +
286 + # Merged from 0ad-data
287 + # bug #771147 (comment 3)
288 + insinto /usr/share/${PN}
289 + doins -r binaries/data/{l10n,config,mods,tools}
290 +
291 + # Install bundled SpiderMonkey and nvtt
292 + # bug #771147 (comment 1)
293 + exeinto /usr/$(get_libdir)/${PN}
294 + doexe binaries/system/{libCollada,libmozjs78-ps-release}.so
295 +
296 + use nvtt && doexe binaries/system/{libnvtt,libnvcore,libnvimage,libnvmath}.so
297 + use editor && doexe binaries/system/libAtlasUI.so
298 +
299 + dodoc binaries/system/readme.txt
300 + doicon -s 128 build/resources/${PN}.png
301 + make_desktop_entry ${PN}
302 +}
303
304 diff --git a/games-strategy/0ad/Manifest b/games-strategy/0ad/Manifest
305 index 466a2877ccf..3adb1e76c5e 100644
306 --- a/games-strategy/0ad/Manifest
307 +++ b/games-strategy/0ad/Manifest
308 @@ -2,3 +2,7 @@ DIST 0ad-0.0.24b-alpha-unix-build.tar.xz 75546740 BLAKE2B a724abba6bed4b58067058
309 DIST 0ad-0.0.24b-alpha-unix-data.tar.xz 828553992 BLAKE2B 2081225d88d475ed0899648994a900677bc3280bb2ba6cf92354ece82b90ddcefddb48458fa23e2de97100e58f4db8db408d4b50d0306a8c3efe47d263064bf0 SHA512 d7804d25ddf376028f230a31c6fc1201dfa366b3d5434569a1a7852bb4c400fb14e5c8934c5d6c6295320cf2e62c64be83b1e3c4c27fd116115bfe7d01106726
310 DIST 0ad-0.0.25-alpha-unix-build.tar.xz 75788348 BLAKE2B 49b8b99a8f2fd33d4a3c2c0320375cb372d23b2f2c0f4ba56438bc8d868891c8c8c624049e3165ec84f8b98bcb1e1195b672aa7ee258ff88317af9d4da883576 SHA512 a8edae7d2dd61972b947152edda8d9ca8bafd3d435623a94de2d1297ecad3bfc73d3b30eaff98e89a6bcb0291b49f1e25bae1300fde37c8989156c895cd12730
311 DIST 0ad-0.0.25-alpha-unix-data.tar.xz 1272283892 BLAKE2B 7bc08e52b44129fce6a78914d36bcb0c8bb3312645982054274e230a23edc34f9aa899d7ca8f52f3044b8c7efd0aea4b5d16fcd9d6e20e274538007885cfa1c2 SHA512 92fad341ceb1156a3facea291856ca2f719691bba1cf085de0544f3ae9300f46391efdd1c88bcf1aafd9a9c938b6bef3babbd50c850dc17fb0c9609dbabe37ad
312 +DIST 0ad-0.0.25b-alpha-unix-build.tar.xz 75579956 BLAKE2B 674d69d625137709a186f9273607dc353fc99aea68ef3f2ea5031dbe2f684176910d757c3f03c7fbdac475d30708be448b71f5020d27a65c346bf147223bcb9d SHA512 e8069897b97b381099ab5ec5868d27e96c699105b3307054d1bc7bf9236a537f02625ba9034892d91f3e951b4f95c9ce5fb75ed0a7c14b8a294882482fd9c1b4
313 +DIST 0ad-0.0.25b-alpha-unix-build.tar.xz.minisig 327 BLAKE2B 547a7a1c8a83167fa40976efb2efaf691fc5434eb1be227b481a70d308381b20dcdc90bb4652e190f8e329fb33cc19ebbaab43977329f8971e49436f7f1ce636 SHA512 9d6a235ea50183e1db16f4bf2dc59af9042a52e4e18ccd0c34c481a7e9021f19e2bc370e594aa97911bb7ca33bcc5ebe23a4b206cd74357060371ca06b6010d2
314 +DIST 0ad-0.0.25b-alpha-unix-data.tar.xz 1249684600 BLAKE2B d77546ba9d21b512f106645c07fa92ecc343e0a01d9a70a83f2a2b3ade912e72d095982f7d4c4cd64e18fb71a67a01c419763744dd4cad1e8c081e5f77ec17c9 SHA512 d6bbe484acb7fbd507d303f5c75f8a2ccbaf8fe9dd30ff408b082f170bfd96eb9235db1b710c15656ef465b44fa5597679a694515e0c153a35fe24c0915f29f1
315 +DIST 0ad-0.0.25b-alpha-unix-data.tar.xz.minisig 326 BLAKE2B 41975d4c4369780bd36edef448ab928c91ece0d60ddad04fbccd1da0ed5068b56c86fd57708c6158277c5db9faadc768f5e455d97fe5ae3c30a7522005c374e6 SHA512 ad3ef78b785db9eb37d547a86d2bf274e0b6635118a9c512d013adc45e4a0f071b86f0fb5bf696631596e0713b2de153b0ad245cbba86beb3ea153036178b07e