commit:     8b6cc09e70cf9b0af29b0db4d145599f80b7a761
Author:     Patrick Nicolas <patricknicolas <AT> laposte <DOT> net>
AuthorDate: Wed Oct 30 15:30:32 2024 +0000
Commit:     Patrick Nicolas <patricknicolas <AT> laposte <DOT> net>
CommitDate: Wed Oct 30 15:31:05 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=8b6cc09e

media-gfx/KTX-Software: patches for O3 and Werror

Signed-off-by: Patrick Nicolas <patricknicolas <AT> laposte.net>

 media-gfx/KTX-Software/KTX-Software-4.3.2.ebuild         |  4 ++++
 .../files/KTX-Software-4.3.2-remove-O3.patch             | 16 ++++++++++++++++
 .../files/KTX-Software-4.3.2-remove-Werror.patch         | 12 ++++++++++++
 3 files changed, 32 insertions(+)

diff --git a/media-gfx/KTX-Software/KTX-Software-4.3.2.ebuild 
b/media-gfx/KTX-Software/KTX-Software-4.3.2.ebuild
index 3ead98175..b68751628 100644
--- a/media-gfx/KTX-Software/KTX-Software-4.3.2.ebuild
+++ b/media-gfx/KTX-Software/KTX-Software-4.3.2.ebuild
@@ -24,6 +24,10 @@ BDEPEND="
        app-shells/bash
 "
 
+PATCHES=(
+       "${FILESDIR}/${P}-remove-O3.patch"
+       "${FILESDIR}/${P}-remove-Werror.patch"
+)
 
 src_configure() {
        # basisu_kernels_sse.cpp has a #error if any of those are set

diff --git a/media-gfx/KTX-Software/files/KTX-Software-4.3.2-remove-O3.patch 
b/media-gfx/KTX-Software/files/KTX-Software-4.3.2-remove-O3.patch
new file mode 100644
index 000000000..58758d6f9
--- /dev/null
+++ b/media-gfx/KTX-Software/files/KTX-Software-4.3.2-remove-O3.patch
@@ -0,0 +1,16 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e99fb143..05691fa4 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -280,11 +280,8 @@ if(MSVC)
+ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"
+        OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
+     add_compile_options( -Wall -Wextra $<$<BOOL:${KTX_WERROR}>:-Werror>)
+-    add_compile_options( $<IF:$<CONFIG:Debug>,-O0,-O3> )
+     if(EMSCRIPTEN)
+         add_link_options( $<IF:$<CONFIG:Debug>,-gsource-map,-O3> )
+-    else()
+-        add_link_options( $<IF:$<CONFIG:Debug>,-g,-O3> )
+     endif()
+ else()
+     message(FATAL_ERROR "${CMAKE_CXX_COMPILER_ID} not yet supported.")

diff --git 
a/media-gfx/KTX-Software/files/KTX-Software-4.3.2-remove-Werror.patch 
b/media-gfx/KTX-Software/files/KTX-Software-4.3.2-remove-Werror.patch
new file mode 100644
index 000000000..333c00942
--- /dev/null
+++ b/media-gfx/KTX-Software/files/KTX-Software-4.3.2-remove-Werror.patch
@@ -0,0 +1,12 @@
+diff --git a/lib/astc-encoder/Source/cmake_core.cmake 
b/lib/astc-encoder/Source/cmake_core.cmake
+index eec1f459..eb149503 100644
+--- a/lib/astc-encoder/Source/cmake_core.cmake
++++ b/lib/astc-encoder/Source/cmake_core.cmake
+@@ -168,7 +168,6 @@ macro(astcenc_set_properties ASTCENC_TARGET_NAME 
ASTCENC_IS_VENEER)
+             $<${is_gnu_fe}:-Wall>
+             $<${is_gnu_fe}:-Wextra>
+             $<${is_gnu_fe}:-Wpedantic>
+-            $<${is_gnu_fe}:-Werror>
+             $<${is_gnu_fe}:-Wshadow>
+             $<${is_gnu_fe}:-Wdouble-promotion>
+             $<${is_clang}:-Wdocumentation>

Reply via email to