[bug#77552,4/5] gnu: cbqn-bootstrap: Update to 0.9.0.

Message ID 20250405150733.18738-4-lee.p.thomp@gmail.com
State New
Headers
Series gnu: cbqn: Update to 0.9.0. |

Commit Message

Lee Thompson April 5, 2025, 3:07 p.m. UTC
* gnu/packages/bqn.scm (cbqn-bootstrap): Update to 0.9.0. dbqn dependency
removed. Now runs `make for-bootstrap'.

Change-Id: I54c39dbcad7f485b539cf5fc3156829efec4f8c4
---
 gnu/packages/bqn.scm | 77 ++++++++++++++++++++++----------------------
 1 file changed, 38 insertions(+), 39 deletions(-)
  

Comments

Cayetano Santos April 9, 2025, 4:07 p.m. UTC | #1
+ ;; Default behaviour is to extract git hash to use for version
+ ;; string, here our version string is manually substituted in

You exceed maximum column here.

Use ‘./pre-inst-env guix lint PACKAGE’ before submitting to fix this
kind of errors.

+    (license license:gpl3)))

Have you checked "licenses" folder ?

Additionally, none of your sources include a license field. And yet, they are
used in cbqn/bootstrap.This is anomalous to me.
  
Lee Thompson April 9, 2025, 6:02 p.m. UTC | #2
Cayetano Santos <csantosb@inventati.org> writes:

> You exceed maximum column here.
>
> Use ‘./pre-inst-env guix lint PACKAGE’ before submitting to fix this
> kind of errors.
Okay this is my bad, though I am wondering if there's a more ergonomic
way to style/lint packages that aren't defined publicly like this one.
What I find myself doing is changing the `(define cbqn-bootstrap ...' to
`(define-public ...', running `./pre-inst-env guix style
cbqn-bootstrap', then swapping `define-public' back to `define'.  Is
there something I'm missing with this?

> +    (license license:gpl3)))
>
> Have you checked "licenses" folder ?
This paragraph from upstream about licenses:
https://github.com/dzaima/CBQN?tab=readme-ov-file#licensing talks a bit
about the licensing situation for CBQN itself. It seems obvious to me to
list out lgpl3, gpl3 and mpl2, though do you think I'd be better off
listing all the licenses under `licenses' including Boost and Apache
etc?

> Additionally, none of your sources include a license field. And yet, they are
> used in cbqn/bootstrap.This is anomalous to me.
Unless I'm mistaken I don't think there's a way to specify a license for
a plain `origin' like I've used for the `-sources' I've added.  I chose
to add Singeli and REPLXX as just `origin's instead of full packages
taking inspiration from the existing `bqn-sources'.  `bqn-sources'
currently doesn't mention its ISC license at all.

Despite this checking the build output it looks like all the following
still manage to end up in
/gnu/store/...-cbqn-0.9.0/share/doc/cbqn-0.9.0:
> LICENSE-Apache2  LICENSE-Boost  LICENSE-GPLv3  LICENSE-LGPLv3  LICENSE-MIT-sort  LICENSE-MPL2
  
Cayetano Santos April 10, 2025, 7:40 a.m. UTC | #3
>Wed 09 Apr 2025 at 19:02, Lee Thompson <lee.p.thomp@gmail.com> wrote:

> Cayetano Santos <csantosb@inventati.org> writes:
>
>> You exceed maximum column here.
>>
>> Use ‘./pre-inst-env guix lint PACKAGE’ before submitting to fix this
>> kind of errors.

> Okay this is my bad, though I am wondering if there's a more ergonomic
> way to style/lint packages that aren't defined publicly like this one.
> What I find myself doing is changing the `(define cbqn-bootstrap ...' to
> `(define-public ...', running `./pre-inst-env guix style
> cbqn-bootstrap', then swapping `define-public' back to `define'.  Is
> there something I'm missing with this?

In my case, I usually do the same.


>> +    (license license:gpl3)))
>>
>> Have you checked "licenses" folder ?

> This paragraph from upstream about licenses:
> https://github.com/dzaima/CBQN?tab=readme-ov-file#licensing talks a bit
> about the licensing situation for CBQN itself. It seems obvious to me to
> list out lgpl3, gpl3 and mpl2, though do you think I'd be better off
> listing all the licenses under `licenses' including Boost and Apache
> etc?

I think so. You may get inspiration from iverilog and similar packages.

>> Additionally, none of your sources include a license field. And yet, they are
>> used in cbqn/bootstrap.This is anomalous to me.

> Unless I'm mistaken I don't think there's a way to specify a license for
> a plain `origin' like I've used for the `-sources' I've added.  I chose
> to add Singeli and REPLXX as just `origin's instead of full packages
> taking inspiration from the existing `bqn-sources'.  `bqn-sources'
> currently doesn't mention its ISC license at all.

I guess that once the (non-license) source is included in a package, its
license must appear in the package itself.

> Despite this checking the build output it looks like all the following
> still manage to end up in
> /gnu/store/...-cbqn-0.9.0/share/doc/cbqn-0.9.0:

>> LICENSE-Apache2 LICENSE-Boost LICENSE-GPLv3 LICENSE-LGPLv3 LICENSE-MIT-sort LICENSE-MPL2

Yes, the builder detects the licenses folder and assumes all of its
contents as licenses, so it takes them all; they still need to be
mentioned in the package.
  

Patch

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 11a5a48b33..fb153696e6 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -149,47 +149,46 @@  (define singeli-sources
        (base32 "1dzg4gk74lhy6pwvxzhk4zj1qinc83l7i6x6zpvdajdlz5vqvc1m")))))
 
 (define cbqn-bootstrap
-  (let* ((revision "2")
-         (commit "66584ce1491d300746963b8ed17170348b2a03e6"))
-    (package
-      (name "cbqn-bootstrap")
-      (version (git-version "0" revision commit))
-      (source (origin
-                (method git-fetch)
-                (uri (git-reference
-                      (url "https://github.com/dzaima/CBQN")
-                      (commit commit)))
-                (file-name (git-file-name name version))
-                (sha256
-                 (base32
-                  "13gg96aa56b8k08bjvv8i0f5nxrah2sij7g6pg7i21fdv08rd9iv"))))
-      (build-system gnu-build-system)
-      (arguments
-       (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
+  (package
+    (name "cbqn-bootstrap")
+    (version "0.9.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/dzaima/CBQN")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0433hp9lgv6w6mhdz0k1kx2rmxia76yy9i0z7ps4qdk7snf2yr2q"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list
+      #:tests? #f                     ; skipping tests for bootstrap
+      ;; `make for-bootstrap' implicitly disables REPLXX, Singeli
+      #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
+                           ;; Default behaviour is to extract git hash to use for version
+                           ;; string, here our version string is manually substituted in so
+                           ;; git isn't required for building.
+                           (string-append "version=" #$version)
+                           "nogit=1"
+                           "for-bootstrap")
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'configure)
+          (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")))))))
+    (inputs (list libffi))
+    (synopsis "BQN implementation in C")
+    (description "This package provides the reference implementation of
 @uref{https://mlochbaum.github.io/BQN/, BQN}, a programming language inspired
 by APL.")
-      (home-page "https://mlochbaum.github.io/BQN/")
-      (license license:gpl3))))
+    (home-page "https://mlochbaum.github.io/BQN/")
+    (license license:gpl3)))
 
 (define-public cbqn
   (package