GNU bug report logs - #56989
[PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package.

Previous Next

Package: guix-patches;

Reported by: Christopher Rodriguez <yewscion <at> gmail.com>

Date: Fri, 5 Aug 2022 02:21:02 UTC

Severity: normal

Tags: patch

Merged with 56990, 56991, 56992, 56993

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Christopher Rodriguez <yewscion <at> gmail.com>
To: 56989 <at> debbugs.gnu.org
Cc: Christopher Rodriguez <yewscion <at> gmail.com>
Subject: [bug#56989] [PATCH v5 5/5] gnu: Add cbqn.
Date: Wed, 10 Aug 2022 13:28:00 -0400
* gnu/packages/bqn.scm: Add cbqn package.
---
 gnu/packages/bqn.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index a87534fcd5..95bc2f2eab 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -169,3 +169,49 @@ (define singeli-sources
       (file-name (git-file-name "singeli-sources" commit))
       (sha256
          (base32 "1rr4l7ijzcg25n2igi1mzya6qllh5wsrf3m5i429rlgwv1fwvfji")))))
+(define-public cbqn
+  (package
+    (inherit cbqn-bootstrap)
+    (name "cbqn")
+    (outputs '("out" "lib"))
+    (arguments
+     (list #:make-flags '(list "shared-o3" "o3n-singeli")
+           #:phases #~(modify-phases %standard-phases
+                        (delete 'configure)
+                        (add-before 'build 'link-singeli
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            (symlink #+singeli-sources "Singeli")))
+                        (add-before 'build 'generate-bytecode
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            (system (string-append #+dbqn
+                                                   "/bin/dbqn ./genRuntime "
+                                                   #+bqn-sources))))
+                        (replace 'check
+                          (lambda* (#:key inputs tests? #:allow-other-keys)
+                            (when tests?
+                              (system (string-append "./BQN -M 1000 \""
+                                                     #+bqn-sources
+                                                     "/test/this.bqn\""))
+                              (map (lambda (x)
+                                     (system (string-append "./BQN ./test/" x
+                                                            ".bqn")))
+                                   '("cmp" "equal" "copy" "random"))
+                              (system "make -C test/ffi"))))
+                        (replace 'install
+                          (lambda* (#:key outputs #:allow-other-keys)
+                            (let* ((bin (string-append (assoc-ref outputs
+                                                                  "out")
+                                                       "/bin"))
+                                   (lib (string-append (assoc-ref outputs
+                                                                  "lib")
+                                                       "/lib")))
+                              (mkdir-p bin)
+                              (copy-recursively "BQN"
+                                                (string-append bin "/bqn"))
+                              (install-file "libcbqn.so" lib)))))))
+    (native-inputs (list dbqn
+                         bqn-sources
+                         singeli-sources
+                         libffi
+                         clang-toolchain
+                         linux-libre-headers))))
-- 
2.37.1





This bug report was last modified 2 years and 263 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.