GNU bug report logs - #56993
[PATCH v1 5/5] gnu: bqn: Add cbqn.

Previous Next

Package: guix-patches;

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

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

Severity: normal

Tags: patch

Merged with 56989, 56990, 56991, 56992

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

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Rodriguez <yewscion <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Christopher Rodriguez <yewscion <at> gmail.com>
Subject: [PATCH v1 5/5] gnu: bqn: Add cbqn.
Date: Thu,  4 Aug 2022 22:20:23 -0400
---
 gnu/packages/bqn.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 3616067d87..cebf3acd13 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -206,3 +206,55 @@ (define singeli-bootstrap
       there are no plans to target GPUs.")
       (home-page "https://github.com/mlochbaum/Singeli")
       (license license:isc))))
+(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 (string-append #$(this-package-input
+                                                       "singeli-bootstrap")
+                                                    "/share/singeli")
+                                     "Singeli")))
+                        (add-before 'build 'generate-bytecode
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            (system (string-append #$(this-package-native-input
+                                                      "dbqn")
+                                                   "/bin/dbqn ./genRuntime "
+                                                   #$(this-package-input
+                                                      "bqn-bytecode-sources")
+                                                   "/share/"))))
+                        (replace 'check
+                          (lambda* (#:key inputs tests? #:allow-other-keys)
+                            (when tests?
+                              (map (lambda (x)
+                                     (system (string-append "./test/" x ".sh "
+                                                            #$(this-package-input
+                                                               "bqn-bytecode-sources")
+                                                            "/share/")))
+                                   '("mainCfgs" "x86Cfgs" "moreCfgs"))
+                              (map (lambda (x)
+                                     (system (string-append "./BQN ./test/" x
+                                                            ".bqn")))
+                                   '("cmp" "equal" "copy" "bitcpy" "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)
+                              (mkdir-p lib)
+                              (chmod "BQN" 493)
+                              (copy-recursively "BQN"
+                                                (string-append bin "/bqn"))
+                              (install-file "libcbqn.so" lib)))))))
+    (inputs (list bqn-bytecode-sources libffi singeli-bootstrap))))
-- 
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.