diff --git a/games/CWR-CE/Makefile b/games/CWR-CE/Makefile index 2ef97966212d..b5171862b4dd 100644 --- a/games/CWR-CE/Makefile +++ b/games/CWR-CE/Makefile @@ -1,86 +1,91 @@ PORTNAME= CWR-CE DISTVERSIONPREFIX= v DISTVERSION= 3.01 PORTREVISION= 2 CATEGORIES= games PATCH_SITES= https://github.com/ocochard/CWR-CE/compare/ PATCHFILES= 9abbdf2769f3008d76c47ac0af219388ff0323dc..8fc693b2c6f85929e43975ef04df28818e740dba.patch:-p1 MAINTAINER= olivier@FreeBSD.org COMMENT= Arma: Cold War Assault - Remastered Community Edition WWW= https://github.com/ofpisnotdead-com/CWR-CE +ONLY_FOR_ARCHS= aarch64 amd64 armv7 i386 +ONLY_FOR_ARCHS_REASON= requires SSE intrinsics, light porting work for other architectures + LICENSE= GPLv3+ LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= stb>0:devel/stb \ ${LOCALBASE}/include/CLI/CLI.hpp:devel/cli11 \ ${LOCALBASE}/include/vulkan/vulkan.h:graphics/vulkan-headers \ ${LOCALBASE}/lib/cmake/Catch2/Catch2Config.cmake:devel/catch2 \ ${LOCALBASE}/lib/cmake/glslang/glslang-config.cmake:graphics/glslang LIB_DEPENDS= libcjson.so:devel/libcjson \ libcurl.so:ftp/curl \ libenkiTS.so:devel/enkits \ libfmt.so:devel/libfmt \ libfreetype.so:print/freetype2 \ libimgui.so:x11-toolkits/imgui \ libmimalloc.so:devel/mimalloc \ libogg.so:audio/libogg \ libopenal.so:audio/openal-soft \ libopus.so:audio/opus \ libSDL3.so:devel/sdl3 \ libvulkan.so:graphics/vulkan-loader \ libspdlog.so:devel/spdlog \ libvorbis.so:audio/libvorbis \ libzstd.so:archivers/zstd USES= cmake compiler:c++20-lang dos2unix gl localbase pkgconfig DOS2UNIX_REGEX= .*\.(c|h|cpp|hpp) USE_GITHUB= yes GH_ACCOUNT= ofpisnotdead-com GH_PROJECT= CWR-CE GH_TAGNAME= 9abbdf2769f3008d76c47ac0af219388ff0323dc USE_GL= gl SUB_FILES= pkg-message # Disable vcpkg toolchain wiring — find_package(... CONFIG REQUIRED) picks up # system libraries from ${LOCALBASE}/lib/cmake instead. CMAKE_ARGS= -DVCPKG_MANIFEST_MODE=OFF \ -DCMAKE_DISABLE_FIND_PACKAGE_VCPKG=ON -CMAKE_OFF= POSEIDON_DISABLE_PCH POSEIDON_BUILD_FUZZERS +CMAKE_OFF= POSEIDON_BUILD_FUZZERS +# https://github.com/llvm/llvm-project/issues/69524 +CMAKE_ON= POSEIDON_DISABLE_PCH CXXFLAGS_powerpc64le= -DNO_WARN_X86_INTRINSICS PLIST_FILES= bin/PoseidonGame \ bin/PoseidonGameDemo \ bin/PoseidonServer \ bin/PoseidonStudio \ bin/PoseidonTetris \ bin/PoseidonTools \ bin/cwr-ce \ bin/install-cwr-data do-install: ${INSTALL_PROGRAM} \ ${BUILD_WRKSRC}/apps/cwr/Game/PoseidonGame \ ${BUILD_WRKSRC}/apps/cwr/GameDemo/PoseidonGameDemo \ ${BUILD_WRKSRC}/apps/cwr/Server/PoseidonServer \ ${BUILD_WRKSRC}/apps/tools/Studio/PoseidonStudio \ ${BUILD_WRKSRC}/apps/tetris/Tetris/PoseidonTetris \ ${BUILD_WRKSRC}/apps/tools/Tools/PoseidonTools \ ${STAGEDIR}${PREFIX}/bin ${INSTALL_SCRIPT} ${FILESDIR}/install-cwr-data.sh \ ${STAGEDIR}${PREFIX}/bin/install-cwr-data ${INSTALL_SCRIPT} ${FILESDIR}/cwr-ce.sh \ ${STAGEDIR}${PREFIX}/bin/cwr-ce .include -.if ${ARCH} == aarch64 +.if ${ARCH} == aarch64 || ${ARCH:Marmv?} BUILD_DEPENDS+= ${LOCALBASE}/include/sse2neon.h:devel/sse2neon .endif .include diff --git a/games/CWR-CE/files/patch-engine_Poseidon_Asset_Cache_AssetCache.hpp b/games/CWR-CE/files/patch-engine_Poseidon_Asset_Cache_AssetCache.hpp new file mode 100644 index 000000000000..89d4e94a17cc --- /dev/null +++ b/games/CWR-CE/files/patch-engine_Poseidon_Asset_Cache_AssetCache.hpp @@ -0,0 +1,21 @@ +--- engine/Poseidon/Asset/Cache/AssetCache.hpp.orig 2026-08-04 10:49:53 UTC ++++ engine/Poseidon/Asset/Cache/AssetCache.hpp +@@ -70,15 +70,15 @@ struct StringKeyHash + // FNV-1a over lowercased bytes — case-insensitive hash matching the equality above. + size_t operator()(const StringKey& k) const noexcept + { +- size_t h = 14695981039346656037ULL; ++ uint64_t h = 14695981039346656037ULL; + for (char c : k.value) + { + const unsigned char u = static_cast(c); + const unsigned char lc = (u >= 'A' && u <= 'Z') ? u + 32 : u; +- h ^= static_cast(lc); ++ h ^= static_cast(lc); + h *= 1099511628211ULL; + } +- return h; ++ return static_cast(h); + } + }; + diff --git a/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_Quatrix.hpp b/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_Quatrix.hpp index f8d12f18b07d..69d9f63f7dc2 100644 --- a/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_Quatrix.hpp +++ b/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_Quatrix.hpp @@ -1,17 +1,16 @@ ---- engine/Poseidon/Foundation/Math/Quatrix.hpp.orig +--- engine/Poseidon/Foundation/Math/Quatrix.hpp.orig 2026-08-04 10:46:28 UTC +++ engine/Poseidon/Foundation/Math/Quatrix.hpp -@@ -1,10 +1,14 @@ +@@ -1,9 +1,13 @@ #pragma once - -+#ifdef __aarch64__ + ++#if defined(__aarch64__) || defined(__arm__) +#include +#else #ifdef _MSC_VER #include #else #include - #endif +#endif - + #endif + namespace Poseidon::Foundation - { diff --git a/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_V3QuadsP3.cpp b/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_V3QuadsP3.cpp index 3174dc07d403..de2336fb41bc 100644 --- a/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_V3QuadsP3.cpp +++ b/games/CWR-CE/files/patch-engine_Poseidon_Foundation_Math_V3QuadsP3.cpp @@ -1,18 +1,17 @@ ---- engine/Poseidon/Foundation/Math/V3QuadsP3.cpp.orig +--- engine/Poseidon/Foundation/Math/V3QuadsP3.cpp.orig 2026-08-04 10:46:28 UTC +++ engine/Poseidon/Foundation/Math/V3QuadsP3.cpp -@@ -7,11 +7,15 @@ +@@ -7,10 +7,14 @@ #include #include #include -+#ifdef __aarch64__ ++#if defined(__aarch64__) || defined(__arm__) +#include +#else #ifdef _MSC_VER #include // For MMX intrinsics #else #include - #endif +#endif - + #endif + #if defined __ICL - #define _COMPILER_CAN_PIII 1 diff --git a/games/CWR-CE/files/patch-engine_Poseidon_Graphics_Rendering_ColorsK.hpp b/games/CWR-CE/files/patch-engine_Poseidon_Graphics_Rendering_ColorsK.hpp index 378e6a5abbd3..4adfda08ae38 100644 --- a/games/CWR-CE/files/patch-engine_Poseidon_Graphics_Rendering_ColorsK.hpp +++ b/games/CWR-CE/files/patch-engine_Poseidon_Graphics_Rendering_ColorsK.hpp @@ -1,14 +1,14 @@ ---- engine/Poseidon/Graphics/Rendering/ColorsK.hpp.orig +--- engine/Poseidon/Graphics/Rendering/ColorsK.hpp.orig 2026-08-04 10:46:27 UTC +++ engine/Poseidon/Graphics/Rendering/ColorsK.hpp -@@ -2,7 +2,11 @@ +@@ -2,7 +2,11 @@ int toInt(double f); int toInt(float fval); int toInt(double f); - -+#ifdef __aarch64__ + ++#if defined(__aarch64__) || defined(__arm__) +#include +#else #include +#endif #include #include - + diff --git a/games/CWR-CE/files/patch-engine_Poseidon_UI_OptionsUIApp.cpp b/games/CWR-CE/files/patch-engine_Poseidon_UI_OptionsUIApp.cpp index 56222be713a7..99bd9abac1b8 100644 --- a/games/CWR-CE/files/patch-engine_Poseidon_UI_OptionsUIApp.cpp +++ b/games/CWR-CE/files/patch-engine_Poseidon_UI_OptionsUIApp.cpp @@ -1,11 +1,22 @@ ---- engine/Poseidon/UI/OptionsUIApp.cpp.orig +--- engine/Poseidon/UI/OptionsUIApp.cpp.orig 2026-08-06 09:21:54 UTC +++ engine/Poseidon/UI/OptionsUIApp.cpp -@@ -120,6 +120,8 @@ +@@ -119,8 +119,18 @@ RString GetAppVersion() { #if defined(_M_X64) || defined(__x86_64__) const char* platform = "x64"; +-#else +#elif defined(__aarch64__) + const char* platform = "aarch64"; - #else ++#elif defined(__arm__) ++ const char* platform = "arm"; ++#elif defined(__powerpc64__) ++ const char* platform = "powerpc64"; ++#elif defined(__powerpc__) ++ const char* platform = "powerpc"; ++#elif defined(__i386__) const char* platform = "x86"; ++#else ++ const char* platform = "unknown"; #endif + + RString renderer = GEngine ? GEngine->GetRendererName() : "No renderer";