From 626e89c5dcb8c035762dc92bef4ba978efc30d0f Mon Sep 17 00:00:00 2001 From: aecepoglu Date: Tue, 30 Apr 2024 01:50:34 +0100 Subject: gnu: bqn: Update cbqn. * gnu/packages/bqn.scm (cbqn): Update cbqn. Update version. Override 'generate-bytecode to rely on cbqn-bootstrap instead of dbqn. Change-Id: I1660d218960e7395f4c10983d840e3fa4b451d14 --- gnu/packages/bqn.scm | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm index aca30f38b7..23c5253046 100644 --- a/gnu/packages/bqn.scm +++ b/gnu/packages/bqn.scm @@ -209,9 +209,16 @@ by APL.") (list #:tests?) (package-arguments cbqn-bootstrap)) ((#:make-flags flags #~(list)) - #~(cons* "shared-o3" "o3" #$flags)) + #~(append #$flags '("shared-o3" "o3"))) ((#:phases phases #~%standard-phases) #~(modify-phases #$phases + (replace 'generate-bytecode + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (mkdir-p (string-append "./build/bytecodeLocal/gen")) + (system (string-append #+cbqn-bootstrap + "/bin/bqn ./build/genRuntime " + #+bqn-sources " ./build/bytecodeLocal"))))) (replace 'check (lambda* (#:key inputs tests? #:allow-other-keys) (when tests? @@ -219,25 +226,21 @@ by APL.") #+bqn-sources "/test/this.bqn\"")) (map (lambda (x) - (system (string-append "./BQN ./test/" x - ".bqn"))) + (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")) - (include (string-append (assoc-ref outputs "lib") - "/include"))) - (mkdir-p bin) - (rename-file "BQN" "bqn") - (install-file "bqn" bin) - (install-file "libcbqn.so" lib) - (install-file "include/bqnffi.h" include)))))))) - (native-inputs (list dbqn + (add-after 'install 'install-lib-stuff + (lambda* (#:key outputs #:allow-other-keys) + (let* ((lib (string-append (assoc-ref outputs "lib") + "/lib")) + (include (string-append (assoc-ref outputs "lib") + "/include"))) + (install-file "libcbqn.so" lib) + (install-file "include/bqnffi.h" include)))))))) + (native-inputs (list cbqn-bootstrap + singeli bqn-sources libffi)) + (inputs (list libffi)) (properties `((tunable? . #t))))) -- cgit v1.2.3