1 |
commit: 2b481983064b0d537035e932f9812fbb5faeb202 |
2 |
Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Mar 1 13:59:59 2023 +0000 |
4 |
Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 1 14:22:25 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b481983 |
7 |
|
8 |
dev-games/godot: add 4.0 |
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.ebuild | 230 +++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 231 insertions(+) |
15 |
|
16 |
diff --git a/dev-games/godot/Manifest b/dev-games/godot/Manifest |
17 |
index 63a9f08d4b73..b00c06fc59e3 100644 |
18 |
--- a/dev-games/godot/Manifest |
19 |
+++ b/dev-games/godot/Manifest |
20 |
@@ -1,2 +1,3 @@ |
21 |
DIST godot-3.5.1-stable.tar.xz 24153448 BLAKE2B 9d61276a2d82ef4f4487ec1046b7fa58f2b3626640b2db25c1f98c3f8e2ff40eddcf943fd9ffaaf6814fbafbbe7ef1d3f642d77af953b87731cff570ac3a5473 SHA512 59e5ca88534f542562971efb83b76561705f9ca8761311f01b4453857e7ae046c17cadd0d5ca6f6f56e262b5031294a8b9ad970fa6ffc95e1a6a1e1bae48d55f |
22 |
DIST godot-4.0-rc5.tar.xz 29376936 BLAKE2B bc8de477a4597576165fb1a7f38822aa499dcba696368bb47a0b018bfaedb573d2d822e80e1e4364abfb40a72c7badc2a3ef1d2ce9b9a10a1d7d29811b4f489e SHA512 8001f0d021798e6521855ab41c1fa4db93ea898cac9267305745a822f46a8ef3f58174e3c9d402c5d22b94404e411cb56b69e018d3ea00febb885aad42c5eca7 |
23 |
+DIST godot-4.0-stable.tar.xz 29435592 BLAKE2B 0802631f2995144b63c98c3a6031e7f9df771e7dd9491d38a5fcb3f52581c1f3d6a29cde5a43f9a3a83c9aaeaba9e53b22c22cdb67117f65189d916564db614b SHA512 a1de87425861dfd71bf6c6387008d72a0c80322865ffb4dbb4a87e58244d37d4d45d6f6df8e06ea6c4f979de80b364932891c65cf11c7f80727f33e28460cbd9 |
24 |
|
25 |
diff --git a/dev-games/godot/godot-4.0.ebuild b/dev-games/godot/godot-4.0.ebuild |
26 |
new file mode 100644 |
27 |
index 000000000000..55c23ad5eab7 |
28 |
--- /dev/null |
29 |
+++ b/dev-games/godot/godot-4.0.ebuild |
30 |
@@ -0,0 +1,230 @@ |
31 |
+# Copyright 2022-2023 Gentoo Authors |
32 |
+# Distributed under the terms of the GNU General Public License v2 |
33 |
+ |
34 |
+EAPI=8 |
35 |
+ |
36 |
+PYTHON_COMPAT=( python3_{9..11} ) |
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? ( OFL-1.1 )" |
48 |
+SLOT="4" |
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 |
+ alsa +dbus debug deprecated +fontconfig +gui pulseaudio raycast |
54 |
+ +runner speech test +theora +tools +udev +upnp +vulkan +webp" |
55 |
+# TODO: tests still need more figuring out |
56 |
+RESTRICT="test" |
57 |
+ |
58 |
+# dlopen: libglvnd |
59 |
+RDEPEND=" |
60 |
+ app-arch/zstd:= |
61 |
+ dev-games/recastnavigation:= |
62 |
+ dev-libs/icu:= |
63 |
+ dev-libs/libpcre2:=[pcre32] |
64 |
+ media-libs/freetype[brotli,harfbuzz] |
65 |
+ media-libs/harfbuzz:=[icu] |
66 |
+ media-libs/libogg |
67 |
+ media-libs/libpng:= |
68 |
+ media-libs/libvorbis |
69 |
+ <net-libs/mbedtls-3:= |
70 |
+ net-libs/wslay |
71 |
+ sys-libs/zlib:= |
72 |
+ alsa? ( media-libs/alsa-lib ) |
73 |
+ dbus? ( sys-apps/dbus ) |
74 |
+ fontconfig? ( media-libs/fontconfig ) |
75 |
+ gui? ( |
76 |
+ media-libs/libglvnd |
77 |
+ x11-libs/libX11 |
78 |
+ x11-libs/libXcursor |
79 |
+ x11-libs/libXext |
80 |
+ x11-libs/libXi |
81 |
+ x11-libs/libXinerama |
82 |
+ x11-libs/libXrandr |
83 |
+ x11-libs/libXrender |
84 |
+ x11-libs/libxkbcommon |
85 |
+ tools? ( raycast? ( media-libs/embree:3 ) ) |
86 |
+ vulkan? ( media-libs/vulkan-loader[X] ) |
87 |
+ ) |
88 |
+ pulseaudio? ( media-libs/libpulse ) |
89 |
+ speech? ( app-accessibility/speech-dispatcher ) |
90 |
+ theora? ( media-libs/libtheora ) |
91 |
+ tools? ( app-misc/ca-certificates ) |
92 |
+ udev? ( virtual/udev ) |
93 |
+ upnp? ( net-libs/miniupnpc:= ) |
94 |
+ webp? ( media-libs/libwebp:= )" |
95 |
+DEPEND=" |
96 |
+ ${RDEPEND} |
97 |
+ gui? ( x11-base/xorg-proto ) |
98 |
+ tools? ( test? ( dev-cpp/doctest ) )" |
99 |
+BDEPEND="virtual/pkgconfig" |
100 |
+ |
101 |
+PATCHES=( |
102 |
+ "${FILESDIR}"/${PN}-4.0_beta3-headless-header.patch |
103 |
+ "${FILESDIR}"/${PN}-4.0_rc2-musl.patch |
104 |
+ "${FILESDIR}"/${PN}-4.0_rc2-gcc13.patch |
105 |
+ "${FILESDIR}"/${PN}-4.0_rc3-scons.patch |
106 |
+) |
107 |
+ |
108 |
+src_prepare() { |
109 |
+ default |
110 |
+ |
111 |
+ sed -i "1,5s/ godot/&${SLOT}/i" misc/dist/linux/godot.6 || die |
112 |
+ sed -i "/id/s/Godot/&${SLOT}/" misc/dist/linux/org.godotengine.Godot.appdata.xml || die |
113 |
+ sed -e "s/=godot/&${SLOT}/" -e "/^Name=/s/$/ ${SLOT}/" \ |
114 |
+ -i misc/dist/linux/org.godotengine.Godot.desktop || die |
115 |
+ |
116 |
+ sed -i "s|pkg-config |$(tc-getPKG_CONFIG) |" platform/linuxbsd/detect.py || die |
117 |
+ |
118 |
+ # use of builtin_ switches can be messy (see below), delete to be sure |
119 |
+ local unbundle=( |
120 |
+ doctest embree freetype graphite harfbuzz icu4c libogg |
121 |
+ libpng libtheora libvorbis libwebp linuxbsd_headers mbedtls |
122 |
+ miniupnpc pcre2 recastnavigation volk wslay zlib zstd |
123 |
+ # certs: unused by generated header, but scons panics if not found |
124 |
+ ) |
125 |
+ rm -r "${unbundle[@]/#/thirdparty/}" || die |
126 |
+ |
127 |
+ ln -s "${ESYSROOT}"/usr/include/doctest thirdparty/ || die |
128 |
+} |
129 |
+ |
130 |
+src_compile() { |
131 |
+ local -x BUILD_NAME=gentoo # replaces "custom_build" in version string |
132 |
+ |
133 |
+ local esconsargs=( |
134 |
+ AR="$(tc-getAR)" CC="$(tc-getCC)" CXX="$(tc-getCXX)" |
135 |
+ |
136 |
+ progress=no |
137 |
+ verbose=yes |
138 |
+ |
139 |
+ use_sowrap=no |
140 |
+ |
141 |
+ alsa=$(usex alsa) |
142 |
+ dbus=$(usex dbus) |
143 |
+ deprecated=$(usex deprecated) |
144 |
+ fontconfig=$(usex fontconfig) |
145 |
+ opengl3=$(usex gui) |
146 |
+ pulseaudio=$(usex pulseaudio) |
147 |
+ speechd=$(usex speech) |
148 |
+ udev=$(usex udev) |
149 |
+ use_volk=no # unnecessary when linking directly to libvulkan |
150 |
+ vulkan=$(usex gui $(usex vulkan)) |
151 |
+ x11=$(usex gui) |
152 |
+ |
153 |
+ system_certs_path="${EPREFIX}"/etc/ssl/certs/ca-certificates.crt |
154 |
+ |
155 |
+ # platform/*/detect.py uses builtin_* switches to check if need |
156 |
+ # to link with system libraries, but ignores whether the dep is |
157 |
+ # actually used, so "enable" deleted builtins on disabled deps |
158 |
+ builtin_certs=no |
159 |
+ builtin_embree=$(usex !gui yes $(usex !tools yes $(usex !raycast))) |
160 |
+ builtin_enet=yes # bundled copy is patched for IPv6+DTLS support |
161 |
+ builtin_freetype=no |
162 |
+ builtin_glslang=yes #879111 (for now, may revisit if more stable) |
163 |
+ builtin_graphite=no |
164 |
+ builtin_harfbuzz=no |
165 |
+ builtin_icu4c=no |
166 |
+ builtin_libogg=no |
167 |
+ builtin_libpng=no |
168 |
+ builtin_libtheora=$(usex !theora) |
169 |
+ builtin_libvorbis=no |
170 |
+ builtin_libwebp=$(usex !webp) |
171 |
+ builtin_mbedtls=no |
172 |
+ builtin_miniupnpc=$(usex !upnp) |
173 |
+ builtin_msdfgen=yes # not wired for unbundling nor packaged |
174 |
+ builtin_pcre2=no |
175 |
+ builtin_recastnavigation=no |
176 |
+ builtin_rvo2=yes # bundled copy has godot-specific changes |
177 |
+ builtin_squish=yes # ^ likewise, may not be safe to unbundle |
178 |
+ builtin_wslay=no |
179 |
+ builtin_xatlas=yes # not wired for unbundling nor packaged |
180 |
+ builtin_zlib=no |
181 |
+ builtin_zstd=no |
182 |
+ # (more is bundled in third_party/ but they lack builtin_* switches) |
183 |
+ |
184 |
+ # modules with optional dependencies, "possible" to disable more but |
185 |
+ # gets messy and breaks all sorts of features (expected enabled) |
186 |
+ module_mono_enabled=no # unhandled |
187 |
+ # note raycast is only enabled on amd64+arm64, see raycast/config.py |
188 |
+ module_raycast_enabled=$(usex gui $(usex tools $(usex raycast))) |
189 |
+ module_theora_enabled=$(usex theora) |
190 |
+ module_upnp_enabled=$(usex upnp) |
191 |
+ module_webp_enabled=$(usex webp) |
192 |
+ |
193 |
+ # let *FLAGS handle these, e.g. can pass -flto as-is |
194 |
+ debug_symbols=no |
195 |
+ lto=none |
196 |
+ optimize=custom |
197 |
+ use_static_cpp=no |
198 |
+ ) |
199 |
+ |
200 |
+ if use runner && use tools; then |
201 |
+ # build alternate faster + ~60% smaller binary for running |
202 |
+ # games or servers without game development debug paths |
203 |
+ escons extra_suffix=runner target=template_release "${esconsargs[@]}" |
204 |
+ fi |
205 |
+ |
206 |
+ esconsargs+=( |
207 |
+ target=$(usex tools editor template_$(usex debug{,} release)) |
208 |
+ dev_build=$(usex debug) |
209 |
+ |
210 |
+ # harmless but note this bakes in --test in the final binary |
211 |
+ tests=$(usex tools $(usex test)) |
212 |
+ ) |
213 |
+ |
214 |
+ escons extra_suffix=main "${esconsargs[@]}" |
215 |
+} |
216 |
+ |
217 |
+src_test() { |
218 |
+ xdg_environment_reset |
219 |
+ bin/godot*.main --headless --test || die |
220 |
+} |
221 |
+ |
222 |
+src_install() { |
223 |
+ local s=godot${SLOT} |
224 |
+ |
225 |
+ newbin bin/godot*.main ${s} |
226 |
+ if use runner && use tools; then |
227 |
+ newbin bin/godot*.runner ${s}-runner |
228 |
+ else |
229 |
+ # always available, revdeps shouldn't depend on [runner] |
230 |
+ dosym ${s} /usr/bin/${s}-runner |
231 |
+ fi |
232 |
+ |
233 |
+ newman misc/dist/linux/godot.6 ${s}.6 |
234 |
+ dodoc AUTHORS.md CHANGELOG.md DONORS.md README.md |
235 |
+ |
236 |
+ if use gui; then |
237 |
+ newicon icon.svg ${s}.svg |
238 |
+ newmenu misc/dist/linux/org.godotengine.Godot.desktop \ |
239 |
+ org.godotengine.${s^}.desktop |
240 |
+ |
241 |
+ insinto /usr/share/metainfo |
242 |
+ newins misc/dist/linux/org.godotengine.Godot.appdata.xml \ |
243 |
+ org.godotengine.${s^}.appdata.xml |
244 |
+ |
245 |
+ insinto /usr/share/mime/application |
246 |
+ newins misc/dist/linux/org.godotengine.Godot.xml \ |
247 |
+ org.godotengine.${s^}.xml |
248 |
+ fi |
249 |
+ |
250 |
+ newbashcomp misc/dist/shell/godot.bash-completion ${s} |
251 |
+ bashcomp_alias ${s}{,-runner} |
252 |
+ |
253 |
+ insinto /usr/share/fish/vendor_completions.d |
254 |
+ newins misc/dist/shell/godot.fish ${s}.fish |
255 |
+ dosym ${s}.fish /usr/share/fish/vendor_completions.d/${s}-runner.fish |
256 |
+ |
257 |
+ insinto /usr/share/zsh/site-functions |
258 |
+ newins misc/dist/shell/_godot.zsh-completion _${s} |
259 |
+ dosym _${s} /usr/share/zsh/site-functions/_${s}-runner |
260 |
+} |