Removed unused parts of Godot for export

This commit is contained in:
2026-09-16 12:06:47 +02:00
parent 3668d51dd2
commit b6f8fd3504
7 changed files with 231 additions and 57 deletions
+21
View File
@@ -23,6 +23,10 @@ let
# disable SIMD on some CPUs (e.g. Firefox on x86/x64 without SSE4.1) and then
# reject the module with "v128 not enabled", so compile a matching template
# without it and ship that instead.
#
# The template is also stripped down to what this 2D game needs: no 3D, 3D
# physics, navigation, XR or any engine module it never touches. 2D physics is
# kept because `scenes/units/unit.tscn` uses an `Area2D` for unit hover.
webTemplates = stdenv.mkDerivation (finalAttrs: {
pname = "godot-web-nosimd-template";
inherit (godot_4_6) version;
@@ -54,8 +58,25 @@ let
# archive the template) rejects because it predates 1980.
find . -exec touch -h {} +
# Only the modules this game actually uses are compiled in; everything
# else (3D and its importers, compressed/extra image formats, audio
# codecs, ENet/WebRTC/UPnP, regex, SVG rasterisation, texture
# compressors, ...) is left out. `modules_enabled_by_default=no` keeps a
# future upstream module out of the build until it is enabled here.
#
# `force_png` (project.godot) makes the importer store lossless textures
# as PNG, so the WebP module is not needed at runtime.
scons platform=web target=template_release \
wasm_simd=no threads=no dlink_enabled=no \
disable_3d=yes disable_physics_3d=yes \
disable_navigation_2d=yes disable_navigation_3d=yes disable_xr=yes \
modules_enabled_by_default=no \
module_freetype_enabled=yes \
module_gdscript_enabled=yes \
module_multiplayer_enabled=yes \
module_noise_enabled=yes \
module_text_server_adv_enabled=yes \
module_websocket_enabled=yes \
-j$NIX_BUILD_CORES
runHook postBuild