diff mbox series

[bug#69023,5/5] gnu: bqn: Update cbqn.

Message ID 49846553277b9a80f952daf89c4059ddfa5a0d49.1707607099.git.aecepoglu@fastmail.fm
State New
Headers show
Series gnu: package: Update cbqn. | expand

Commit Message

aecepoglu Feb. 10, 2024, 11:28 p.m. UTC
* 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(-)

Comments

aecepoglu March 31, 2024, 4:22 a.m. UTC | #1
Can we get this reviewed please? The extra FFI capabilities it brings is critical in developing more libraries in BQN.

On Sat, 10 Feb 2024, at 11:28 PM, aecepoglu wrote:
> * 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 6d3ec43a0f..66c70a8516 100644
> --- a/gnu/packages/bqn.scm
> +++ b/gnu/packages/bqn.scm
> @@ -209,9 +209,16 @@ (define-public cbqn
>                                      (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 @@ (define-public cbqn
>                                           #+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)))))
> -- 
> 2.43.0
Liliana Marie Prikler April 19, 2024, 6:47 p.m. UTC | #2
Am Samstag, dem 10.02.2024 um 23:28 +0000 schrieb aecepoglu:
> * gnu/packages/bqn.scm (cbqn): Update cbqn.
> Update version.
> Override 'generate-bytecode to rely on cbqn-bootstrap instead of
> dbqn.
> 
> Change-Id: I1660d218960e7395f4c10983d840e3fa4b451d14
Due to inheritance, I think this change might be merged with the one
before.

I don't see anything grossly weird atm, but I only glanced over this
patch, given that the rest of the series also needs some help.

Cheers
diff mbox series

Patch

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 6d3ec43a0f..66c70a8516 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -209,9 +209,16 @@  (define-public cbqn
                                     (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 @@  (define-public cbqn
                                          #+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)))))