summaryrefslogtreecommitdiff
path: root/gnu/packages/bqn.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/bqn.scm')
-rw-r--r--gnu/packages/bqn.scm134
1 files changed, 58 insertions, 76 deletions
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index c4e0f39efb..8cce9564a2 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2022 Christopher Rodriguez <yewscion@gmail.com>
+;;; Copyright © 2022 Liliana Marie Prikler <liliana.prikler@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -32,7 +33,6 @@
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages llvm)
#:use-module (gnu packages java)
- #:use-module (gnu packages linux)
#:use-module (gnu packages compression))
(define-public dbqn
@@ -54,7 +54,6 @@
(arguments
(list
#:imported-modules `(,@%gnu-build-system-modules
- (guix build syscalls)
(guix build ant-build-system))
#:modules `((guix build gnu-build-system)
((guix build ant-build-system)
@@ -92,9 +91,8 @@
(dest-jar (string-append out "/share/java")))
(mkdir-p dest-bin)
(mkdir-p dest-jar)
- (copy-recursively "BQN"
- (string-append dest-bin
- "/dbqn"))
+ (rename-file "BQN" "dbqn")
+ (install-file "dbqn" dest-bin)
(install-file "BQN.jar" dest-jar)
(substitute* (string-append dest-bin "/dbqn")
(("BQN.jar")
@@ -114,7 +112,7 @@ the same author.")
;; Aside from dbqn above, the main bqn repository is used by other
;; implementations as a "known good" set of sources. CBQN uses dbqn to
;; generate an intermediate bytecode for its own compilation.
- (let ((commit "e219af48401473a7bac49bdd8b89d69082cf5dd8"))
+ (let ((commit "71ce36141aaacfa714edca2e408ca522a3bc5554"))
(origin
(method git-fetch)
(uri (git-reference
@@ -122,14 +120,14 @@ the same author.")
(commit commit)))
(file-name (git-file-name "bqn-sources" commit))
(sha256
- (base32 "0r6pa9lscl2395g4xlvmg90vpdsjzhin4f1r0s7brymmpvmns2yc")))))
+ (base32 "060a3r5m7hynzxj4iz1av2kj5jf8w3j8yswzzx9wkx31rdrsiv2c")))))
(define cbqn-bootstrap
- (let* ((revision "1")
- (commit "9c1cbdc99863b1da0116df61cd832137b196dc5c"))
+ (let* ((revision "2")
+ (commit "66584ce1491d300746963b8ed17170348b2a03e6"))
(package
(name "cbqn-bootstrap")
- (version (git-version "0" "1" commit))
+ (version (git-version "0" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
@@ -138,25 +136,27 @@ the same author.")
(file-name (git-file-name name version))
(sha256
(base32
- "0w38fhwf20drkyijy6nfnhmc5g5gw0zmzgmy1q605x57znlj85a2"))))
+ "13gg96aa56b8k08bjvv8i0f5nxrah2sij7g6pg7i21fdv08rd9iv"))))
(build-system gnu-build-system)
(arguments
- (list #:tests? #f ;skipping tests for bootstrap
- #:phases #~(modify-phases %standard-phases
- (delete 'configure)
- (add-before 'build 'generate-bytecode
- (lambda* (#:key inputs #:allow-other-keys)
- (system (string-append #+dbqn
- "/bin/dbqn ./genRuntime "
- #+bqn-sources))))
- (replace 'install
- (lambda* (#:key outputs #:allow-other-keys)
- (mkdir-p (string-append #$output "/bin"))
- (chmod "BQN" #o755)
- (copy-recursively "BQN"
- (string-append #$output
- "/bin/bqn")))))))
- (native-inputs (list dbqn clang-toolchain bqn-sources))
+ (list
+ #:tests? #f ; skipping tests for bootstrap
+ #:make-flags #~(list (string-append "CC=" #$(cc-for-target)))
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-before 'build 'generate-bytecode
+ (lambda* (#:key inputs #:allow-other-keys)
+ (system (string-append #+dbqn
+ "/bin/dbqn ./genRuntime "
+ #+bqn-sources))))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (mkdir-p (string-append #$output "/bin"))
+ (chmod "BQN" #o755)
+ (rename-file "BQN" "bqn")
+ (install-file "bqn" (string-append #$output "/bin")))))))
+ (native-inputs (list dbqn bqn-sources))
(inputs (list icedtea-8 libffi))
(synopsis "BQN implementation in C")
(description "This package provides the reference implementation of
@@ -165,60 +165,42 @@ by APL.")
(home-page "https://mlochbaum.github.io/BQN/")
(license license:gpl3))))
-(define singeli-sources
- (let ((commit "fd17b144483549dbd2bcf23e3a37a09219171a99"))
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/mlochbaum/Singeli")
- (commit commit)))
- (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)))))))
+ (substitute-keyword-arguments (strip-keyword-arguments
+ (list #:tests?)
+ (package-arguments cbqn-bootstrap))
+ ((#:make-flags flags #~(list))
+ #~(cons* "shared-o3" "o3" #$flags))
+ ((#:phases phases #~%standard-phases)
+ #~(modify-phases #$phases
+ (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)
+ (rename-file "BQN" "bqn")
+ (install-file "bqn" bin)
+ (install-file "libcbqn.so" lib))))))))
(native-inputs (list dbqn
bqn-sources
- singeli-sources
- libffi
- clang-toolchain
- linux-libre-headers))))
+ libffi))
+ (properties
+ `((tunable? . #t)))))