From 7c5d3592e75cd413eed10949418046a96097ae34 Mon Sep 17 00:00:00 2001 From: David Elsing Date: Thu, 5 Oct 2023 21:34:54 +0000 Subject: [PATCH] gnu: Add metis-suitesparse. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/maths.scm (metis-suitesparse): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/maths.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index a096b24cfef60dc53612a40cd34a101d5d6f463f..e2018d45402306750e3ec26edcd8a944637eb4a4 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -5422,6 +5422,32 @@ COLAMD which has the the option to apply constraints to the ordering.") (modify-inputs (package-inputs gklib) (prepend suitesparse-config))))) +(define-public metis-suitesparse + (package/inherit metis-5.2 + (name "metis-suitesparse") + (arguments + (substitute-keyword-arguments (package-arguments metis-5.2) + ((#:phases phases) + #~(modify-phases #$phases + (add-before 'prepare-cmake 'set-idxwidth + (lambda _ + (substitute* "Makefile" + (("IDXWIDTH.*=.*") + "IDXWIDTH = \"\\#define IDXTYPEWIDTH 64\"\n")))) + (add-before 'prepare-cmake 'link-suitesparse-config + (lambda _ + (substitute* "programs/CMakeLists.txt" + (("include_directories.*" all) + (string-append + all "find_package(SuiteSparse_config REQUIRED)\n")) + (("(target_link_libraries.*)GKlib(.*)" _ start end) + (string-append + start "GKlib ${SUITESPARSE_CONFIG_LIBRARIES}" end))))))) + ((#:configure-flags _) + #~(list "-DSHARED=ON" + (string-append "-DGKLIB_PATH=" #$gklib-suitesparse))))) + (inputs (list suitesparse-config gklib-suitesparse)))) + (define-public suitesparse (package (name "suitesparse")