gnu: Add metis-suitesparse.

* gnu/packages/maths.scm (metis-suitesparse): New variable.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
David Elsing 2023-10-05 21:34:54 +00:00 committed by Ludovic Courtès
parent 95ecbdc9b1
commit 7c5d3592e7
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -5422,6 +5422,32 @@ (define-public gklib-suitesparse
(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")