Subject: [PATCH v2 2/2] gnu: Add scasp.

From: Liliana Marie Prikler <[email-masked]>
Date: Sat, 3 Dec 2022 10:18:26 +0100

* gnu/packages/maths.scm (scasp): New variable.
---
 gnu/packages/maths.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index a7497f1d2f..238352f278 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -89,6 +89,7 @@ (define-module (gnu packages maths)
   #:use-module ((guix build utils) #:select (alist-replace))
   #:use-module (guix build-system ant)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
@@ -153,6 +154,7 @@ (define-module (gnu packages maths)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages popt)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages prolog)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
@@ -2804,6 +2806,41 @@ (define-public python-telingo
 logic programs based on clingo.")
     (license license:expat)))
 
+(define-public scasp
+  (let ((commit "89a427aa04ec6346425a40111c99b310901ffe51")
+        (revision "1"))
+    (package
+      (name "scasp")
+      (version (git-version "0.21.11.26" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/SWI-Prolog/sCASP")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1ijqv9xr3imrdmz6nq7zqwsmmaxn638icig19m8900m7mjfpizs4"))))
+      (build-system copy-build-system)
+      (arguments
+       (list
+        #:install-plan #~`(("scasp" "bin/")
+                           ("prolog" "lib/swipl/library"))
+        #:modules `((guix build copy-build-system)
+                    ((guix build gnu-build-system) #:prefix gnu:)
+                    (guix build utils)
+                    (ice-9 regex))
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-before 'install 'build (assoc-ref gnu:%standard-phases 'build))
+            (add-after 'build 'check (assoc-ref gnu:%standard-phases 'check)))))
+      (native-inputs (list swi-prolog))
+      (home-page "https://github.com/SWI-Prolog/sCASP")
+      (synopsis "Interpreter for ASP programs with constraints")
+      (description "@code{s(CASP)} is a top-down interpreter for ASP programs
+with constraints.")
+      (license license:asl2.0))))
+
 (define-public ceres
   (package
     (name "ceres-solver")
-- 
2.39.1