[bug#74723,14/19] gnu: Add exprtk.

Message ID 01bbcbd48a990be71ed46b21d2244c5ed4102152.1733563475.git.sughosha@disroot.org
State New
Headers
Series gnu: lmms, carla: New features, fixes and updates. |

Commit Message

Sughosha Dec. 7, 2024, 12:20 p.m. UTC
  * gnu/packages/maths.scm (exprtk): New variable.

Change-Id: I14bd7c26d111f399b5a3624456f43b3fe7dacd40
---
 gnu/packages/maths.scm | 53 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
  

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 9257a8adb7..e3638794ad 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -67,6 +67,7 @@ 
 ;;; Copyright © 2024 Foundation Devices, Inc. <hello@foundation.xyz>
 ;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
 ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2024 Sughosha <sughosha@disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -8079,6 +8080,58 @@  (define-public elemental
 reduction.")
       (license license:bsd-2))))
 
+(define-public exprtk
+  (let ((commit "7b993904a21639304edd4db261f6e2cdcf6d936b") ;no tags
+        (revision "0"))
+    (package
+      (name "exprtk")
+      (version (git-version "0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/ArashPartow/exprtk")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0rza8lmn4mbdbrdj1aqir37nk8z034cqwr2s1ypyqgflckirwzdp"))
+                (modules '((guix build utils)))
+                (snippet
+                 ;; Prevent linking to /usr/lib.
+                 '(substitute* "Makefile"
+                    (("-L/usr/lib") "")))))
+      (build-system gnu-build-system)
+      (arguments
+       (list #:phases
+             #~(modify-phases %standard-phases
+                 (delete 'configure) ;no configure script
+                 (replace 'check
+                   (lambda* (#:key tests? #:allow-other-keys)
+                     (when tests?
+                       (invoke "./exprtk_test"))))
+                 (replace 'install
+                   (lambda _
+                     ;; Install executable binaries excluding that of testing.
+                     (for-each (lambda (file)
+                                 (when (and (executable-file? file)
+                                            (not (string=? "exprtk_test"
+                                                           (basename file))))
+                                   (install-file file
+                                                 (string-append #$output
+                                                                "/bin"))))
+                      (find-files "."))
+                     ;; Install header.
+                     (install-file "exprtk.hpp"
+                                   (string-append #$output "/include")))))))
+      (home-page "https://github.com/ArashPartow/exprtk")
+      (synopsis "C++ mathematical expression parsing and evaluation library")
+      (description
+       "C++ Mathematical Expression Toolkit Library (ExprTk) is a run-time
+mathematical expression parsing and evaluation engine.  The parsing engine
+supports numerous forms of functional and  logic processing semantics and is
+easily extensible.")
+      (license license:expat))))
+
 (define-public mcrl2
   (package
     (name "mcrl2")