From 1dfb64a6ef97cfe5dc295bdf038a1d730b687081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Sat, 30 Dec 2023 20:33:01 +0100 Subject: [PATCH] sundials: use cmake target file of KLU --- .../0004-suitesparse-import-target.patch | 20 +++++++++++++++++++ mingw-w64-sundials/PKGBUILD | 5 ++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 mingw-w64-sundials/0004-suitesparse-import-target.patch diff --git a/mingw-w64-sundials/0004-suitesparse-import-target.patch b/mingw-w64-sundials/0004-suitesparse-import-target.patch new file mode 100644 index 0000000000000..e65558bac62ca --- /dev/null +++ b/mingw-w64-sundials/0004-suitesparse-import-target.patch @@ -0,0 +1,20 @@ +Use CMake target installed by SuiteSparse if available. + +diff -urN sundials-6.7.0/cmake/tpl/FindKLU.cmake.orig sundials-6.7.0/cmake/tpl/FindKLU.cmake +--- sundials-6.7.0/cmake/tpl/FindKLU.cmake.orig 2023-12-18 18:26:43.000000000 +0100 ++++ sundials-6.7.0/cmake/tpl/FindKLU.cmake 2023-12-30 20:26:08.649091700 +0100 +@@ -30,6 +30,14 @@ + # KLU_LIBRARIES - all of the libraries needed for KLU + # --------------------------------------------------------------- + ++find_package(KLU CONFIG) ++ ++if(TARGET SuiteSparse::KLU) ++ set(KLU_FOUND ON) ++ add_library(SUNDIALS::KLU ALIAS SuiteSparse::KLU) ++ return() ++endif() ++ + # Set library prefixes for Windows + if(WIN32) + set(CMAKE_FIND_LIBRARY_PREFIXES lib ${CMAKE_FIND_LIBRARY_PREFIXES}) diff --git a/mingw-w64-sundials/PKGBUILD b/mingw-w64-sundials/PKGBUILD index 179adce7723ba..cc96a2b3b707c 100644 --- a/mingw-w64-sundials/PKGBUILD +++ b/mingw-w64-sundials/PKGBUILD @@ -4,7 +4,7 @@ _realname=sundials pkgbase="mingw-w64-${_realname}" pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=6.7.0 -pkgrel=1 +pkgrel=2 pkgdesc="SUite of Nonlinear and DIfferential/ALgebraic equation Solvers (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64') @@ -32,11 +32,13 @@ source=(https://github.com/LLNL/sundials/releases/download/v${pkgver}/${_realnam '0001-hash-size.patch' '0002-sundials-missing-export.patch' '0003-sundials-use-default-installdirs.patch' + '0004-suitesparse-import-target.patch' '0008-sundials-petsc-pkg-config-module.patch') sha256sums=('5f113a1564a9d2d98ff95249f4871a4c815a05dbb9b8866a82b13ab158c37adb' '9dd5c708bad0a592a7012c1bdfd91904867cd9efe89412d82706764b21c4537c' '7f119fbcc8a630a4e3443e3bba252dafb4b1567ced1bf1389052253529e97ddc' '310b9beb86426fd2f817391baf72c0f9aefe9dc31e737daed5cc0280b7693311' + '753b127af0aa1fbbf03ab67104846f968bd476659cb151d65931b5e5beae3f0d' 'd4a56ef02d87d8d17970733fe8391c12fea9465f093681a1091a24b2ad0a787a') apply_patch_with_msg() { @@ -54,6 +56,7 @@ prepare() { 0001-hash-size.patch \ 0002-sundials-missing-export.patch \ 0003-sundials-use-default-installdirs.patch \ + 0004-suitesparse-import-target.patch \ 0008-sundials-petsc-pkg-config-module.patch }