From f5405f90cfab06f1c6e6d3ac44b51177e54912e8 Mon Sep 17 00:00:00 2001 From: Lee Thompson Date: Wed, 1 Oct 2025 21:13:05 +0100 Subject: [PATCH] gnu: cbqn: Update to 0.9.0. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/bqn.scm (cbqn): Update to 0.9.0. [source]: Use `cbqn-combined-source' computed origin with appropriate inputs. [arguments]<#:make-flags>: Add “for-build”. <#:phases>: Add `generate-bytecode' phase before `build', add new tests to `check'. [native-inputs]: Remove `dbqn', add `cbqn-bootstrap'. [license]: Add licenses for singeli and replxx to inherited licenses. Change-Id: If58a8cb3e822f497be75d0499c1227e9054d936d Signed-off-by: Liliana Marie Prikler --- gnu/packages/bqn.scm | 62 ++++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm index 64ea3be688c..2f9947507bd 100644 --- a/gnu/packages/bqn.scm +++ b/gnu/packages/bqn.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2022 Christopher Rodriguez ;;; Copyright © 2022 Liliana Marie Prikler +;;; Copyright © 2025 Lee Thompson ;;; ;;; This file is part of GNU Guix. ;;; @@ -246,40 +247,63 @@ by APL.") (inherit cbqn-bootstrap) (name "cbqn") (outputs '("out" "lib")) + (source + (cbqn-combined-source name %cbqn-version + #:cbqn-sources cbqn-sources + #:replxx-sources replxx-sources + #:singeli-sources singeli-sources)) (arguments - (substitute-keyword-arguments (strip-keyword-arguments - (list #:tests?) - (package-arguments cbqn-bootstrap)) + (substitute-keyword-arguments + (strip-keyword-arguments (list #:tests?) + (package-arguments cbqn-bootstrap)) ((#:make-flags flags #~(list)) - #~(cons* "shared-o3" "o3" #$flags)) + #~(cons* "shared-o3" "o3" "for-build" #$flags)) ((#:phases phases #~%standard-phases) #~(modify-phases #$phases + ;; Build bytecode using bootstrap CBQN + (add-before 'build 'generate-bytecode + (lambda* (#:key inputs #:allow-other-keys) + (let* ((self-hosted-source (dirname (search-input-file + inputs + "bqn.bqn")))) + (mkdir-p "build/bytecodeLocal/gen") + (invoke "bqn" "build/bootstrap.bqn" self-hosted-source)))) (replace 'check (lambda* (#:key inputs tests? #:allow-other-keys) (when tests? (system (string-append "./BQN -M 1000 \"" - #+bqn-sources - "/test/this.bqn\"")) + #+bqn-sources "/test/this.bqn\"")) (map (lambda (x) - (system (string-append "./BQN ./test/" x - ".bqn"))) - '("cmp" "equal" "copy" "random")) + (system (string-append "./BQN ./test/" x ".bqn"))) + '("cmp" + "equal" + "copy" + "bitcpy" + "bit" + "mut" + "hash" + "squeezeValid" + "squeezeExact" + "various" + "random" + "joinReuse")) (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")) + (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"))) + "/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 - bqn-sources - libffi)) - (properties - `((tunable? . #t))))) + (native-inputs (list cbqn-bootstrap libffi)) + (inputs (modify-inputs (package-inputs cbqn-bootstrap) + (prepend bqn-sources))) + (license (append (package-license cbqn-bootstrap) + (list license:isc ;Singeli module + license:bsd-3 ;REPLXX module + license:unicode))) + (properties `((tunable? . #t)))))