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: Wed, 07 Sep 2022 21:47:50
Message-Id: 1662587228.1081732659343aa696d36a7d2e4d0fd54d077d41.ionen@gentoo
1 commit: 1081732659343aa696d36a7d2e4d0fd54d077d41
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 7 20:20:35 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 7 21:47:08 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10817326
7
8 dev-games/godot: add 4.0_alpha16
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_alpha16.ebuild | 256 +++++++++++++++++++++++++++++++
14 2 files changed, 257 insertions(+)
15
16 diff --git a/dev-games/godot/Manifest b/dev-games/godot/Manifest
17 index e9361cee93fb..fec47a038c9a 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-4.0-alpha14.tar.xz 30970116 BLAKE2B 213616f3a80f97c09580324bf9296d12b6213a2941b3070353b45e160dc7d7bfd32fcae3fc2b64a91fa7d935c23d97fd02a015bc3501441d67261ee6e45e85e1 SHA512 511cb5d3f48c747232350bee25765c17032b99179fd70877f906bcd1a09449260a928c3df9f84c6f3afb47f564b8f4bf75d0a07d37f5a22dd5f5a96d1b1f4df5
23 DIST godot-4.0-alpha15.tar.xz 30959600 BLAKE2B 0631519d81147d64a01b543111b8317c436d4070f27cf54801a68a66b8d380e5ce33b85a78f09547ffc1b2573f9ac0c7860712808380849c26a0336c89d1c7f4 SHA512 47c750062e4e8262ee95e5b0337744e86b0092789a62c3847d27ab929281c414e5ca1d666a1f03f0a180203ee0f78f53e311976b52d54ee9f8a7b266afa3beb0
24 +DIST godot-4.0-alpha16.tar.xz 31012408 BLAKE2B 6492953945e3f2f77da5dcf042d791dd2dc903e65b787704c8053d1ac61852dd3c1d8f8aa0a383f1c86495c863d1f15f6d5e77e6ecadda7ff87ae7c87bdce810 SHA512 56e87c7a02abf9dee15e89be829046b9335a7c01b7bd3bb38d71b3fe1f262f6e923741c47c2d96b2633b9a16f71882ec87aaf06bad42d4bdf7a429ff2db0b4b1
25
26 diff --git a/dev-games/godot/godot-4.0_alpha16.ebuild b/dev-games/godot/godot-4.0_alpha16.ebuild
27 new file mode 100644
28 index 000000000000..02df805c8f56
29 --- /dev/null
30 +++ b/dev-games/godot/godot-4.0_alpha16.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" # leaving 4 unkeyworded until at least first _beta
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 disabled on many arches, 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 + optimize=none
210 + use_lto=no
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 +}