mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-games/ogre: fix tests w/ AVX512
Closes: https://bugs.gentoo.org/961871 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
39
dev-games/ogre/files/ogre-14.4.0-avx512-nan.patch
Normal file
39
dev-games/ogre/files/ogre-14.4.0-avx512-nan.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
https://bugs.gentoo.org/961871
|
||||
https://github.com/OGRECave/ogre/issues/3431
|
||||
https://github.com/OGRECave/ogre/pull/3434
|
||||
|
||||
From 2130758685a58b963ee1012e0bf0ef50859d38f5 Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Rojtberg <rojtberg@gmail.com>
|
||||
Date: Sat, 23 Aug 2025 01:36:01 +0200
|
||||
Subject: [PATCH] Main: Bitwise - do not generate nan for bits=0
|
||||
|
||||
---
|
||||
OgreMain/include/OgreBitwise.h | 2 +-
|
||||
Tests/OgreMain/src/BitwiseTests.cpp | 1 +
|
||||
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/OgreMain/include/OgreBitwise.h b/OgreMain/include/OgreBitwise.h
|
||||
index 3ce2115546b..ab321cfc5fb 100644
|
||||
--- a/OgreMain/include/OgreBitwise.h
|
||||
+++ b/OgreMain/include/OgreBitwise.h
|
||||
@@ -246,7 +246,7 @@ namespace Ogre {
|
||||
*/
|
||||
static inline float fixedToFloat(unsigned value, unsigned int bits)
|
||||
{
|
||||
- return (float)value/(float)((1<<bits)-1);
|
||||
+ return bits ? (float)value/(float)((1<<bits)-1) : 0.0f;
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/Tests/OgreMain/src/BitwiseTests.cpp b/Tests/OgreMain/src/BitwiseTests.cpp
|
||||
index 2d482795904..3afb4e86acb 100644
|
||||
--- a/Tests/OgreMain/src/BitwiseTests.cpp
|
||||
+++ b/Tests/OgreMain/src/BitwiseTests.cpp
|
||||
@@ -46,6 +46,7 @@ TEST(BitwiseTests,FixedPointConversion)
|
||||
|
||||
EXPECT_EQ(Bitwise::fixedToFloat(0xFF, 8), 1.0f);
|
||||
EXPECT_EQ(Bitwise::fixedToFloat(0x00, 8), 0.0f);
|
||||
+ EXPECT_EQ(Bitwise::fixedToFloat(0xFF, 0), 0.0f);
|
||||
|
||||
EXPECT_EQ(Bitwise::floatToFixed(1.0f, 8), (unsigned int)0xFF);
|
||||
EXPECT_EQ(Bitwise::floatToFixed(0.0f, 8), (unsigned int)0x00);
|
||||
186
dev-games/ogre/ogre-14.4.0-r1.ebuild
Normal file
186
dev-games/ogre/ogre-14.4.0-r1.ebuild
Normal file
@@ -0,0 +1,186 @@
|
||||
# Copyright 2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit cmake flag-o-matic virtualx
|
||||
|
||||
# Components/Overlay/CMakeLists.txt
|
||||
IMGUI_PV="1.91.9b"
|
||||
|
||||
DESCRIPTION="Object-oriented Graphics Rendering Engine"
|
||||
HOMEPAGE="https://www.ogre3d.org/"
|
||||
SRC_URI="
|
||||
https://github.com/OGRECave/ogre/archive/refs/tags/v${PV}.tar.gz
|
||||
-> ${P}.tar.gz
|
||||
https://github.com/ocornut/imgui/archive/v${IMGUI_PV}.tar.gz
|
||||
-> imgui-${IMGUI_PV}.tar.gz
|
||||
"
|
||||
|
||||
LICENSE="MIT public-domain"
|
||||
SLOT="0/$(ver_cut 1-2)"
|
||||
KEYWORDS="~amd64 ~arm ~x86"
|
||||
|
||||
IUSE="assimp bullet cg doc +dotscene egl-only freeimage +gl3plus gles2 glslang opengl qt6 samples test tiny tools sdl vulkan wayland"
|
||||
REQUIRED_USE="
|
||||
|| ( gl3plus gles2 opengl tiny vulkan )
|
||||
egl-only? ( || ( gl3plus gles2 opengl ) )
|
||||
test? ( samples )
|
||||
vulkan? ( glslang )
|
||||
wayland? ( egl-only )
|
||||
"
|
||||
# vulkan broken, proper handling required for wayland
|
||||
RESTRICT="
|
||||
!test? ( test )
|
||||
vulkan? ( test )
|
||||
wayland? ( test )
|
||||
"
|
||||
|
||||
# freetype and zlib are automagic
|
||||
# vulkan-loader is dlopen'd
|
||||
RDEPEND="
|
||||
media-libs/freetype:2
|
||||
sys-libs/zlib
|
||||
assimp? ( media-libs/assimp:= )
|
||||
bullet? ( sci-physics/bullet:= )
|
||||
cg? ( media-gfx/nvidia-cg-toolkit )
|
||||
dotscene? ( dev-libs/pugixml )
|
||||
freeimage? ( media-libs/freeimage )
|
||||
gl3plus? ( virtual/opengl )
|
||||
glslang? ( dev-util/glslang:= )
|
||||
gles2? ( virtual/opengl )
|
||||
opengl? ( virtual/opengl )
|
||||
qt6? ( dev-qt/qtbase:6[gui] )
|
||||
sdl? ( media-libs/libsdl2 )
|
||||
tools? ( dev-libs/pugixml )
|
||||
vulkan? ( media-libs/vulkan-loader )
|
||||
wayland? ( dev-libs/wayland )
|
||||
!wayland? (
|
||||
x11-libs/libX11
|
||||
x11-libs/libXaw
|
||||
x11-libs/libXt
|
||||
gl3plus? ( x11-libs/libXrandr )
|
||||
gles2? ( x11-libs/libXrandr )
|
||||
opengl? ( x11-libs/libXrandr )
|
||||
)
|
||||
"
|
||||
DEPEND="${RDEPEND}
|
||||
test? ( dev-cpp/gtest )
|
||||
vulkan? ( dev-util/vulkan-headers )
|
||||
"
|
||||
BDEPEND="
|
||||
virtual/pkgconfig
|
||||
doc? ( app-text/doxygen[dot] )
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-14.4.0-avx512-nan.patch
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
cmake_src_prepare
|
||||
|
||||
# Users should set this via their CFLAGS (like -march)
|
||||
sed -e '/check_cxx_compiler_flag(-msse OGRE_GCC_HAS_SSE)/d' \
|
||||
-i CMakeLists.txt || die
|
||||
|
||||
# Force Qt6
|
||||
sed -e '/find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui QUIET CONFIG)/ { s/Qt5// }' \
|
||||
-i CMake/Dependencies.cmake || die
|
||||
|
||||
# Lets not install test binaries
|
||||
sed -e '/ogre_install_target(Test_Ogre "" FALSE)/d' \
|
||||
-i Tests/CMakeLists.txt || die
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
# odr violations
|
||||
filter-lto
|
||||
|
||||
local mycmakeargs=(
|
||||
# https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb809aeadee57ffa24591e60cfb41aecd4823090
|
||||
-DOGRE_ENABLE_PRECOMPILED_HEADERS=OFF
|
||||
|
||||
-DOGRE_BUILD_COMPONENT_BITES=ON
|
||||
-DOGRE_BUILD_COMPONENT_BULLET=$(usex bullet)
|
||||
-DOGRE_BUILD_COMPONENT_CSHARP=OFF
|
||||
-DOGRE_BUILD_COMPONENT_JAVA=OFF
|
||||
-DOGRE_BUILD_COMPONENT_MESHLODGENERATOR=ON
|
||||
-DOGRE_BUILD_COMPONENT_OVERLAY=ON
|
||||
-DOGRE_BUILD_COMPONENT_OVERLAY_IMGUI=ON
|
||||
-DOGRE_BUILD_COMPONENT_PAGING=ON
|
||||
-DOGRE_BUILD_COMPONENT_PROPERTY=ON
|
||||
-DOGRE_BUILD_COMPONENT_PYTHON=OFF
|
||||
-DOGRE_BUILD_COMPONENT_RTSHADERSYSTEM=ON
|
||||
-DOGRE_BUILD_COMPONENT_TERRAIN=ON
|
||||
-DOGRE_BUILD_COMPONENT_VOLUME=ON
|
||||
|
||||
-DOGRE_BUILD_PLUGIN_ASSIMP=$(usex assimp)
|
||||
-DOGRE_BUILD_PLUGIN_BSP=ON
|
||||
-DOGRE_BUILD_PLUGIN_CG=$(usex cg) # "deprecated"
|
||||
-DOGRE_BUILD_PLUGIN_DOT_SCENE=$(usex dotscene)
|
||||
-DOGRE_BUILD_PLUGIN_EXRCODEC=OFF # "deprecated" and doesn't work
|
||||
-DOGRE_BUILD_PLUGIN_FREEIMAGE=$(usex freeimage) # "deprecated"
|
||||
-DOGRE_BUILD_PLUGIN_GLSLANG=$(usex glslang)
|
||||
-DOGRE_BUILD_PLUGIN_OCTREE=ON
|
||||
-DOGRE_BUILD_PLUGIN_PCZ=ON
|
||||
-DOGRE_BUILD_PLUGIN_PFX=ON
|
||||
-DOGRE_BUILD_PLUGIN_RSIMAGE=OFF # rust
|
||||
-DOGRE_BUILD_PLUGIN_STBI=ON # vendored stb headers
|
||||
|
||||
-DOGRE_BUILD_RENDERSYSTEM_GL=$(usex opengl)
|
||||
-DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=$(usex gl3plus)
|
||||
-DOGRE_BUILD_RENDERSYSTEM_GLES2=$(usex gles2)
|
||||
# "BETA". Tests will not pass with this
|
||||
-DOGRE_BUILD_RENDERSYSTEM_VULKAN=$(usex vulkan)
|
||||
-DOGRE_BUILD_RENDERSYSTEM_TINY=$(usex tiny)
|
||||
|
||||
-DOGRE_BUILD_SAMPLES=$(usex samples)
|
||||
-DOGRE_INSTALL_SAMPLES=$(usex samples)
|
||||
-DOGRE_BUILD_TOOLS=$(usex tools)
|
||||
-DOGRE_INSTALL_TOOLS=$(usex tools)
|
||||
-DOGRE_BUILD_XSIEXPORTER=OFF # softimage
|
||||
-DOGRE_BUILD_TESTS=$(usex test)
|
||||
|
||||
-DOGRE_BUILD_DEPENDENCIES=OFF
|
||||
-DIMGUI_DIR="${WORKDIR}/imgui-${IMGUI_PV}"
|
||||
|
||||
-DOGRE_CFG_INSTALL_PATH="/etc/OGRE"
|
||||
-DOGRE_MEDIA_PATH="share/OGRE/Media"
|
||||
|
||||
-DOGRE_DOCS_PATH="share/docs/${PF}"
|
||||
-DOGRE_INSTALL_DOCS=$(usex doc)
|
||||
|
||||
$(cmake_use_find_package qt6 QT)
|
||||
$(cmake_use_find_package sdl SDL2)
|
||||
)
|
||||
|
||||
if use gl3plus || use gles2 || use opengl ; then
|
||||
mycmakeargs+=(
|
||||
# TODO: wayland support needs more work.
|
||||
# tests don't run with tinywl and it doesnt work at runtime
|
||||
-DOGRE_USE_WAYLAND=$(usex wayland)
|
||||
-DOGRE_GLSUPPORT_USE_EGL=$(usex egl-only)
|
||||
)
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
cmake_src_compile
|
||||
use doc && cmake_build OgreDoc
|
||||
}
|
||||
|
||||
src_test() {
|
||||
virtx cmake_src_test
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if use samples; then
|
||||
elog "If you experience crashes when starting /usr/bin/SampleBrowser,"
|
||||
elog "remove the cache directory at:"
|
||||
elog " '~/.cache/OGRE Sample Browser'"
|
||||
elog "first, before filing a bug report."
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user