Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-games/godot/
Date: Tue, 30 Aug 2022 21:48:34
Message-Id: 1661896096.88d90946b566fdd539ceecaf978b5b8998dcf67a.ionen@gentoo
1 commit: 88d90946b566fdd539ceecaf978b5b8998dcf67a
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 30 19:45:16 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 30 21:48:16 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88d90946
7
8 dev-games/godot: add 4.0_alpha15, unkeyworded
9
10 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
11
12 dev-games/godot/Manifest | 1 +
13 dev-games/godot/godot-4.0_alpha15.ebuild | 256 +++++++++++++++++++++++++++++++
14 2 files changed, 257 insertions(+)
15
16 diff --git a/dev-games/godot/Manifest b/dev-games/godot/Manifest
17 index 9d7912698ebb..e9361cee93fb 100644
18 --- a/dev-games/godot/Manifest
19 +++ b/dev-games/godot/Manifest
20 @@ -1,2 +1,3 @@
21 DIST godot-3.5-stable.tar.xz 24044340 BLAKE2B 9d77ecdfa6bd90065fff26c2334f13c32bbbc4b26aad111b5aab2563d1e4782457ea6cf2115f1a809e0d8aac3d3ee9a138ad224998068983ad36e54a577d89c3 SHA512 23785e39ccc7e1406c97ee33b5e90f7f397aa907d79d72ed08ea3f4b7e68788030a1bcdd07c9f782a21ee3a84636a2cea47a57dcfc94c24e327fa210ae0515b0
22 DIST godot-4.0-alpha14.tar.xz 30970116 BLAKE2B 213616f3a80f97c09580324bf9296d12b6213a2941b3070353b45e160dc7d7bfd32fcae3fc2b64a91fa7d935c23d97fd02a015bc3501441d67261ee6e45e85e1 SHA512 511cb5d3f48c747232350bee25765c17032b99179fd70877f906bcd1a09449260a928c3df9f84c6f3afb47f564b8f4bf75d0a07d37f5a22dd5f5a96d1b1f4df5
23 +DIST godot-4.0-alpha15.tar.xz 30959600 BLAKE2B 0631519d81147d64a01b543111b8317c436d4070f27cf54801a68a66b8d380e5ce33b85a78f09547ffc1b2573f9ac0c7860712808380849c26a0336c89d1c7f4 SHA512 47c750062e4e8262ee95e5b0337744e86b0092789a62c3847d27ab929281c414e5ca1d666a1f03f0a180203ee0f78f53e311976b52d54ee9f8a7b266afa3beb0
24
25 diff --git a/dev-games/godot/godot-4.0_alpha15.ebuild b/dev-games/godot/godot-4.0_alpha15.ebuild
26 new file mode 100644
27 index 000000000000..02df805c8f56
28 --- /dev/null
29 +++ b/dev-games/godot/godot-4.0_alpha15.ebuild
30 @@ -0,0 +1,256 @@
31 +# Copyright 2022 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +PYTHON_COMPAT=( python3_{8..10} )
37 +inherit bash-completion-r1 desktop python-any-r1 scons-utils toolchain-funcs xdg
38 +
39 +MY_P="${PN}-$(ver_rs 2 -)"
40 +
41 +DESCRIPTION="Multi-platform 2D and 3D game engine with a feature-rich editor"
42 +HOMEPAGE="https://godotengine.org/"
43 +SRC_URI="https://downloads.tuxfamily.org/godotengine/$(ver_rs 2 /)/${MY_P}.tar.xz"
44 +S="${WORKDIR}/${MY_P}"
45 +
46 +LICENSE="
47 + MIT
48 + Apache-2.0 BSD Boost-1.0 CC0-1.0 Unlicense ZLIB
49 + gui? ( CC-BY-4.0 ) tools? ( OFL-1.1 )"
50 +SLOT="4"
51 +#KEYWORDS="~amd64" # leaving 4 unkeyworded until at least first _beta
52 +# Enable roughly same as upstream by default so it works as expected,
53 +# except raycast (tools-only heavy dependency), and deprecated.
54 +IUSE="
55 + +dbus debug deprecated +fontconfig +gui pulseaudio raycast
56 + +runner speech test +theora +tools +udev +upnp +webp"
57 +RESTRICT="!test? ( test ) !tools? ( test ) !webp? ( test )"
58 +
59 +# dlopen: alsa-lib,dbus,fontconfig,pulseaudio,speech-dispatcher,udev
60 +RDEPEND="
61 + app-arch/zstd:=
62 + dev-games/recastnavigation:=
63 + dev-libs/icu:=
64 + dev-libs/libpcre2:=[pcre32]
65 + media-libs/freetype[brotli,harfbuzz]
66 + media-libs/harfbuzz:=[icu]
67 + media-libs/libogg
68 + media-libs/libpng:=
69 + media-libs/libvorbis
70 + <net-libs/mbedtls-3:=
71 + net-libs/wslay
72 + sys-libs/zlib:=
73 + fontconfig? ( media-libs/fontconfig )
74 + gui? (
75 + dev-util/glslang
76 + media-libs/alsa-lib
77 + media-libs/libglvnd[X]
78 + media-libs/vulkan-loader[X]
79 + x11-libs/libX11
80 + x11-libs/libXcursor
81 + x11-libs/libXext
82 + x11-libs/libXi
83 + x11-libs/libXinerama
84 + x11-libs/libXrandr
85 + x11-libs/libXrender
86 + dbus? ( sys-apps/dbus )
87 + pulseaudio? ( media-libs/libpulse )
88 + tools? ( raycast? ( media-libs/embree:3 ) )
89 + udev? ( virtual/udev )
90 + )
91 + speech? ( app-accessibility/speech-dispatcher )
92 + theora? ( media-libs/libtheora )
93 + tools? ( app-misc/ca-certificates )
94 + upnp? ( net-libs/miniupnpc:= )
95 + webp? ( media-libs/libwebp:= )"
96 +DEPEND="
97 + ${RDEPEND}
98 + gui? (
99 + dev-util/vulkan-headers
100 + x11-base/xorg-proto
101 + )
102 + tools? ( test? ( dev-cpp/doctest ) )"
103 +BDEPEND="virtual/pkgconfig"
104 +
105 +PATCHES=(
106 + "${FILESDIR}"/${PN}-4.0-musl.patch
107 + "${FILESDIR}"/${PN}-4.0_alpha14-scons.patch
108 +)
109 +
110 +src_prepare() {
111 + default
112 +
113 + sed -i "1,5s/ godot/&${SLOT}/i" misc/dist/linux/godot.6 || die
114 + sed -i "/id/s/Godot/&${SLOT}/" misc/dist/linux/org.godotengine.Godot.appdata.xml || die
115 + sed -e "s/=godot/&${SLOT}/" -e "/^Name=/s/$/ ${SLOT}/" \
116 + -i misc/dist/linux/org.godotengine.Godot.desktop || die
117 +
118 + sed -i "s|pkg-config |$(tc-getPKG_CONFIG) |" platform/linuxbsd/detect.py || die
119 +
120 + # use of builtin_ switches can be messy (see below), delete to be sure
121 + local unbundle=(
122 + doctest embree freetype glslang graphite harfbuzz icu4c libogg libpng
123 + libtheora libvorbis libwebp mbedtls miniupnpc pcre2 recastnavigation
124 + volk vulkan/include wslay zlib zstd
125 + # certs: unused by generated header, but scons panics if not found
126 + )
127 + rm -r "${unbundle[@]/#/thirdparty/}" || die
128 +
129 + # do symlinks to avoid too much patching with hardcoded header paths
130 + mkdir thirdparty/lib{vorbis,ogg} || die
131 + ln -s "${ESYSROOT}"/usr/include thirdparty/zstd || die
132 + ln -s "${ESYSROOT}"/usr/include/doctest thirdparty/ || die
133 + ln -s "${ESYSROOT}"/usr/include/ogg thirdparty/libogg/ || die
134 + ln -s "${ESYSROOT}"/usr/include/vorbis thirdparty/libvorbis/ || die
135 +}
136 +
137 +src_compile() {
138 + local -x GODOT_VERSION_STATUS=$(ver_cut 3-4) # for dev versions only
139 + local -x BUILD_NAME=gentoo # replaces "custom_build" in version string
140 +
141 + local esconsargs=(
142 + AR="$(tc-getAR)" CC="$(tc-getCC)" CXX="$(tc-getCXX)"
143 +
144 + progress=no
145 + verbose=yes
146 +
147 + deprecated=$(usex deprecated)
148 + #execinfo=$(usex !elibc_glibc) # libexecinfo is not packaged
149 + fontconfig=$(usex fontconfig)
150 + minizip=yes # uses a modified bundled copy
151 + opengl3=$(usex gui)
152 + pulseaudio=$(usex gui $(usex pulseaudio))
153 + speechd=$(usex speech)
154 + udev=$(usex gui $(usex udev))
155 + use_dbus=$(usex gui $(usex dbus))
156 + use_volk=no # unnecessary when linking directly to libvulkan
157 + vulkan=$(usex gui) # hard-required and favored by upstream over gles3
158 + x11=$(usex gui)
159 +
160 + system_certs_path="${EPREFIX}"/etc/ssl/certs/ca-certificates.crt
161 +
162 + # platform/*/detect.py uses builtin_* switches to check if need
163 + # to link with system libraries, but ignores whether the dep is
164 + # actually used, so "enable" deleted builtins on disabled deps
165 + builtin_certs=no
166 + builtin_embree=$(usex !gui yes $(usex !tools yes $(usex !raycast)))
167 + builtin_enet=yes # bundled copy is patched for IPv6+DTLS support
168 + builtin_freetype=no
169 + builtin_glslang=$(usex !gui)
170 + builtin_graphite=no
171 + builtin_harfbuzz=no
172 + builtin_icu=no
173 + builtin_libogg=no
174 + builtin_libpng=no
175 + builtin_libtheora=$(usex !theora)
176 + builtin_libvorbis=no
177 + builtin_libwebp=$(usex !webp)
178 + builtin_mbedtls=no
179 + builtin_miniupnpc=$(usex !upnp)
180 + builtin_msdfgen=yes # not wired for unbundling nor packaged
181 + builtin_pcre2=no
182 + builtin_recast=no
183 + builtin_rvo2=yes # bundled copy has godot-specific changes
184 + builtin_squish=yes # ^ likewise, may not be safe to unbundle
185 + builtin_wslay=no
186 + builtin_xatlas=yes # not wired for unbundling nor packaged
187 + builtin_zlib=no
188 + builtin_zstd=no
189 + # also bundled but lacking a builtin_* switch:
190 + # amd-fsr, basis_universal, cvtt, etcpak, fonts, glad,
191 + # jpeg-compressor, meshoptimizer, minimp3, minizip (patched to
192 + # seek in archives), noise, oidn, openxr, spirv-reflect, thorvg,
193 + # tinyexr, vhacd, vulkan (minus include/) and the misc directory.
194 +
195 + # modules with optional dependencies, "possible" to disable more but
196 + # gets messy and breaks all sorts of features (expected enabled)
197 + module_glslang_enabled=$(usex gui)
198 + module_gridmap_enabled=$(usex deprecated) # fails without deprecated
199 + module_mono_enabled=no # unhandled
200 + # note raycast is disabled on many arches, see raycast/config.py
201 + module_raycast_enabled=$(usex gui $(usex tools $(usex raycast)))
202 + module_theora_enabled=$(usex theora)
203 + module_upnp_enabled=$(usex upnp)
204 + module_webp_enabled=$(usex webp)
205 +
206 + # let *FLAGS handle these, e.g. can pass -flto as-is
207 + debug_symbols=no
208 + optimize=none
209 + use_lto=no
210 + use_static_cpp=no
211 + )
212 +
213 + if use runner && use tools; then
214 + # build alternate faster + ~60% smaller binary for running
215 + # games or servers without game development debug paths
216 + escons extra_suffix=runner target=release tools=no "${esconsargs[@]}"
217 + fi
218 +
219 + esconsargs+=(
220 + # debug: debug for godot itself
221 + # release_debug: debug for game development
222 + # release: no debugging paths, only available with tools=no
223 + target=$(usex debug{,} $(usex tools release_debug release))
224 + tools=$(usex tools)
225 +
226 + # harmless but note this bakes in --test in the final binary
227 + tests=$(usex tools $(usex test))
228 + )
229 +
230 + escons extra_suffix=main "${esconsargs[@]}"
231 +}
232 +
233 +src_test() {
234 + xdg_environment_reset
235 + bin/godot*.main --headless --test || die
236 +}
237 +
238 +src_install() {
239 + local s=godot${SLOT}
240 +
241 + newbin bin/godot*.main ${s}
242 + if use runner && use tools; then
243 + newbin bin/godot*.runner ${s}-runner
244 + else
245 + # always available, revdeps shouldn't depend on [runner]
246 + dosym ${s} /usr/bin/${s}-runner
247 + fi
248 +
249 + newman misc/dist/linux/godot.6 ${s}.6
250 + dodoc AUTHORS.md CHANGELOG.md DONORS.md README.md
251 +
252 + if use gui; then
253 + newicon icon.svg ${s}.svg
254 + newmenu misc/dist/linux/org.godotengine.Godot.desktop \
255 + org.godotengine.${s^}.desktop
256 +
257 + insinto /usr/share/metainfo
258 + newins misc/dist/linux/org.godotengine.Godot.appdata.xml \
259 + org.godotengine.${s^}.appdata.xml
260 +
261 + insinto /usr/share/mime/application
262 + newins misc/dist/linux/org.godotengine.Godot.xml \
263 + org.godotengine.${s^}.xml
264 + fi
265 +
266 + newbashcomp misc/dist/shell/godot.bash-completion ${s}
267 + bashcomp_alias ${s}{,-runner}
268 +
269 + insinto /usr/share/fish/vendor_completions.d
270 + newins misc/dist/shell/godot.fish ${s}.fish
271 + dosym ${s}.fish /usr/share/fish/vendor_completions.d/${s}-runner.fish
272 +
273 + insinto /usr/share/zsh/site-functions
274 + newins misc/dist/shell/_godot.zsh-completion _${s}
275 + dosym _${s} /usr/share/zsh/site-functions/_${s}-runner
276 +}
277 +
278 +pkg_postinst() {
279 + xdg_pkg_postinst
280 +
281 + if [[ ! ${REPLACING_VERSIONS} ]] && has_version ${CATEGORY}/${PN}:3; then
282 + elog
283 + elog "Remember to make backups before opening any Godot <=3.x projects in Godot 4."
284 + elog "Automated migration is only partial, and it would be difficult to revert."
285 + fi
286 +}