summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichal Atlas <michal_atlas+git@posteo.net>2024-01-28 17:15:09 +0100
committerGuillaume Le Vaillant <glv@posteo.net>2024-01-28 17:15:34 +0100
commiteea35c32ddc35b0f8d97909dcae6b4c63b195a27 (patch)
treeaae5473eb7239e3f7c9a0922e1f6c45ea748e409
parent9d70cb8c9afdc42c17f68a321ce7f39054881b48 (diff)
downloadguix-eea35c32ddc35b0f8d97909dcae6b4c63b195a27.tar.gz
gnu: Add cl-qvm.
* gnu/packages/quantum.scm (cl-qvm, sbcl-qvm): New variables.

Signed-off-by: Guillaume Le Vaillant <glv@posteo.net>
Change-Id: I1958fedab600df490f99961648cca49367ea29a6
-rw-r--r--gnu/packages/quantum.scm65
1 files changed, 65 insertions, 0 deletions
diff --git a/gnu/packages/quantum.scm b/gnu/packages/quantum.scm
index 9877528418..ed96a32464 100644
--- a/gnu/packages/quantum.scm
+++ b/gnu/packages/quantum.scm
@@ -113,3 +113,68 @@ standard gates and instructions")
 
 (define-public cl-quil
   (sbcl-package->cl-source-package sbcl-cl-quil))
+
+(define-public sbcl-qvm
+  (package
+    (name "sbcl-qvm")
+    (version "1.17.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/quil-lang/qvm")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name "cl-qvm" version))
+       (sha256
+        (base32 "1cvmkqfcy7rv5jlim4kh4dvqhd3jk6mw1kwrphaqghjymrf72yp8"))))
+    (build-system asdf-build-system/sbcl)
+    (outputs '("out" "bin"))
+    (inputs
+     (list sbcl-abstract-classes
+           sbcl-alexandria
+           sbcl-cffi
+           sbcl-cl-quil
+           sbcl-global-vars
+           sbcl-ieee-floats
+           sbcl-lparallel
+           sbcl-magicl
+           sbcl-mt19937
+           sbcl-static-vectors
+           sbcl-trivial-features
+           sbcl-trivial-garbage
+
+           ;; qvm-app
+           sbcl-cl-syslog
+           sbcl-command-line-arguments
+           sbcl-hunchentoot
+           sbcl-slime-swank
+           sbcl-trivial-benchmark))
+    (arguments
+     (list
+      #:asd-systems ''("qvm" "qvm-app")
+      #:tests? #f
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'remove-git-dependency
+            (lambda _
+              (substitute* "app/src/qvm-app-version.lisp"
+                (("\\(git-hash '#:qvm-app\\)")
+                 "\"unknown\""))))
+          (add-after 'create-asdf-configuration 'build-program
+            (lambda* (#:key outputs #:allow-other-keys)
+              (build-program (string-append (assoc-ref outputs "bin")
+                                            "/bin/qvm")
+                             outputs
+                             #:dependencies '("qvm-app")
+                             #:entry-program '((qvm-app::asdf-entry-point))
+                             #:compress? #t))))))
+    (synopsis "Quil simulator")
+    (description
+     "This is the official Quil-Lang Quantum Virtual Machine (QVM),
+a flexible and efficient simulator for Quil.")
+    (home-page "https://github.com/quil-lang/qvm")
+    (license (list license:asl2.0
+                   license:agpl3))))
+
+(define-public cl-qvm
+  (sbcl-package->cl-source-package sbcl-qvm))