From 8add6bc3b63651943867e1ed5f5ef6759fadea68 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 8 Dec 2024 20:11:39 +0000 Subject: [PATCH] gzdoom: only build for 64-bit architectures Only LP64/LLP64 builds are officially supported. Please do not attempt to build for other platforms; even if the program succeeds in a MAP01 smoke test, there are e.g. known visual artifacts that lead to a bad user experience. Still allow build on 32-bit platforms in case BROKEN is selected, so users can try if it would work on their system as forum claims a fix had actually been applied long ago. Link: https://forum.zdoom.org/viewtopic.php?f=7&t=75673 Signed-off-by: Daniel Golle --- games/gzdoom/Makefile | 5 +++- ...-musl-fts.patch => 002-fix-musl-fts.patch} | 0 ...set_t.patch => 003-define-cpu_set_t.patch} | 0 ...o-execinfo.patch => 130-no-execinfo.patch} | 0 .../998-fix-vulkan-on-32-bit-platforms | 11 +++++++++ .../patches/999-remove-64bit-assertion.patch | 23 +++++++++++++++++++ 6 files changed, 38 insertions(+), 1 deletion(-) rename games/gzdoom/patches/{0002-fix-musl-fts.patch => 002-fix-musl-fts.patch} (100%) rename games/gzdoom/patches/{0003-define-cpu_set_t.patch => 003-define-cpu_set_t.patch} (100%) rename games/gzdoom/patches/{no-execinfo.patch => 130-no-execinfo.patch} (100%) create mode 100644 games/gzdoom/patches/998-fix-vulkan-on-32-bit-platforms create mode 100644 games/gzdoom/patches/999-remove-64bit-assertion.patch diff --git a/games/gzdoom/Makefile b/games/gzdoom/Makefile index ae05680..5b8160b 100644 --- a/games/gzdoom/Makefile +++ b/games/gzdoom/Makefile @@ -17,6 +17,7 @@ PKG_LICENSE_FILES:=COPYING LICENSE CMAKE_INSTALL:=1 PKG_BUILD_DEPENDS:=gzdoom/host vulkan-loader +PKG_BUILD_FLAGS:=no-mips16 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk @@ -32,12 +33,14 @@ CMAKE_OPTIONS += \ -DVULKAN_USE_XLIB=OFF \ -DVULKAN_USE_WAYLAND=ON +TARGET_LDFLAGS += -latomic + define Package/gzdoom SECTION:=games CATEGORY:=Games TITLE:=GZDoom URL:=https://zdoom.org/ - DEPENDS:=+alsa-lib +glib2 +libbz2 +libstdcpp +libzmusic +libvpx +libsdl2 +USE_MUSL:musl-fts + DEPENDS:=+alsa-lib +glib2 +libatomic +libbz2 +libstdcpp +libzmusic +libvpx +libsdl2 +USE_MUSL:musl-fts @(ARCH_64BIT||BROKEN) endef define Package/gzdoom/description diff --git a/games/gzdoom/patches/0002-fix-musl-fts.patch b/games/gzdoom/patches/002-fix-musl-fts.patch similarity index 100% rename from games/gzdoom/patches/0002-fix-musl-fts.patch rename to games/gzdoom/patches/002-fix-musl-fts.patch diff --git a/games/gzdoom/patches/0003-define-cpu_set_t.patch b/games/gzdoom/patches/003-define-cpu_set_t.patch similarity index 100% rename from games/gzdoom/patches/0003-define-cpu_set_t.patch rename to games/gzdoom/patches/003-define-cpu_set_t.patch diff --git a/games/gzdoom/patches/no-execinfo.patch b/games/gzdoom/patches/130-no-execinfo.patch similarity index 100% rename from games/gzdoom/patches/no-execinfo.patch rename to games/gzdoom/patches/130-no-execinfo.patch diff --git a/games/gzdoom/patches/998-fix-vulkan-on-32-bit-platforms b/games/gzdoom/patches/998-fix-vulkan-on-32-bit-platforms new file mode 100644 index 0000000..80921fd --- /dev/null +++ b/games/gzdoom/patches/998-fix-vulkan-on-32-bit-platforms @@ -0,0 +1,11 @@ +--- a/src/common/platform/posix/sdl/sdlglvideo.cpp ++++ b/src/common/platform/posix/sdl/sdlglvideo.cpp +@@ -400,7 +400,7 @@ DFrameBuffer *SDLVideo::CreateFrameBuffe + builder.RequireExtension(names[i]); + auto instance = builder.Create(); + +- VkSurfaceKHR surfacehandle = nullptr; ++ VkSurfaceKHR surfacehandle = (VkSurfaceKHR)nullptr; + if (!I_CreateVulkanSurface(instance->Instance, &surfacehandle)) + VulkanError("I_CreateVulkanSurface failed"); + diff --git a/games/gzdoom/patches/999-remove-64bit-assertion.patch b/games/gzdoom/patches/999-remove-64bit-assertion.patch new file mode 100644 index 0000000..c1535bf --- /dev/null +++ b/games/gzdoom/patches/999-remove-64bit-assertion.patch @@ -0,0 +1,23 @@ +--- a/src/common/engine/i_interface.cpp ++++ b/src/common/engine/i_interface.cpp +@@ -6,13 +6,13 @@ + #include "gstrings.h" + #include "version.h" + +-static_assert(sizeof(void*) == 8, +- "Only LP64/LLP64 builds are officially supported. " +- "Please do not attempt to build for other platforms; " +- "even if the program succeeds in a MAP01 smoke test, " +- "there are e.g. known visual artifacts " +- " " +- "that lead to a bad user experience."); ++//static_assert(sizeof(void*) == 8, ++// "Only LP64/LLP64 builds are officially supported. " ++// "Please do not attempt to build for other platforms; " ++// "even if the program succeeds in a MAP01 smoke test, " ++// "there are e.g. known visual artifacts " ++// " " ++// "that lead to a bad user experience."); + + // Some global engine variables taken out of the backend code. + FStartupScreen* StartWindow; -- 2.30.2