From 153f063cfeb65ea3a345742fa8fc968f526881b3 Mon Sep 17 00:00:00 2001 From: aware70 <7832566+aware70@users.noreply.github.com> Date: Thu, 2 Jan 2025 14:04:44 -0600 Subject: [PATCH] supercell-wx: update for gcc14 and use Nix stb --- pkgs/by-name/su/supercell-wx/package.nix | 4 +++- .../add-missing-algorithm-include-gcc14.patch | 11 +++++++++++ .../patches/use-find-package.patch | 19 +++++++++++++++---- 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 pkgs/by-name/su/supercell-wx/patches/add-missing-algorithm-include-gcc14.patch diff --git a/pkgs/by-name/su/supercell-wx/package.nix b/pkgs/by-name/su/supercell-wx/package.nix index 5ed488b5b06df..fd01b2adace72 100644 --- a/pkgs/by-name/su/supercell-wx/package.nix +++ b/pkgs/by-name/su/supercell-wx/package.nix @@ -75,7 +75,7 @@ stdenv.mkDerivation (finalAttrs: { maintainers = with lib.maintainers; [ aware70 ]; }; - env.CXXFLAGS = "-Wno-error=restrict -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations"; + env.CXXFLAGS = "-Wno-error=restrict -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=stringop-overflow"; env.GTEST_FILTER = "-${lib.concatStringsSep ":" gtestSkip}"; doCheck = true; @@ -83,6 +83,7 @@ stdenv.mkDerivation (finalAttrs: { # These tests aren't built by 'all', but ctest still tries to run them. cmakeFlags = [ "-DCMAKE_CTEST_ARGUMENTS=-E;'test_mln_core|test_mln_widgets'" + "-DSTB_INCLUDE_DIR=${stb}/include/stb" ]; patches = [ @@ -106,6 +107,7 @@ stdenv.mkDerivation (finalAttrs: { url = "https://github.com/dpaulat/supercell-wx/commit/9dfbac66172b882c5c4ccfa4251a03f8bf607b02.diff"; sha256 = "sha256-sGw/vwJVNcWD56z/cG0VMZo+daQXb/I0+zbG3Gr18lU="; }) + ./patches/add-missing-algorithm-include-gcc14.patch # }}} ]; diff --git a/pkgs/by-name/su/supercell-wx/patches/add-missing-algorithm-include-gcc14.patch b/pkgs/by-name/su/supercell-wx/patches/add-missing-algorithm-include-gcc14.patch new file mode 100644 index 0000000000000..25e80721b9342 --- /dev/null +++ b/pkgs/by-name/su/supercell-wx/patches/add-missing-algorithm-include-gcc14.patch @@ -0,0 +1,11 @@ +diff --git a/test/source/scwx/common/products.test.cpp b/test/source/scwx/common/products.test.cpp +index 5b945bf3..2657074e 100644 +--- a/test/source/scwx/common/products.test.cpp ++++ b/test/source/scwx/common/products.test.cpp +@@ -1,5 +1,6 @@ + #include + ++#include + #include + + namespace scwx diff --git a/pkgs/by-name/su/supercell-wx/patches/use-find-package.patch b/pkgs/by-name/su/supercell-wx/patches/use-find-package.patch index 1870f349309fc..17dad099c4c0a 100644 --- a/pkgs/by-name/su/supercell-wx/patches/use-find-package.patch +++ b/pkgs/by-name/su/supercell-wx/patches/use-find-package.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 08b5e82..0063794 100644 +index 08b5e823..00637941 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,32 +15,6 @@ enable_testing() @@ -36,7 +36,7 @@ index 08b5e82..0063794 100644 set(SCWX_DIR ${PROJECT_SOURCE_DIR}) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt -index bbc76c6..e242ee4 100644 +index bbc76c64..e242ee44 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -13,8 +13,8 @@ set_property(DIRECTORY @@ -50,8 +50,19 @@ index bbc76c6..e242ee4 100644 include(hsluv-c.cmake) include(imgui.cmake) include(maplibre-native-qt.cmake) +diff --git a/external/stb.cmake b/external/stb.cmake +index c26bedaf..cd978e9d 100644 +--- a/external/stb.cmake ++++ b/external/stb.cmake +@@ -1,4 +1,5 @@ + cmake_minimum_required(VERSION 3.20) + set(PROJECT_NAME scwx-stb) + +-set(STB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/stb PARENT_SCOPE) ++# Nix: specify with cmakeFlags ++#set(STB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/stb PARENT_SCOPE) diff --git a/scwx-qt/scwx-qt.cmake b/scwx-qt/scwx-qt.cmake -index cda6c7f..008f4c4 100644 +index cda6c7f2..008f4c4a 100644 --- a/scwx-qt/scwx-qt.cmake +++ b/scwx-qt/scwx-qt.cmake @@ -11,14 +11,15 @@ set(CMAKE_AUTORCC ON) @@ -100,7 +111,7 @@ index cda6c7f..008f4c4 100644 target_link_libraries(supercell-wx PRIVATE scwx-qt diff --git a/wxdata/wxdata.cmake b/wxdata/wxdata.cmake -index 0ce08cb..3807810 100644 +index 0ce08cbb..3807810d 100644 --- a/wxdata/wxdata.cmake +++ b/wxdata/wxdata.cmake @@ -2,11 +2,14 @@ cmake_minimum_required(VERSION 3.20)