diff mbox series

[bug#66129,v3,13/20] gnu: Add suitesparse-cxsparse.

Message ID 05737981063c3d219e7b84555902122981f6440c.1696541452.git.david.elsing@posteo.net
State New
Headers show
Series [bug#66129,v3,01/20] gnu: suitesparse: Tweak description. | expand

Commit Message

David Elsing Oct. 5, 2023, 9:34 p.m. UTC
* gnu/packages/maths.scm (suitesparse-cxsparse): New variable.
---
 gnu/packages/maths.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index ad08f36931..b2da54239f 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -5533,6 +5533,40 @@  (define-public suitesparse-cholmod
 and other related operations.")
     (license (list license:gpl2+ license:lgpl2.1+))))
 
+(define-public suitesparse-cxsparse
+  (package
+    (name "suitesparse-cxsparse")
+    (version "4.2.0")
+    (source suitesparse-source)
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:tests? #f
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'chdir
+            (lambda _
+              (chdir "CXSparse")))
+          (add-after 'chdir 'set-cmake-module-path
+            (lambda _
+              (substitute* "CMakeLists.txt"
+                (("set.*CMAKE_MODULE_PATH.*")
+                 (string-append "set(CMAKE_MODULE_PATH "
+                                #$suitesparse-config "/lib/cmake/SuiteSparse)\n"
+                                "set(DUMMY\n")))))
+          (replace 'install-license-files
+            (lambda _
+              (let ((out (string-append #$output
+                                        "/share/doc/" #$name "-" #$version)))
+                (install-file "../CXSparse/Doc/License.txt" out)
+                (install-file "../CXSparse/Doc/lesser.txt" out)))))))
+    (inputs (list suitesparse-config))
+    (home-page "https://people.engr.tamu.edu/davis/suitesparse.html")
+    (synopsis "Concise eXtended Sparse Matrix Package")
+    (description "CXSparse is a collection of sparse matrix algorithms for
+direct methods on both real and complex matrices.")
+    (license license:lgpl2.1+)))
+
 (define-public suitesparse
   (package
     (name "suitesparse")