diff --git a/games/0ad/Makefile b/games/0ad/Makefile index 4b1bfa490746..9dea4a8f3233 100644 --- a/games/0ad/Makefile +++ b/games/0ad/Makefile @@ -1,91 +1,91 @@ PORTNAME= 0ad DISTVERSION= 0.27.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= games MASTER_SITES= https://releases.wildfiregames.com/ DISTFILES= ${PORTNAME}-${DISTVERSION}-unix-build.tar.xz \ ${PORTNAME}-${DISTVERSION}-unix-data.tar.xz MAINTAINER= madpilot@FreeBSD.org COMMENT= Real-time strategy (RTS) game of ancient warfare WWW= https://play0ad.com/ BROKEN_aarch64= fails to compile: no member named verifyHeapAccessDisassembly BROKEN_armv6= fails to link: fatal error: conftest: Unknown error: -1 BROKEN_armv7= fails to link: fatal error: conftest: Unknown error: -1 BROKEN_powerpc64= fails to compile: _psutil_bsd.c: error: 'struct xtcpcb' has no member named 'xt_tp' BUILD_DEPENDS= ${RUST_DEFAULT}>=1.35:lang/${RUST_DEFAULT} \ zip:archivers/zip \ cmake:devel/cmake-core LIB_DEPENDS= libboost_filesystem.so:devel/boost-libs \ libicui18n.so:devel/icu \ libpng16.so:graphics/png \ libvorbisfile.so:audio/libvorbis \ libcurl.so:ftp/curl \ libfreetype.so:print/freetype2 \ libgloox.so:net-im/gloox \ libminiupnpc.so:net/miniupnpc \ libenet.so:net/enet \ libsodium.so:security/libsodium \ libfmt.so:devel/libfmt \ libmozjs-115.so:lang/spidermonkey115 USES= compiler:c++11-lib desktop-file-utils dos2unix gmake gnome \ iconv openal:al perl5 pkgconfig python:3.9,build sdl tar:xz \ xorg USE_GNOME= libxml2 USE_GL= gl USE_SDL= sdl2 USE_XORG= x11 xcursor USE_PERL5= build WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION} BUILD_WRKSRC= ${WRKSRC}/build/workspaces/gcc MAKE_ARGS= config=release verbose=1 CPPFLAGS+= -DU_USING_ICU_NAMESPACE=1 CFLAGS_i386= -msse2 BUNDLE_LIBS= yes DOS2UNIX_REGEX= .*\.([ch]p{0,2}|make) BINARY_ALIAS= python3=${PYTHON_CMD} USE_WX= 3.0+ WX_COMPS= wx:lib MAKE_ENV+= JOBS=${_MAKE_JOBS} PORTDATA= * .include post-extract: @(cd ${WRKSRC}/libraries/source/nvtt && ${TAR} xf nvtt-28209.tar.xz) post-patch: @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ -e 's|%%CC%%|${CC}|' \ ${WRKSRC}/build/premake/extern_libs5.lua .if ${ARCH} == i386 && ${CHOSEN_COMPILER_TYPE} == gcc @${REINPLACE_CMD} -e '1130,1530s/-rdynamic/-lssp_nonshared &/' \ -e '1112,1502s/"execinfo",/& "ssp_nonshared",/' \ ${WRKSRC}/build/premake/premake5.lua .endif pre-build: (cd ${WRKSRC}/libraries && ${SETENV} ${MAKE_ENV} ./build-source-libs.sh --with-system-mozjs -j ${_MAKE_JOBS}) (cd ${WRKSRC}/build/workspaces && ${SETENV} ${MAKE_ENV} ./update-workspaces.sh --with-system-mozjs --bindir=${PREFIX}/bin --datadir=${DATADIR} --libdir=${PREFIX}/lib/${PORTNAME}) do-install: ${INSTALL_PROGRAM} ${WRKSRC}/binaries/system/pyrogenesis ${STAGEDIR}${PREFIX}/bin ${INSTALL_SCRIPT} ${WRKSRC}/build/resources/0ad.sh ${STAGEDIR}${PREFIX}/bin/0ad ${INSTALL_PROGRAM} ${WRKSRC}/binaries/system/ActorEditor ${STAGEDIR}${PREFIX}/bin ${MKDIR} ${STAGEDIR}${PREFIX}/lib/${PORTNAME} (cd ${WRKSRC}/binaries/system && ${INSTALL_LIB} libAtlasUI.so libCollada.so libnvcore.so libnvimage.so libnvmath.so libnvtt.so ${STAGEDIR}${PREFIX}/lib/${PORTNAME}) ${INSTALL_DATA} ${WRKSRC}/build/resources/0ad.desktop ${STAGEDIR}${PREFIX}/share/applications ${INSTALL_DATA} ${WRKSRC}/build/resources/0ad.png ${STAGEDIR}${PREFIX}/share/pixmaps ${MKDIR} ${STAGEDIR}${DATADIR} (cd ${WRKSRC}/binaries/data && ${COPYTREE_SHARE} "config l10n tests tools" ${STAGEDIR}${DATADIR}) ${MKDIR} ${STAGEDIR}${DATADIR}/mods/public ${STAGEDIR}${DATADIR}/mods/mod ${TAR} xf ${WRKSRC}/binaries/data/mods/public/public.zip -C ${STAGEDIR}${DATADIR}/mods/public --no-same-permissions ${TAR} xf ${WRKSRC}/binaries/data/mods/mod/mod.zip -C ${STAGEDIR}${DATADIR}/mods/mod --no-same-permissions .include diff --git a/games/0ad/files/patch-GL-OOB-fix b/games/0ad/files/patch-GL-OOB-fix new file mode 100644 index 000000000000..1f5548cc6684 --- /dev/null +++ b/games/0ad/files/patch-GL-OOB-fix @@ -0,0 +1,48 @@ +From a1f7568df9814d0dc399fc1e4f1c122da24a8f05 Mon Sep 17 00:00:00 2001 +From: Vladislav Belov +Date: Fri, 7 Feb 2025 22:24:00 +0100 +Subject: [PATCH] Fixes out of bounds during GL buffer binding. + +--- + source/renderer/backend/gl/DeviceCommandContext.cpp | 4 ++++ + source/renderer/backend/gl/DeviceCommandContext.h | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/source/renderer/backend/gl/DeviceCommandContext.cpp b/source/renderer/backend/gl/DeviceCommandContext.cpp +index dacdd4377b..87bc323305 100644 +--- source/renderer/backend/gl/DeviceCommandContext.cpp ++++ source/renderer/backend/gl/DeviceCommandContext.cpp +@@ -246,6 +246,9 @@ CDeviceCommandContext::CDeviceCommandContext(CDevice* device) + for (size_t index = 0; index < m_BoundBuffers.size(); ++index) + { + const CBuffer::Type type = static_cast(index); ++ // Currently we don't support upload buffers for GL. ++ if (type == CBuffer::Type::UPLOAD) ++ continue; + const GLenum target = BufferTypeToGLTarget(type); + const GLuint handle = 0; + m_BoundBuffers[index].first = target; +@@ -1456,6 +1459,7 @@ CDeviceCommandContext::ScopedBufferBind::ScopedBufferBind( + { + ENSURE(buffer); + m_CacheIndex = static_cast(buffer->GetType()); ++ ENSURE(m_CacheIndex < m_DeviceCommandContext->m_BoundBuffers.size()); + const GLenum target = BufferTypeToGLTarget(buffer->GetType()); + const GLuint handle = buffer->GetHandle(); + if (m_DeviceCommandContext->m_BoundBuffers[m_CacheIndex].first == target && +diff --git a/source/renderer/backend/gl/DeviceCommandContext.h b/source/renderer/backend/gl/DeviceCommandContext.h +index 5f1a251007..3d23d89c06 100644 +--- source/renderer/backend/gl/DeviceCommandContext.h ++++ source/renderer/backend/gl/DeviceCommandContext.h +@@ -221,7 +221,7 @@ private: + }; + + using BoundBuffer = std::pair; +- std::array m_BoundBuffers; ++ std::array m_BoundBuffers; + class ScopedBufferBind + { + public: +-- +2.43.5 + diff --git a/games/0ad/files/patch-binaries_data_config_default.cfg b/games/0ad/files/patch-binaries_data_config_default.cfg deleted file mode 100644 index 1651fbdc596d..000000000000 --- a/games/0ad/files/patch-binaries_data_config_default.cfg +++ /dev/null @@ -1,11 +0,0 @@ ---- binaries/data/config/default.cfg.orig 2025-01-28 19:44:19 UTC -+++ binaries/data/config/default.cfg -@@ -154,7 +154,7 @@ textures.maxanisotropy = 2 - textures.maxanisotropy = 2 - - ; GPU skinning via compute shaders, requires up-to-date drivers --gpuskinning = true -+gpuskinning = false - - ; Use smooth LOS interpolation - smoothlos = true