summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Elsing <david.elsing@posteo.net>2023-10-05 21:34:54 +0000
committerLudovic Courtès <ludo@gnu.org>2023-10-06 12:26:46 +0200
commit7c5d3592e75cd413eed10949418046a96097ae34 (patch)
treec56dcc88f716126f1a11cfb5dc8305a79b7d894d
parent95ecbdc9b162998c55eb7b355c59fa5205a4373c (diff)
downloadguix-7c5d3592e75cd413eed10949418046a96097ae34.tar.gz
gnu: Add metis-suitesparse.
* gnu/packages/maths.scm (metis-suitesparse): New variable.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--gnu/packages/maths.scm26
1 files changed, 26 insertions, 0 deletions
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index a096b24cfe..e2018d4540 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")