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