diff --git a/srcpkgs/godot-export-templates b/srcpkgs/godot-export-templates new file mode 120000 index 00000000000000..9ac33e8ef4315f --- /dev/null +++ b/srcpkgs/godot-export-templates @@ -0,0 +1 @@ +godot \ No newline at end of file diff --git a/srcpkgs/godot/godot-export-templates.INSTALL.msg b/srcpkgs/godot/godot-export-templates.INSTALL.msg new file mode 100644 index 00000000000000..1157b9126bfe91 --- /dev/null +++ b/srcpkgs/godot/godot-export-templates.INSTALL.msg @@ -0,0 +1,6 @@ +For godot-export-templates to work user should symlink templates. + /usr/lib/godot/extra_templates + to + $HOME/.local/share/godot/export_templates/godot/ + + $ ln -s /usr/lib/godot/export_templates $HOME/.local/share/godot diff --git a/srcpkgs/godot/patches/20-fix-musl.patch b/srcpkgs/godot/patches/20-fix-musl.patch deleted file mode 100644 index 1f14e6e7cc3803..00000000000000 --- a/srcpkgs/godot/patches/20-fix-musl.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/thirdparty/manifold/src/sparse.h b/thirdparty/manifold/src/sparse.h -index a25ea61141..82ba7c5af6 100644 ---- a/thirdparty/manifold/src/sparse.h -+++ b/thirdparty/manifold/src/sparse.h -@@ -40,11 +40,13 @@ class SparseIndices { - // such that the indices are sorted by (p << 32) | q - public: - #if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \ -+ defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ || \ - defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || \ - defined(__AARCH64EB__) || defined(_MIBSEB) || defined(__MIBSEB) || \ - defined(__MIBSEB__) - static constexpr size_t pOffset = 0; - #elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || \ -+ defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || \ - defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) || \ - defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || \ - defined(__MIPSEL) || defined(__MIPSEL__) || defined(__EMSCRIPTEN__) || \ diff --git a/srcpkgs/godot/patches/editor-split-translation-data.patch b/srcpkgs/godot/patches/editor-split-translation-data.patch deleted file mode 100644 index 79dd2b5d006a89..00000000000000 --- a/srcpkgs/godot/patches/editor-split-translation-data.patch +++ /dev/null @@ -1,125 +0,0 @@ -From c93f55533d3d81bdee8f60bf3c0f03141865b909 Mon Sep 17 00:00:00 2001 -From: Haoyu Qiu -Date: Wed, 17 Sep 2025 23:10:51 +0800 -Subject: [PATCH] Editor: Generate translation data in separate cpp files - ---- - editor/SCsub | 41 +++++++++++++-------------------------- - editor/editor_builders.py | 29 +++++++++++++++++---------- - 2 files changed, 33 insertions(+), 37 deletions(-) - -diff --git a/editor/SCsub b/editor/SCsub -index 6e2f1f2a9660..8e7bb70e54ce 100644 ---- a/editor/SCsub -+++ b/editor/SCsub -@@ -56,36 +56,23 @@ if env.editor_build: - # ratio (20% for the editor UI, 10% for the class reference). - # Generated with `make include-list` for each resource. - -- # Editor translations -- env.CommandNoCache( -- "#editor/translations/editor_translations.gen.h", -- Glob("#editor/translations/editor/*"), -- env.Run(editor_builders.make_translations_header), -- ) -- -- # Property translations -- env.CommandNoCache( -- "#editor/translations/property_translations.gen.h", -- Glob("#editor/translations/properties/*"), -- env.Run(editor_builders.make_translations_header), -- ) -- -- # Documentation translations -- env.CommandNoCache( -- "#editor/translations/doc_translations.gen.h", -- Glob("#doc/translations/*"), -- env.Run(editor_builders.make_translations_header), -- ) -- -- # Extractable translations -- env.CommandNoCache( -- "#editor/translations/extractable_translations.gen.h", -- Glob("#editor/translations/extractable/*"), -- env.Run(editor_builders.make_translations_header), -- ) -+ translation_targets = { -+ "#editor/translations/editor_translations.gen.cpp": Glob("#editor/translations/editor/*"), -+ "#editor/translations/property_translations.gen.cpp": Glob("#editor/translations/properties/*"), -+ "#editor/translations/doc_translations.gen.cpp": Glob("#doc/translations/*"), -+ "#editor/translations/extractable_translations.gen.cpp": Glob("#editor/translations/extractable/*"), -+ } -+ for target_cpp, sources in translation_targets.items(): -+ target_h = os.path.splitext(target_cpp)[0] + ".h" -+ env.CommandNoCache( -+ [target_h, target_cpp], -+ sources, -+ env.Run(editor_builders.make_translations), -+ ) - - env.add_source_files(env.editor_sources, "*.cpp") - env.add_source_files(env.editor_sources, gen_exporters) -+ env.add_source_files(env.editor_sources, translation_targets.keys()) - - SConscript("animation/SCsub") - SConscript("asset_library/SCsub") -diff --git a/editor/editor_builders.py b/editor/editor_builders.py -index 7916130472ad..1eaab1018298 100644 ---- a/editor/editor_builders.py -+++ b/editor/editor_builders.py -@@ -68,8 +68,10 @@ def make_doc_header(target, source, env): - """) - - --def make_translations_header(target, source, env): -- category = os.path.basename(str(target[0])).split("_")[0] -+def make_translations(target, source, env): -+ target_h, target_cpp = str(target[0]), str(target[1]) -+ -+ category = os.path.basename(target_h).split("_")[0] - sorted_paths = sorted([src.abspath for src in source], key=lambda path: os.path.splitext(os.path.basename(path))[0]) - - xl_names = [] -@@ -77,7 +79,7 @@ def make_translations_header(target, source, env): - if not msgfmt: - methods.print_warning("msgfmt not found, using .po files instead of .mo") - -- with methods.generated_wrapper(str(target[0])) as file: -+ with methods.generated_wrapper(target_cpp) as file: - for path in sorted_paths: - name = os.path.splitext(os.path.basename(path))[0] - # msgfmt erases non-translated messages, so avoid using it if exporting the POT. -@@ -120,14 +122,9 @@ def make_translations_header(target, source, env): - xl_names.append([name, len(buffer), decomp_size]) - - file.write(f"""\ --struct {category.capitalize()}TranslationList {{ -- const char* lang; -- int comp_size; -- int uncomp_size; -- const unsigned char* data; --}}; -+#include "{target_h}" - --inline constexpr {category.capitalize()}TranslationList _{category}_translations[] = {{ -+const {category.capitalize()}TranslationList _{category}_translations[] = {{ - """) - - for x in xl_names: -@@ -136,4 +133,16 @@ def make_translations_header(target, source, env): - file.write("""\ - { nullptr, 0, 0, nullptr }, - }; -+""") -+ -+ with methods.generated_wrapper(target_h) as file: -+ file.write(f"""\ -+struct {category.capitalize()}TranslationList {{ -+ const char* lang; -+ int comp_size; -+ int uncomp_size; -+ const unsigned char* data; -+}}; -+ -+extern const {category.capitalize()}TranslationList _{category}_translations[]; - """) diff --git a/srcpkgs/godot/patches/fix-glslang.patch b/srcpkgs/godot/patches/fix-glslang.patch deleted file mode 100644 index 0f37d38811d28a..00000000000000 --- a/srcpkgs/godot/patches/fix-glslang.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 4323f8cd47121df428b0394c6ba2a8da1f93a396 Mon Sep 17 00:00:00 2001 -From: Sertonix -Date: Sat, 22 Jun 2024 17:14:11 +0000 -Subject: [PATCH] Fix missing lib with builtin_glslang=false - -The `GetDefaultResource` function is in separate library file. ---- - platform/linuxbsd/detect.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py -index 303a88ab2611..0e24370d8a38 100644 ---- a/platform/linuxbsd/detect.py -+++ b/platform/linuxbsd/detect.py -@@ -480,7 +480,7 @@ def configure(env: "SConsEnvironment"): - env.ParseConfig("pkg-config vulkan --cflags --libs") - if not env["builtin_glslang"]: - # No pkgconfig file so far, hardcode expected lib name. -- env.Append(LIBS=["glslang", "SPIRV"]) -+ env.Append(LIBS=["glslang", "SPIRV", "glslang-default-resource-limits"]) - - if env["opengl3"]: - env.Append(CPPDEFINES=["GLES3_ENABLED"]) diff --git a/srcpkgs/godot/template b/srcpkgs/godot/template index 54a676a2a01625..395950f909c965 100644 --- a/srcpkgs/godot/template +++ b/srcpkgs/godot/template @@ -1,31 +1,28 @@ # Template file for 'godot' pkgname=godot -version=4.5 -revision=2 +version=4.6.2 +revision=1 archs="x86_64* i686* aarch64* armv7* ppc64*" build_style=scons -make_build_args="platform=linuxbsd target=editor progress=no production=yes - lto=auto builtin_brotli=false builtin_enet=false builtin_glslang=false - builtin_freetype=false builtin_graphite=false builtin_harfbuzz=false - builtin_icu4c=false builtin_libogg=false builtin_libpng=false - builtin_libtheora=false builtin_libvorbis=false builtin_libwebp=false - builtin_mbedtls=false builtin_miniupnpc=false builtin_pcre2=false - builtin_zlib=false builtin_zstd=false engine_update_check=false - x11=yes wayland=yes" -hostmakedepends="pkg-config clang wayland-devel" -makedepends="alsa-lib-devel freetype-devel mesa glu-devel libXcursor-devel - libXi-devel libXinerama-devel libXrender-devel libXrandr-devel libX11-devel - libpng-devel libwebp-devel libogg-devel libtheora-devel libvorbis-devel - libenet-devel zlib-devel mbedtls2-devel miniupnpc-devel pcre2-devel - pulseaudio-devel graphite-devel harfbuzz-devel libzstd-devel glslang-devel - speech-dispatcher-devel brotli-devel icu-devel wayland-devel" +make_build_args="engine_update_check=false builtin_brotli=false builtin_enet=false + builtin_freetype=false builtin_glslang=false builtin_graphite=false builtin_harfbuzz=false + builtin_icu4c=false builtin_libogg=false builtin_libpng=false builtin_libtheora=false + builtin_libvorbis=false builtin_libwebp=false builtin_mbedtls=false builtin_miniupnpc=false + builtin_pcre2=false builtin_zlib=false builtin_zstd=false lto=auto platform=linuxbsd + production=yes progress=no wayland=yes x11=yes tests=yes" +hostmakedepends="pkg-config clang gettext wayland-devel" +makedepends="alsa-lib-devel brotli-devel freetype-devel glslang-devel glu-devel graphite-devel + harfbuzz-devel icu-devel libenet-devel libogg-devel libpng-devel libtheora-devel libvorbis-devel + libwebp-devel libX11-devel libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel + libXrender-devel libzstd-devel mbedtls2-devel mesa miniupnpc-devel pcre2-devel pulseaudio-devel + speech-dispatcher-devel wayland-devel zlib-devel" depends="speech-dispatcher" short_desc="Multiplatform 2D and 3D engine" -maintainer="Orphaned " +maintainer="zenobit " license="MIT" homepage="https://www.godotengine.org/" distfiles="https://github.com/godotengine/godot/archive/${version}-stable.tar.gz" -checksum=0b2c942c79f756da5c94990e06678feaa582ae533b5e126f992a29d1ea8a816c +checksum=908b759e7517fec65d687b3d468cd639fd8967d25da1522ef8a2087af638b3fe nocross=https://build.voidlinux.org/builders/armv7l_builder/builds/6342/steps/shell_3/logs/stdio CFLAGS+=" -fPIE -fPIC" @@ -65,11 +62,27 @@ post_patch() { vsed -i misc/dist/linux/org.godotengine.Godot.xml -e 's/name="x/name="application-x/g' } +do_build() { + # Build editor + scons ${makejobs} target=editor ${make_build_args} + + # Build export templates + echo -e "\n\n\nBuilding export templates\n\n\n" + scons ${makejobs} target=template_release ${make_build_args} + echo -e "\n\n\nBuilding export templates DEBUG\n\n\n" + scons ${makejobs} target=template_debug ${make_build_args} +} + +do_check() { + # Run tests using the built editor + scons ${makejobs} target=editor ${make_build_args} tests=yes +} + do_install() { vlicense LICENSE.txt - vinstall misc/dist/linux/org.godotengine.Godot.desktop 644 /usr/share/applications/ - vinstall icon.png 644 /usr/share/pixmaps/ godot.png + vinstall misc/dist/linux/org.godotengine.Godot.desktop 644 usr/share/applications/ + vinstall icon.png 644 usr/share/pixmaps/ godot.png case "$XBPS_TARGET_MACHINE" in x86_64*) vbin bin/godot.linuxbsd.editor.x86_64 godot;; @@ -79,6 +92,42 @@ do_install() { ppc64*) vbin bin/godot.linuxbsd.editor.ppc64 godot;; esac - vinstall misc/dist/linux/org.godotengine.Godot.xml 644 /usr/share/mime/packages/ + vinstall misc/dist/linux/org.godotengine.Godot.xml 644 usr/share/mime/packages/ vman misc/dist/linux/godot.6 + + # Install for export-templates sub-package + local templatesDir="/usr/lib/godot/export_templates/${version}.stable" + vmkdir "${templatesDir}" + + case "$XBPS_TARGET_MACHINE" in + x86_64*) + vinstall bin/godot.linuxbsd.template_release.x86_64 755 "${templatesDir}" linux_release.x86_64 + vinstall bin/godot.linuxbsd.template_debug.x86_64 755 "${templatesDir}" linux_debug.x86_64 + ;; + i686*) + vinstall bin/godot.linuxbsd.template_release.x86_32 755 "${templatesDir}" linux_release.x86_32 + vinstall bin/godot.linuxbsd.template_debug.x86_32 755 "${templatesDir}" linux_debug.x86_32 + ;; + aarch64*) + vinstall bin/godot.linuxbsd.template_release.arm64 755 "${templatesDir}" linux_release.arm64 + vinstall bin/godot.linuxbsd.template_debug.arm64 755 "${templatesDir}" linux_debug.arm64 + ;; + armv7*) + vinstall bin/godot.linuxbsd.template_release.arm32 755 "${templatesDir}" linux_release.arm32 + vinstall bin/godot.linuxbsd.template_debug.arm32 755 "${templatesDir}" linux_debug.arm32 + ;; + ppc64*) + vinstall bin/godot.linuxbsd.template_release.ppc64 755 "${templatesDir}" linux_release.ppc64 + vinstall bin/godot.linuxbsd.template_debug.ppc64 755 "${templatesDir}" linux_debug.ppc64 + ;; + esac +} + +godot-export-templates_package() { + short_desc+=" - export templates" + depends="${sourcepkg}>=${version}_${revision}" + + pkg_install() { + vmove usr/lib/godot/export_templates + } }