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, 28 Sep 2022 13:53:17
Message-Id: 1664372983.72f36fac887a709689cc341d09164def720751f6.ionen@gentoo
1 commit: 72f36fac887a709689cc341d09164def720751f6
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 28 12:50:59 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 28 13:49:43 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72f36fac
7
8 dev-games/godot: add 3.5.1
9
10 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
11
12 dev-games/godot/Manifest | 1 +
13 dev-games/godot/godot-3.5.1.ebuild | 218 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 219 insertions(+)
15
16 diff --git a/dev-games/godot/Manifest b/dev-games/godot/Manifest
17 index d71893f50aeb..9e96f4de45d0 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-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
25 diff --git a/dev-games/godot/godot-3.5.1.ebuild b/dev-games/godot/godot-3.5.1.ebuild
26 new file mode 100644
27 index 000000000000..3d18204a94a1
28 --- /dev/null
29 +++ b/dev-games/godot/godot-3.5.1.ebuild
30 @@ -0,0 +1,218 @@
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 +DESCRIPTION="Multi-platform 2D and 3D game engine with a feature-rich editor"
40 +HOMEPAGE="https://godotengine.org/"
41 +SRC_URI="https://downloads.tuxfamily.org/godotengine/${PV}/${P}-stable.tar.xz"
42 +S="${WORKDIR}/${P}-stable"
43 +
44 +LICENSE="
45 + MIT
46 + Apache-2.0 BSD Boost-1.0 CC0-1.0 Unlicense ZLIB
47 + gui? ( CC-BY-4.0 ) tools? ( BitstreamVera OFL-1.1 )"
48 +SLOT="3"
49 +KEYWORDS="~amd64"
50 +# Enable roughly same as upstream by default so it works as expected,
51 +# except raycast (tools-only heavy dependency), and deprecated.
52 +IUSE="
53 + +bullet debug deprecated +gui pulseaudio raycast +runner +theora
54 + +tools +udev +upnp +webm +webp"
55 +
56 +# dlopen: alsa-lib,pulseaudio,udev
57 +RDEPEND="
58 + app-arch/zstd:=
59 + dev-games/recastnavigation:=
60 + dev-libs/libpcre2:=[pcre32]
61 + media-libs/freetype[brotli]
62 + media-libs/libpng:=
63 + <net-libs/mbedtls-3:=
64 + net-libs/wslay
65 + sys-libs/zlib:=
66 + bullet? ( sci-physics/bullet:= )
67 + gui? (
68 + media-libs/alsa-lib
69 + media-libs/libglvnd[X]
70 + x11-libs/libX11
71 + x11-libs/libXcursor
72 + x11-libs/libXext
73 + x11-libs/libXi
74 + x11-libs/libXinerama
75 + x11-libs/libXrandr
76 + x11-libs/libXrender
77 + pulseaudio? ( media-libs/libpulse )
78 + tools? ( raycast? ( media-libs/embree:3 ) )
79 + udev? ( virtual/udev )
80 + )
81 + theora? (
82 + media-libs/libogg
83 + media-libs/libtheora
84 + media-libs/libvorbis
85 + )
86 + tools? ( app-misc/ca-certificates )
87 + upnp? ( net-libs/miniupnpc:= )
88 + webm? (
89 + media-libs/libvorbis
90 + media-libs/libvpx:=
91 + media-libs/opus
92 + )
93 + webp? ( media-libs/libwebp:= )"
94 +DEPEND="
95 + ${RDEPEND}
96 + gui? ( x11-base/xorg-proto )"
97 +BDEPEND="virtual/pkgconfig"
98 +
99 +PATCHES=(
100 + "${FILESDIR}"/${PN}-3.5-musl.patch
101 + "${FILESDIR}"/${PN}-3.5-scons.patch
102 +)
103 +
104 +src_prepare() {
105 + default
106 +
107 + sed -i "1,5s/ godot/&${SLOT}/i" misc/dist/linux/godot.6 || die
108 + sed -i "/id/s/Godot/&${SLOT}/" misc/dist/linux/org.godotengine.Godot.appdata.xml || die
109 + sed -e "s/=godot/&${SLOT}/" -e "/^Name=/s/$/ ${SLOT}/" \
110 + -i misc/dist/linux/org.godotengine.Godot.desktop || die
111 +
112 + sed -i "s|pkg-config |$(tc-getPKG_CONFIG) |" platform/{x11,server}/detect.py || die
113 +
114 + # use of builtin_ switches can be messy (see below), delete to be sure
115 + local unbundle=(
116 + bullet embree freetype libogg libpng libtheora libvorbis libvpx
117 + libwebp mbedtls miniupnpc opus pcre2 recastnavigation wslay zlib zstd
118 + # certs: unused by generated header, but scons panics if not found
119 + )
120 + rm -r "${unbundle[@]/#/thirdparty/}" || die
121 +}
122 +
123 +src_compile() {
124 + local -x BUILD_NAME=gentoo # replaces "custom_build" in version string
125 +
126 + local esconsargs=(
127 + AR="$(tc-getAR)" CC="$(tc-getCC)" CXX="$(tc-getCXX)"
128 +
129 + platform=$(usex gui x11 server)
130 + progress=no
131 + verbose=yes
132 +
133 + deprecated=$(usex deprecated)
134 + #execinfo=$(usex !elibc_glibc) # libexecinfo is not packaged
135 + minizip=yes # uses a modified bundled copy
136 + pulseaudio=$(usex gui $(usex pulseaudio))
137 + udev=$(usex gui $(usex udev))
138 +
139 + system_certs_path="${EPREFIX}"/etc/ssl/certs/ca-certificates.crt
140 +
141 + # platform/*/detect.py uses builtin_* switches to check if need
142 + # to link with system libraries, but ignores whether the dep is
143 + # actually used, so "enable" deleted builtins on disabled deps
144 + builtin_bullet=$(usex !bullet)
145 + builtin_certs=no
146 + builtin_embree=$(usex !gui yes $(usex !tools yes $(usex !raycast)))
147 + builtin_enet=yes # bundled copy is patched for IPv6+DTLS support
148 + builtin_freetype=no
149 + builtin_libogg=yes # unused
150 + builtin_libpng=no
151 + builtin_libtheora=$(usex !theora)
152 + builtin_libvorbis=$(usex !theora $(usex !webm))
153 + builtin_libvpx=$(usex !webm)
154 + builtin_libwebp=$(usex !webp)
155 + builtin_mbedtls=no
156 + builtin_miniupnpc=$(usex !upnp)
157 + builtin_opus=$(usex !webm)
158 + builtin_pcre2=no
159 + builtin_recast=no
160 + builtin_rvo2=yes # bundled copy has godot-specific changes
161 + builtin_squish=yes # ^ likewise, may not be safe to unbundle
162 + builtin_wslay=no
163 + builtin_xatlas=yes # not wired for unbundling nor packaged
164 + builtin_zlib=no
165 + builtin_zstd=no
166 + # also bundled but lacking a builtin_* switch:
167 + # cvtt, etc2comp, fonts, glad, jpeg-compressor, libsimplewebm,
168 + # minimp3, minizip (patched to seek in archives), nanosvg, oidn,
169 + # pvrtccompressor, stb_rect_pack, tinyexr, vhacd, and the misc
170 + # directory.
171 +
172 + # modules with optional dependencies, "possible" to disable more but
173 + # gets messy and breaks all sorts of features (expected enabled)
174 + module_bullet_enabled=$(usex bullet)
175 + module_mono_enabled=no # unhandled
176 + module_ogg_enabled=no # unused
177 + module_opus_enabled=no # unused, support is gone and webm uses system's
178 + # note raycast is disabled on many arches, see raycast/config.py
179 + module_raycast_enabled=$(usex gui $(usex tools $(usex raycast)))
180 + module_theora_enabled=$(usex theora)
181 + module_upnp_enabled=$(usex upnp)
182 + module_vorbis_enabled=no # unused, non-theora/webm uses stb_vorbis
183 + module_webm_enabled=$(usex webm)
184 + module_webp_enabled=$(usex webp)
185 +
186 + # let *FLAGS handle these, e.g. can pass -flto as-is
187 + debug_symbols=no
188 + optimize=none
189 + use_lto=no
190 + use_static_cpp=no
191 + )
192 +
193 + if use runner && use tools; then
194 + # build alternate faster + ~60% smaller binary for running
195 + # games or servers without game development debug paths
196 + escons extra_suffix=runner target=release tools=no "${esconsargs[@]}"
197 + fi
198 +
199 + esconsargs+=(
200 + # debug: debug for godot itself
201 + # release_debug: debug for game development
202 + # release: no debugging paths, only available with tools=no
203 + target=$(usex debug{,} $(usex tools release_debug release))
204 + tools=$(usex tools)
205 + )
206 +
207 + escons extra_suffix=main "${esconsargs[@]}"
208 +}
209 +
210 +src_install() {
211 + local s=godot${SLOT}
212 +
213 + newbin bin/godot*.main ${s}
214 + if use runner && use tools; then
215 + newbin bin/godot*.runner ${s}-runner
216 + else
217 + # always available, revdeps shouldn't depend on [runner]
218 + dosym ${s} /usr/bin/${s}-runner
219 + fi
220 +
221 + newman misc/dist/linux/godot.6 ${s}.6
222 + dodoc AUTHORS.md CHANGELOG.md DONORS.md README.md
223 +
224 + if use gui; then
225 + newicon icon.svg ${s}.svg
226 + newmenu misc/dist/linux/org.godotengine.Godot.desktop \
227 + org.godotengine.${s^}.desktop
228 +
229 + insinto /usr/share/metainfo
230 + newins misc/dist/linux/org.godotengine.Godot.appdata.xml \
231 + org.godotengine.${s^}.appdata.xml
232 +
233 + insinto /usr/share/mime/application
234 + newins misc/dist/linux/org.godotengine.Godot.xml \
235 + org.godotengine.${s^}.xml
236 + fi
237 +
238 + newbashcomp misc/dist/shell/godot.bash-completion ${s}
239 + bashcomp_alias ${s}{,-runner}
240 +
241 + insinto /usr/share/fish/vendor_completions.d
242 + newins misc/dist/shell/godot.fish ${s}.fish
243 + dosym ${s}.fish /usr/share/fish/vendor_completions.d/${s}-runner.fish
244 +
245 + insinto /usr/share/zsh/site-functions
246 + newins misc/dist/shell/_godot.zsh-completion _${s}
247 + dosym _${s} /usr/share/zsh/site-functions/_${s}-runner
248 +}