From e8ec4953d2c9f991999018190d92d203ee10ad4d Mon Sep 17 00:00:00 2001 From: kyehn Date: Fri, 13 Feb 2026 03:22:28 +0000 Subject: [PATCH] ausaxs: 1.1.7 -> 1.2.0 --- .../au/ausaxs/cmake-no-fetchcontent.patch | 45 +++++++++---------- pkgs/by-name/au/ausaxs/package.nix | 37 +++++---------- 2 files changed, 33 insertions(+), 49 deletions(-) diff --git a/pkgs/by-name/au/ausaxs/cmake-no-fetchcontent.patch b/pkgs/by-name/au/ausaxs/cmake-no-fetchcontent.patch index 551c84541598..cf59380de47b 100644 --- a/pkgs/by-name/au/ausaxs/cmake-no-fetchcontent.patch +++ b/pkgs/by-name/au/ausaxs/cmake-no-fetchcontent.patch @@ -1,6 +1,6 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -85,7 +85,7 @@ +@@ -110,7 +110,7 @@ set(DLIB_USE_MKL_FFT OFF) set(DLIB_USE_FFMPEG OFF) set(CMAKE_CXX_STANDARD 17) # dlib must be compiled with C++17 @@ -9,19 +9,33 @@ set(CMAKE_CXX_STANDARD 20) # continue with C++20 add_compile_definitions("DLIB_AVAILABLE") endif() -@@ -105,8 +105,9 @@ - GIT_REPOSITORY https://github.com/klytje/gcem +@@ -141,7 +141,6 @@ + thread_pool + GIT_REPOSITORY https://github.com/bshoshany/thread-pool + ) +- FetchContent_MakeAvailable(thread_pool) + endif() + + if(USE_SYSTEM_GCEM) +@@ -151,7 +150,6 @@ + gcem + GIT_REPOSITORY https://github.com/klytje/gcem + ) +- FetchContent_MakeAvailable(GCEM) + endif() + + set_property( +@@ -160,7 +158,9 @@ ) + unset(compile_options) --FetchContent_MakeAvailable(thread_pool GCEM backward) -include_directories(${thread_pool_SOURCE_DIR}/include ${gcem_SOURCE_DIR}/include ${backward_SOURCE_DIR}) ++include_directories(${backward_SOURCE_DIR}) +add_subdirectory(gcem) -+add_subdirectory(backward) -+include_directories(thread_pool/include gcem/include backward) ++include_directories(thread_pool/include gcem/include) ############################################ ## Find and link CURL ## - --- a/executable/gui/CMakeLists.txt +++ b/executable/gui/CMakeLists.txt @@ -6,7 +6,9 @@ @@ -35,20 +49,3 @@ # set the path to the elements root & module path set(ELEMENTS_ROOT "${elements_SOURCE_DIR}") - ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -18,10 +18,10 @@ - GIT_TAG 914aeecfe23b1e16af6ea675a4fb5dbd5a5b8d0a - GIT_PROGRESS TRUE - ) --FetchContent_MakeAvailable(Catch2) -+add_subdirectory(${CMAKE_SOURCE_DIR}/catch2 catch2_build) - - # make the tests available through CTest --list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras) -+list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/catch2/extras) - include(CTest) - include(Catch) - - diff --git a/pkgs/by-name/au/ausaxs/package.nix b/pkgs/by-name/au/ausaxs/package.nix index 6b6cd5e0ec75..15e43eae4a9f 100644 --- a/pkgs/by-name/au/ausaxs/package.nix +++ b/pkgs/by-name/au/ausaxs/package.nix @@ -11,6 +11,8 @@ pkg-config, cairo, gtk3, + catch2_3, + backward-cpp, }: let @@ -35,20 +37,6 @@ let hash = "sha256-bnWakLHl/afpeFm6S32ku0IkniyIs8X+LE1NmV6p0ho="; }; - backward-cpp = fetchFromGitHub { - owner = "bombela"; - repo = "backward-cpp"; - rev = "0bfd0a07a61551413ccd2ab9a9099af3bad40681"; - hash = "sha256-nLH8jfdgzmlUTg6zwY/h0HVnDMeC9rvmX1x4Ithu9dI="; - }; - - catch2 = fetchFromGitHub { - owner = "catchorg"; - repo = "Catch2"; - rev = "914aeecfe23b1e16af6ea675a4fb5dbd5a5b8d0a"; - hash = "sha256-2gK+CUpml6AaHcwNoq0tHLr2NwqtMPx+jP80/LLFFr4="; - }; - elements = fetchFromGitHub { owner = "cycfi"; repo = "elements"; @@ -80,13 +68,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "ausaxs"; - version = "1.1.7"; + version = "1.2.0"; src = fetchFromGitHub { owner = "AUSAXS"; repo = "AUSAXS"; tag = "v${finalAttrs.version}"; - hash = "sha256-/d6EXDn60ap7dluJZtVP5vGiJTn4ggF7XYZ6ONGipDs="; + hash = "sha256-vTuQsg76p0WHPadwqBdDGBSNgNmr5TxuwlNj47P+sa8="; }; patches = [ ./cmake-no-fetchcontent.patch ]; @@ -95,23 +83,15 @@ stdenv.mkDerivation (finalAttrs: { cp --recursive --no-preserve=mode ${dlib} dlib cp --recursive --no-preserve=mode ${thread-pool} thread_pool cp --recursive --no-preserve=mode ${gcem} gcem - cp --recursive --no-preserve=mode ${backward-cpp} backward - cp --recursive --no-preserve=mode ${catch2} catch2 cp --recursive --no-preserve=mode ${nfd} nfd cp --recursive --no-preserve=mode ${elements} elements cp --recursive --no-preserve=mode ${asio} asio cp --recursive --no-preserve=mode ${cycfi_infra} cycfi_infra - substituteInPlace executable/CMakeLists.txt \ - --replace-fail "FetchContent_MakeAvailable(CLI11)" "find_package(CLI11 CONFIG REQUIRED)" - substituteInPlace include/crystal/crystal/miller/MillerGenerationFactory.h \ - --replace-fail "namespace ausaxs::settings::crystal {enum class MillerGenerationChoice;}" '#include "../core/settings/CrystalSettings.h"' patch -p1 -d elements < ${./elements-cmake-no-fetchcontent.patch} substituteInPlace CMakeLists.txt \ --replace-fail "-mavx" "${ lib.optionalString (stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform.isLinux) "-msse3" }" - sed -i '/#include /a\ - #include ' source/crystal/miller/FibonacciMillers.cpp ''; nativeBuildInputs = [ @@ -122,6 +102,8 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ + backward-cpp + catch2_3 curl cli11 cairo @@ -129,7 +111,12 @@ stdenv.mkDerivation (finalAttrs: { gtk3 ]; - cmakeFlags = [ (lib.cmakeBool "GUI" true) ]; + cmakeFlags = [ + (lib.cmakeBool "GUI" true) + (lib.cmakeBool "USE_SYSTEM_CATCH" true) + (lib.cmakeBool "USE_SYSTEM_CLI11" true) + (lib.cmakeBool "USE_SYSTEM_BACKWARD" true) + ]; postInstall = '' cp --recursive lib/* $out/lib/