all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package.
@ 2022-08-05  2:20 Christopher Rodriguez
  2022-08-05  2:20 ` [bug#56990] [PATCH v1 2/5] gnu: bqn: Add bqn-bytecode-sources Christopher Rodriguez
                   ` (9 more replies)
  0 siblings, 10 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-05  2:20 UTC (permalink / raw)
  To: 56989; +Cc: Christopher Rodriguez

Hello all,

This is a set of patches to add CBQN (and the packages required to build it
from source) to the official Guix repository.

CBQN is the recommended implementation of the BQN language, which is a new
array programming language in the same vein as APL, K, Q, J, Dyalog APL,
etc. Even better than most of those, it carries a FSDG compatible license
(the implementation is even under single-license GPL!) and so I feel as
though it should definitely be a part of GNU Guix.

While there are still a few outstanding issues I hope to address with those
upstream eventually (all documented in the comments), I believe I have
followed the guidelines in the manual. Please let me know what I can improve,
and how I might expedite this awesome language's inclusion in GNU Guix.

---
 gnu/packages/bqn.scm | 92 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 92 insertions(+)
 create mode 100644 gnu/packages/bqn.scm

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
new file mode 100644
index 0000000000..53e2f0a057
--- /dev/null
+++ b/gnu/packages/bqn.scm
@@ -0,0 +1,92 @@
+(define-module (gnu packages bqn)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix gexp)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system copy)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix utils)
+  #:use-module (guix deprecation)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages libffi)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages llvm)
+  #:use-module (gnu packages java))
+
+;; Currently this package is non-deterministic due to random generation in
+;; some of the primitives. This is marked as a TODO in the source code, but
+;; per the maintainer this package almost solely exists for the purpose of
+;; building CBQN at this point, and therefore is not a high priority. Git
+;; reports this here:
+;;
+;; src/BQN/types/callable/builtins/fns/EpsBuiltin.java:45:71:
+;; …<snip> // TODO these (and in ⊐) shouldn't be random numbers
+;;
+;; Reported Upstream Here: https://github.com/dzaima/BQN/issues/14
+;;
+;; This issue therefore means that none of the packages for bqn can be checked
+;; for non-determinism at this time, as dbqn is a prerequisite for all of
+;; them.
+(define-public dbqn
+  (let* ((tag "0.2.1")
+         (revision "1")
+         (commit "0bbe096fc07d278b679a8479318f1722d096a03e")
+         (hash "1kxzxz2hrd1871281s4rsi569qk314aqfmng9pkqn8gv9nqhmph0")
+         (version (git-version tag revision commit)))
+    (package
+      (name "dbqn")
+      (version version)
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/dzaima/BQN")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  hash))))
+      (outputs '("out"))
+      (build-system gnu-build-system)
+      (arguments
+       (list #:tests? #f ;While there is a "test" directory, there is no
+             ;; mechanism to run the tests other than to feed the files into the
+             ;; binary and check for an error. This is outside the scope of a
+             ;; packaging workflow, and would need to be fixed upstream
+             ;; instead. Issue Reported: https://github.com/dzaima/BQN/issues/12
+             ;; Maintainer says many of the tests fail, and so they will remain off
+             ;; until this is sorted out.
+             #:phases #~(modify-phases %standard-phases
+                          (delete 'configure)
+                          (replace 'build
+                            (lambda* _
+                              (invoke "./build")))
+                          (replace 'install
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (let* ((out (assoc-ref outputs "out"))
+                                     (dest-bin (string-append out "/bin"))
+                                     (dest-jar (string-append out
+                                                              "/share/java")))
+                                (mkdir-p dest-bin)
+                                (mkdir-p dest-jar)
+                                (copy-recursively "BQN"
+                                                  (string-append dest-bin
+                                                                 "/dbqn"))
+                                (chmod (string-append dest-bin "/dbqn") 493)
+                                (install-file "BQN.jar" dest-jar))))
+                          (add-after 'install 'subjars
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (let* ((out (assoc-ref outputs "out"))
+                                     (dest-bin (string-append out "/bin"))
+                                     (dest-jar (string-append out
+                                                              "/share/java")))
+                                (substitute* (string-append dest-bin "/dbqn")
+                                  (("BQN.jar")
+                                   (string-append dest-jar "/BQN.jar")))))))))
+      (native-inputs (list `(,openjdk17 "jdk")
+                           coreutils))
+      (synopsis "BQN implementation based on dzaima/APL")
+      (description "BQN implementation based on dzaima/APL.")
+      (home-page "https://github.com/dzaima/BQN")
+      (license license:expat))))

base-commit: 116c0268ffd387c88b6b47135203fb330eb422f0
-- 
2.37.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#56990] [PATCH v1 2/5] gnu: bqn: Add bqn-bytecode-sources.
  2022-08-05  2:20 [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
@ 2022-08-05  2:20 ` Christopher Rodriguez
  2022-08-05  2:20 ` [bug#56992] [PATCH v1 3/5] gnu: bqn: Add cbqn-bootstrap Christopher Rodriguez
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-05  2:20 UTC (permalink / raw)
  To: 56990; +Cc: Christopher Rodriguez

---
 gnu/packages/bqn.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 53e2f0a057..221ed9eaaa 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -90,3 +90,38 @@ (define-public dbqn
       (description "BQN implementation based on dzaima/APL.")
       (home-page "https://github.com/dzaima/BQN")
       (license license:expat))))
+(define bqn-bytecode-sources
+  (let* ((tag "0")
+         (revision "1")
+         (commit "e219af48401473a7bac49bdd8b89d69082cf5dd8")
+         (hash "0r6pa9lscl2395g4xlvmg90vpdsjzhin4f1r0s7brymmpvmns2yc")
+         (version (git-version tag revision commit)))
+    (package
+      (name "bqn-bytecode-sources")
+      (version version)
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/mlochbaum/BQN")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  hash))))
+      (outputs '("out"))
+      (build-system copy-build-system) ;This package pulls down needed source
+      ;; files for CBQN's build process. They
+      ;; will be compiled during that build;
+      ;; none of them are prebuilt binaries.
+      (arguments
+       (list #:install-plan '(list (list "src/" "share/src"
+                                         #:exclude '("README.txt" "doc/"))
+                                   (list "test/" "share/test"
+                                         #:exclude '("README.txt")))))
+      (synopsis "Official BQN sources in BQN")
+      (description
+       "The collection of sources needed for building a
+BQN-based BQN implementation.  These are included here for bootstrapping
+purposes.")
+      (home-page "https://github.com/mlochbaum/BQN.git")
+      (license license:gpl3))))
-- 
2.37.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#56992] [PATCH v1 3/5] gnu: bqn: Add cbqn-bootstrap.
  2022-08-05  2:20 [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
  2022-08-05  2:20 ` [bug#56990] [PATCH v1 2/5] gnu: bqn: Add bqn-bytecode-sources Christopher Rodriguez
@ 2022-08-05  2:20 ` Christopher Rodriguez
  2022-08-05  2:20 ` [bug#56991] [PATCH v1 4/5] gnu: bqn: Add singeli-bootstrap Christopher Rodriguez
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-05  2:20 UTC (permalink / raw)
  To: 56992; +Cc: Christopher Rodriguez

---
 gnu/packages/bqn.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 221ed9eaaa..0e26706476 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -125,3 +125,49 @@ (define bqn-bytecode-sources
 purposes.")
       (home-page "https://github.com/mlochbaum/BQN.git")
       (license license:gpl3))))
+(define cbqn-bootstrap
+  (let* ((tag "0")
+         (revision "1")
+         (commit "88f65850fa6ac28bc50886c5942652f21d5be924")
+         (hash "0bqwpvzwp2v20k2l725cwxx4fkvisniw9nls3685wd0fa3agpb47")
+         (version (git-version tag revision commit)))
+    (package
+      (name "cbqn-bootstrap")
+      (version version)
+      (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
+                  hash))))
+      (build-system gnu-build-system)
+      (outputs '("out"))
+      (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 #$(this-package-native-input
+                                                        "dbqn")
+                                       "/bin/dbqn ./genRuntime "
+                                       #$(this-package-input
+                                          "bqn-bytecode-sources") "/share/"))))
+                          (replace 'install
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (mkdir-p (string-append #$output "/bin"))
+                              (chmod "BQN" 493)
+                              (copy-recursively "BQN"
+                                                (string-append #$output
+                                                               "/bin/bqn")))))))
+      (native-inputs (list dbqn openjdk17 clang-toolchain))
+      (inputs (list bqn-bytecode-sources libffi))
+      (synopsis "BQN implementation in C")
+      (description
+       "The expected implementation for the BQN language,
+according to the official documentation of that specification.")
+      (home-page "https://mlochbaum.github.io/BQN/")
+      (license license:gpl3))))
-- 
2.37.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#56991] [PATCH v1 4/5] gnu: bqn: Add singeli-bootstrap.
  2022-08-05  2:20 [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
  2022-08-05  2:20 ` [bug#56990] [PATCH v1 2/5] gnu: bqn: Add bqn-bytecode-sources Christopher Rodriguez
  2022-08-05  2:20 ` [bug#56992] [PATCH v1 3/5] gnu: bqn: Add cbqn-bootstrap Christopher Rodriguez
@ 2022-08-05  2:20 ` Christopher Rodriguez
  2022-08-05  2:20 ` [bug#56993] [PATCH v1 5/5] gnu: bqn: Add cbqn Christopher Rodriguez
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-05  2:20 UTC (permalink / raw)
  To: 56991; +Cc: Christopher Rodriguez

---
 gnu/packages/bqn.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 0e26706476..3616067d87 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -171,3 +171,38 @@ (define cbqn-bootstrap
 according to the official documentation of that specification.")
       (home-page "https://mlochbaum.github.io/BQN/")
       (license license:gpl3))))
+(define singeli-bootstrap
+  (let* ((tag "0")
+         (revision "1")
+         (commit "fd17b144483549dbd2bcf23e3a37a09219171a99")
+         (hash "1rr4l7ijzcg25n2igi1mzya6qllh5wsrf3m5i429rlgwv1fwvfji")
+         (version (git-version tag revision commit)))
+    (package
+      (name "singeli-bootstrap")
+      (version version)
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/mlochbaum/Singeli")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  hash))))
+      (outputs '("out"))
+      (build-system copy-build-system)
+      (arguments
+       (list
+             ;; cbqn needs the layout of singeli to stay the same for its tests.
+             #:install-plan '(list (list "./" "share/singeli"))))
+      (native-inputs (list cbqn-bootstrap))
+      (synopsis "High-level interface for low-level programming")
+      (description
+       "Singeli is a domain-specific language for building SIMD
+      algorithms with flexible abstractions and control over every instruction
+      emitted. It's implemented in BQN, with a frontend that emits IR and a
+      backend that converts it to C. Other backends like LLVM or machine code
+      are possible—it should be easy to support other CPU architectures but
+      there are no plans to target GPUs.")
+      (home-page "https://github.com/mlochbaum/Singeli")
+      (license license:isc))))
-- 
2.37.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#56993] [PATCH v1 5/5] gnu: bqn: Add cbqn.
  2022-08-05  2:20 [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
                   ` (2 preceding siblings ...)
  2022-08-05  2:20 ` [bug#56991] [PATCH v1 4/5] gnu: bqn: Add singeli-bootstrap Christopher Rodriguez
@ 2022-08-05  2:20 ` Christopher Rodriguez
  2022-08-05  5:46 ` [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-05  2:20 UTC (permalink / raw)
  To: 56993; +Cc: Christopher Rodriguez

---
 gnu/packages/bqn.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 3616067d87..cebf3acd13 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -206,3 +206,55 @@ (define singeli-bootstrap
       there are no plans to target GPUs.")
       (home-page "https://github.com/mlochbaum/Singeli")
       (license license:isc))))
+(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 (string-append #$(this-package-input
+                                                       "singeli-bootstrap")
+                                                    "/share/singeli")
+                                     "Singeli")))
+                        (add-before 'build 'generate-bytecode
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            (system (string-append #$(this-package-native-input
+                                                      "dbqn")
+                                                   "/bin/dbqn ./genRuntime "
+                                                   #$(this-package-input
+                                                      "bqn-bytecode-sources")
+                                                   "/share/"))))
+                        (replace 'check
+                          (lambda* (#:key inputs tests? #:allow-other-keys)
+                            (when tests?
+                              (map (lambda (x)
+                                     (system (string-append "./test/" x ".sh "
+                                                            #$(this-package-input
+                                                               "bqn-bytecode-sources")
+                                                            "/share/")))
+                                   '("mainCfgs" "x86Cfgs" "moreCfgs"))
+                              (map (lambda (x)
+                                     (system (string-append "./BQN ./test/" x
+                                                            ".bqn")))
+                                   '("cmp" "equal" "copy" "bitcpy" "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)
+                              (mkdir-p lib)
+                              (chmod "BQN" 493)
+                              (copy-recursively "BQN"
+                                                (string-append bin "/bqn"))
+                              (install-file "libcbqn.so" lib)))))))
+    (inputs (list bqn-bytecode-sources libffi singeli-bootstrap))))
-- 
2.37.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package.
  2022-08-05  2:20 [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
                   ` (3 preceding siblings ...)
  2022-08-05  2:20 ` [bug#56993] [PATCH v1 5/5] gnu: bqn: Add cbqn Christopher Rodriguez
@ 2022-08-05  5:46 ` Christopher Rodriguez
  2022-08-05  7:15   ` Liliana Marie Prikler
  2022-08-06  2:20 ` [bug#56989] [PATCH v3] gnu: Add dbqn Christopher Rodriguez
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-05  5:46 UTC (permalink / raw)
  To: 56989; +Cc: Christopher Rodriguez

Thanks to some help from upstream and on IRC (thanks, dzaima and lilyp!) I
was able to remove the non-determinism issue. Here's an updated patch.

---
 gnu/packages/bqn.scm | 102 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 102 insertions(+)
 create mode 100644 gnu/packages/bqn.scm

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
new file mode 100644
index 0000000000..261f29ece5
--- /dev/null
+++ b/gnu/packages/bqn.scm
@@ -0,0 +1,102 @@
+(define-module (gnu packages bqn)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix gexp)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system copy)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix utils)
+  #:use-module (guix deprecation)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages libffi)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages llvm)
+  #:use-module (gnu packages java)
+  #:use-module (gnu packages compression))
+(define-public dbqn
+  (let* ((tag "0.2.1")
+         (revision "1")
+         (commit "0bbe096fc07d278b679a8479318f1722d096a03e")
+         (hash "1kxzxz2hrd1871281s4rsi569qk314aqfmng9pkqn8gv9nqhmph0")
+         (version (git-version tag revision commit)))
+    (package
+      (name "dbqn")
+      (version version)
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/dzaima/BQN")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  hash))))
+      (outputs '("out"))
+      (build-system gnu-build-system)
+      (arguments
+       (list #:tests? #f ;While there is a "test" directory, there is no
+             ;; mechanism to run the tests other than to feed the files into the
+             ;; binary and check for an error. This is outside the scope of a
+             ;; packaging workflow, and would need to be fixed upstream
+             ;; instead. Issue Reported: https://github.com/dzaima/BQN/issues/12
+             ;; Maintainer says many of the tests fail, and so they will remain off
+             ;; until this is sorted out.
+             #: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)
+                          #:prefix ant:)
+                         (guix build utils))
+             #:phases #~(modify-phases %standard-phases
+                          (delete 'configure)
+                          (replace 'build
+                            (lambda* _
+                              (invoke "./build")))
+                          (add-after 'build 'strip-jar-timestamps
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (write %standard-phases)))
+                          (replace 'install
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (let* ((out (assoc-ref outputs "out"))
+                                     (dest-bin (string-append out "/bin"))
+                                     (dest-jar (string-append out
+                                                              "/share/java")))
+                                (mkdir-p dest-bin)
+                                (mkdir-p dest-jar)
+                                (copy-recursively "BQN"
+                                                  (string-append dest-bin
+                                                                 "/dbqn"))
+                                (chmod (string-append dest-bin "/dbqn") 493)
+                                (install-file "BQN.jar" dest-jar))))
+                          (add-after 'install 'subjars
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (let* ((out (assoc-ref outputs "out"))
+                                     (dest-bin (string-append out "/bin"))
+                                     (dest-jar (string-append out
+                                                              "/share/java")))
+                                (substitute* (string-append dest-bin "/dbqn")
+                                  (("BQN.jar")
+                                   (string-append dest-jar "/BQN.jar"))))))
+                          (add-after 'subjars 'reorder-jar-content
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (apply (cdr (assoc 'reorder-jar-content
+                                                 ant:%standard-phases))
+                                     #:outputs (list outputs))))
+                          (add-after 'reorder-jar-content 'jar-indices
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (apply (cdr (assoc 'generate-jar-indices
+                                                 ant:%standard-phases))
+                                     #:outputs (list outputs))))
+                          (add-after 'jar-indices 'fix-jar-timestamps
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (apply (cdr (assoc 'reorder-jar-content
+                                                 ant:%standard-phases))
+                                     #:outputs (list outputs)))))))
+      (native-inputs (list `(,openjdk17 "jdk") coreutils zip))
+      (synopsis "BQN implementation based on dzaima/APL")
+      (description "BQN implementation based on dzaima/APL.")
+      (home-page "https://github.com/dzaima/BQN")
+      (license license:expat))))

base-commit: 116c0268ffd387c88b6b47135203fb330eb422f0
-- 
2.37.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package.
  2022-08-05  5:46 ` [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
@ 2022-08-05  7:15   ` Liliana Marie Prikler
  2022-08-05 15:12     ` Christopher Rodriguez
  0 siblings, 1 reply; 29+ messages in thread
From: Liliana Marie Prikler @ 2022-08-05  7:15 UTC (permalink / raw)
  To: Christopher Rodriguez, 56989; +Cc: control

merge 56989 56990 56991 56992 56993
thanks

Regarding the patch title, just one level of grouping is enough.
That is, use "gnu: Add dbqn."

Also, you're missing a ChangeLog, i.e.

* gnu/packages/bqn.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Register it here.

Note that the second change is lacking from your patch.

Am Freitag, dem 05.08.2022 um 01:46 -0400 schrieb Christopher
Rodriguez:
> Thanks to some help from upstream and on IRC (thanks, dzaima and
> lilyp!) I
> was able to remove the non-determinism issue. Here's an updated
> patch.
> 
> ---
>  gnu/packages/bqn.scm | 102
> +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 102 insertions(+)
>  create mode 100644 gnu/packages/bqn.scm
> 
> diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
> new file mode 100644
> index 0000000000..261f29ece5
> --- /dev/null
> +++ b/gnu/packages/bqn.scm
> @@ -0,0 +1,102 @@
> +(define-module (gnu packages bqn)
> +  #:use-module ((guix licenses) #:prefix license:)
> +  #:use-module (guix gexp)
> +  #:use-module (guix packages)
> +  #:use-module (guix download)
> +  #:use-module (guix git-download)
> +  #:use-module (guix build-system copy)
> +  #:use-module (guix build-system gnu)
> +  #:use-module (guix utils)
> +  #:use-module (guix deprecation)
> +  #:use-module (gnu packages)
> +  #:use-module (gnu packages libffi)
> +  #:use-module (gnu packages base)
> +  #:use-module (gnu packages pkg-config)
> +  #:use-module (gnu packages llvm)
> +  #:use-module (gnu packages java)
> +  #:use-module (gnu packages compression))
> +(define-public dbqn
> +  (let* ((tag "0.2.1")
> +         (revision "1")
> +         (commit "0bbe096fc07d278b679a8479318f1722d096a03e")
> +         (hash
> "1kxzxz2hrd1871281s4rsi569qk314aqfmng9pkqn8gv9nqhmph0")
> +         (version (git-version tag revision commit)))
Don't let-bind tag, version and hash, use them inline.
> +    (package
> +      (name "dbqn")
> +      (version version)
> +      (source (origin
> +                (method git-fetch)
> +                (uri (git-reference
> +                      (url "https://github.com/dzaima/BQN")
> +                      (commit commit)))
> +                (file-name (git-file-name name version))
Note that version will be bound here even if you use the version field
to do so.
> +                (sha256
> +                 (base32
> +                  hash))))
> +      (outputs '("out"))
> +      (build-system gnu-build-system)
> +      (arguments
> +       (list #:tests? #f ;While there is a "test" directory, there
> is no
> +             ;; mechanism to run the tests other than to feed the
> files into the
> +             ;; binary and check for an error. This is outside the
> scope of a
> +             ;; packaging workflow, and would need to be fixed
> upstream
> +             ;; instead. Issue Reported:
> https://github.com/dzaima/BQN/issues/12
> +             ;; Maintainer says many of the tests fail, and so they
> will remain off
> +             ;; until this is sorted out.
You could do
  (replace 'check
    (lambda* (#:key tests? #:allow-other-keys)
      (when tests?
        (for-each (lambda (known-good-test)
                    (invoke my-glorious-bin known-good-test))
                  known-good-tests))))
FSVO my-glorious-bin and known-good-tests.
> +             #: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)
> +                          #:prefix ant:)
> +                         (guix build utils))
> +             #:phases #~(modify-phases %standard-phases
> +                          (delete 'configure)
> +                          (replace 'build
> +                            (lambda* _
> +                              (invoke "./build")))
> +                          (add-after 'build 'strip-jar-timestamps
> +                            (lambda* (#:key outputs #:allow-other-
> keys)
> +                              (write %standard-phases)))
> +                          (replace 'install
> +                            (lambda* (#:key outputs #:allow-other-
> keys)
> +                              (let* ((out (assoc-ref outputs "out"))
> +                                     (dest-bin (string-append out
> "/bin"))
> +                                     (dest-jar (string-append out
> +                                                             
> "/share/java")))
> +                                (mkdir-p dest-bin)
> +                                (mkdir-p dest-jar)
> +                                (copy-recursively "BQN"
> +                                                  (string-append
> dest-bin
> +                                                                
> "/dbqn"))
> +                                (chmod (string-append dest-bin
> "/dbqn") 493)
> +                                (install-file "BQN.jar" dest-jar))))
> +                          (add-after 'install 'subjars
> +                            (lambda* (#:key outputs #:allow-other-
> keys)
> +                              (let* ((out (assoc-ref outputs "out"))
> +                                     (dest-bin (string-append out
> "/bin"))
> +                                     (dest-jar (string-append out
> +                                                             
> "/share/java")))
> +                                (substitute* (string-append dest-bin
> "/dbqn")
> +                                  (("BQN.jar")
> +                                   (string-append dest-jar
> "/BQN.jar"))))))
Could this be done in/before install?
> +                          (add-after 'subjars 'reorder-jar-content
> +                            (lambda* (#:key outputs #:allow-other-
> keys)
> +                              (apply (cdr (assoc 'reorder-jar-
> content
> +                                                 ant:%standard-
> phases))
> +                                     #:outputs (list outputs))))
You can use #:rest args to bind args for apply.  Also use assoc-ref
rather than cdr + assoc.
> +                          (add-after 'reorder-jar-content 'jar-
> indices
> +                            (lambda* (#:key outputs #:allow-other-
> keys)
> +                              (apply (cdr (assoc 'generate-jar-
> indices
> +                                                 ant:%standard-
> phases))
> +                                     #:outputs (list outputs))))
> +                          (add-after 'jar-indices 'fix-jar-
> timestamps
> +                            (lambda* (#:key outputs #:allow-other-
> keys)
> +                              (apply (cdr (assoc 'reorder-jar-
> content
> +                                                 ant:%standard-
> phases))
> +                                     #:outputs (list outputs)))))))
> +      (native-inputs (list `(,openjdk17 "jdk") coreutils zip))
Is OpenJDK 17 required?
> +      (synopsis "BQN implementation based on dzaima/APL")
> +      (description "BQN implementation based on dzaima/APL.")
> +      (home-page "https://github.com/dzaima/BQN")
> +      (license license:expat))))
Cheers





^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package.
  2022-08-05  7:15   ` Liliana Marie Prikler
@ 2022-08-05 15:12     ` Christopher Rodriguez
  2022-08-05 15:37       ` ( via Guix-patches via
  2022-08-05 22:33       ` Liliana Marie Prikler
  0 siblings, 2 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-05 15:12 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: Christopher Rodriguez, 56989, control


Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> writes:

> merge 56989 56990 56991 56992 56993
> thanks

Is this notation something anyone can do? I would very much like to be
able to fix my own mistakes in the future.

> Regarding the patch title, just one level of grouping is enough.
> That is, use "gnu: Add dbqn."
>
> Also, you're missing a ChangeLog, i.e.
>
> * gnu/packages/bqn.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Register it here.

I have amended the commit message to reflect the above. Thanks for the
tips!

I've also added `%D%/packages/bqn.scm` to `gnu/local.mk`, as requested.

> Don't let-bind tag, version and hash, use them inline.
...
> Note that version will be bound here even if you use the version field
> to do so.

This makes sense, and I've removed the let binding entirely. My only
uncertainty is where "revision" should go; I've currently attached it to
the upstream version tag (version "0.2.1-1"), where "0.2.1" is the tag
and "1" is the revision. Is this correct?

> You could do
>   (replace 'check
>     (lambda* (#:key tests? #:allow-other-keys)
>       (when tests?
>         (for-each (lambda (known-good-test)
>                     (invoke my-glorious-bin known-good-test))
>                   known-good-tests))))
> FSVO my-glorious-bin and known-good-tests.

I plan to do this once I've been able to look at each test and the
entire source and see if I can get it working. I've added an issue
upstream[1] where the author of the package has confirmed it is on "just
enough life support" to build the recommended implementation from
source.

As it stands, I would have to test each test individually anyway, and
only add it to the package if it arbitrarily passes on my machine for
some reason. I don't think there is value there, as tests are meant to
ensure consistency and I cannot do that using such a workflow.

And though this *is* and *should be* a public package, it is *not* the
recommended interpreter for the language. It is primarily included here
to build the recommended one (CBQN) from source, along with some other
tools I've yet to package that require it during build.

> Could this be done in/before install?

It could, in fact. I've moved it to the above step, and deleted subjars
entirely.

> You can use #:rest args to bind args for apply.  Also use assoc-ref
> rather than cdr + assoc.

I had, for some reason, flipped the arguments on assoc-ref (which
obviously didn't work) and when that failed fell back to cdr + assoc. I
woke up this morning and noticed my mistake; It is fixed now.

As for the #:rest args recommendation: I cannot figure out how to
explicitly bind (list options) to #:options in the apply call using
#:rest. This is probably ignorance on my part; I am still learning the
some of the mechanisms in scheme, and have not used #:rest (or the dot
notation for it) much at all.

Is there an example You could point me to so I can educate myself?

> Is OpenJDK 17 required?

Really, only a JDK 7+ is required. openjdk17 carries the "openjdk" label
currently, and so I defaulted to that one. Is there another I should use
in my packages instead?


> Cheers

Thank You for the speedy response!

--

Christopher Rodriguez




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package.
  2022-08-05 15:12     ` Christopher Rodriguez
@ 2022-08-05 15:37       ` ( via Guix-patches via
  2022-08-05 15:50         ` Christopher Rodriguez
  2022-08-05 15:50         ` Christopher Rodriguez
  2022-08-05 22:33       ` Liliana Marie Prikler
  1 sibling, 2 replies; 29+ messages in thread
From: ( via Guix-patches via @ 2022-08-05 15:37 UTC (permalink / raw)
  To: Christopher Rodriguez, Liliana Marie Prikler; +Cc: control, 56989

On Fri Aug 5, 2022 at 4:12 PM BST, Christopher Rodriguez wrote:
> > merge 56989 56990 56991 56992 56993
> > thanks
>
> Is this notation something anyone can do? I would very much like to be
> able to fix my own mistakes in the future.

Yes! :) You can send 'control messages' to <control@debbugs.gnu.org>
to perform operations such as `close`, `merge`, `reopen`, and `unarchive`.

For example:

> To: control@debbugs.gnu.org
>
> close 19832
> merge 98123 83720 64932
> reopen 10284
> unarchive 29177
> thanks
>
>     -- (

("thanks" just stops the processing of commands and treats the rest as
normal text.)

    -- (




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package.
  2022-08-05 15:37       ` ( via Guix-patches via
@ 2022-08-05 15:50         ` Christopher Rodriguez
  2022-08-05 15:50         ` Christopher Rodriguez
  1 sibling, 0 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-05 15:50 UTC (permalink / raw)
  To: (; +Cc: Liliana Marie Prikler, Christopher Rodriguez, 56989, control

 
"(" <paren@disroot.org> writes:

> On Fri Aug 5, 2022 at 4:12 PM BST, Christopher Rodriguez wrote:
>> > merge 56989 56990 56991 56992 56993
>> > thanks
>>
>> Is this notation something anyone can do? I would very much like to be
>> able to fix my own mistakes in the future.
>
> Yes! :) You can send 'control messages' to <control@debbugs.gnu.org>
> to perform operations such as `close`, `merge`, `reopen`, and `unarchive`.
>
> For example:
>
>> To: control@debbugs.gnu.org
>>
>> close 19832
>> merge 98123 83720 64932
>> reopen 10284
>> unarchive 29177
>> thanks
>>
>>     -- (
>
> ("thanks" just stops the processing of commands and treats the rest as
> normal text.)
>
>     -- (


-- 
--

Christopher Rodriguez




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package.
  2022-08-05 15:37       ` ( via Guix-patches via
  2022-08-05 15:50         ` Christopher Rodriguez
@ 2022-08-05 15:50         ` Christopher Rodriguez
  1 sibling, 0 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-05 15:50 UTC (permalink / raw)
  To: (; +Cc: Liliana Marie Prikler, Christopher Rodriguez, 56989

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]


"(" <paren@disroot.org> writes:

> Yes! :) You can send 'control messages' to <control@debbugs.gnu.org>
> to perform operations such as `close`, `merge`, `reopen`, and `unarchive`.

Ah, okay, thanks for the examples! I'll have to read up so I know what
all my options are. 

--

Christopher Rodriguez

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package.
  2022-08-05 15:12     ` Christopher Rodriguez
  2022-08-05 15:37       ` ( via Guix-patches via
@ 2022-08-05 22:33       ` Liliana Marie Prikler
  2022-08-06  1:47         ` Christopher Rodriguez
  1 sibling, 1 reply; 29+ messages in thread
From: Liliana Marie Prikler @ 2022-08-05 22:33 UTC (permalink / raw)
  To: Christopher Rodriguez; +Cc: 56989

Am Freitag, dem 05.08.2022 um 11:12 -0400 schrieb Christopher
Rodriguez:
> 
> > Don't let-bind tag, version and hash, use them inline.
> ...
> > Note that version will be bound here even if you use the version
> > field to do so.
> 
> This makes sense, and I've removed the let binding entirely. My only
> uncertainty is where "revision" should go; I've currently attached it
> to the upstream version tag (version "0.2.1-1"), where "0.2.1" is the
> tag and "1" is the revision. Is this correct?
You should let-bind revision and commit.  You should nt let-bind tag,
version and hash.  Use git-version like (git-version "0.2.1" revision
commit).

> 
> > You could do
> >   (replace 'check
> >     (lambda* (#:key tests? #:allow-other-keys)
> >       (when tests?
> >         (for-each (lambda (known-good-test)
> >                     (invoke my-glorious-bin known-good-test))
> >                   known-good-tests))))
> > FSVO my-glorious-bin and known-good-tests.
> 
> I plan to do this once I've been able to look at each test and the
> entire source and see if I can get it working. I've added an issue
> upstream[1] where the author of the package has confirmed it is on
> "just enough life support" to build the recommended implementation
> from source.
> 
> As it stands, I would have to test each test individually anyway, and
> only add it to the package if it arbitrarily passes on my machine for
> some reason. I don't think there is value there, as tests are meant
> to ensure consistency and I cannot do that using such a workflow.
Fair enough.

> And though this *is* and *should be* a public package, it is *not*
> the recommended interpreter for the language. It is primarily
> included here to build the recommended one (CBQN) from source, along
> with some other tools I've yet to package that require it during
> build.
That isn't really a good argument not to have tests though.  While
package maintainers should check that dependant packages still build,
having early failure for a broken package (courtesy of the check phase)
goes a long way.

> 
> > You can use #:rest args to bind args for apply.  Also use assoc-ref
> > rather than cdr + assoc.
> 
> I had, for some reason, flipped the arguments on assoc-ref (which
> obviously didn't work) and when that failed fell back to cdr + assoc.
> I woke up this morning and noticed my mistake; It is fixed now.
Ah, yes, the infamous flip :)

> As for the #:rest args recommendation: I cannot figure out how to
> explicitly bind (list options) to #:options in the apply call using
> #:rest. This is probably ignorance on my part; I am still learning
> the some of the mechanisms in scheme, and have not used #:rest (or
> the dot notation for it) much at all.
(cons* #:options your-options rest) ?

> Is there an example You could point me to so I can educate myself?
> 
> > Is OpenJDK 17 required?
> 
> Really, only a JDK 7+ is required. openjdk17 carries the "openjdk"
> label currently, and so I defaulted to that one. Is there another I
> should use in my packages instead?
If there is no *variable* named "openjdk", I'd suggest using the lowest
one that works.  If people are so inclined to use a newer jdk they can
modify the package graph (which is easier than walking back to the
earliest supported version), plus it's lower bootstrap for those of us
building from source.

Cheers




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package.
  2022-08-05 22:33       ` Liliana Marie Prikler
@ 2022-08-06  1:47         ` Christopher Rodriguez
  0 siblings, 0 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-06  1:47 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: Christopher Rodriguez, 56989

[-- Attachment #1: Type: text/plain, Size: 1635 bytes --]


Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

> You should let-bind revision and commit.  You should nt let-bind tag,
> version and hash.  Use git-version like (git-version "0.2.1" revision
> commit).

Copy that, I've implemented this change in the upcoming patch.

> That isn't really a good argument not to have tests though.  While
> package maintainers should check that dependant packages still build,
> having early failure for a broken package (courtesy of the check phase)
> goes a long way.
>

I agree with this.

I did check each test, and there were three failing in the cloned repo
on my local machine… Until I ran them inside the package build
environment, where they all passed 100%. I have run this with --check
--rounds=20 and have not seen a failure inside of the build environment,
so I will leave them enabled.

> Ah, yes, the infamous flip :)
> (cons* #:options your-options rest) ?

I've left these as (#:outputs (list outputs)), as that is less
characters than the above and I'm just passing in a single variable
(inside a list, as that is what the procedure is expecting) without any
(other) modifications.

> If there is no *variable* named "openjdk", I'd suggest using the lowest
> one that works.  If people are so inclined to use a newer jdk they can
> modify the package graph (which is easier than walking back to the
> earliest supported version), plus it's lower bootstrap for those of us
> building from source.

I've successfully built it using icedtea-8 (icedtea-7 failed), so I've
switched the patch over to that.

--

Christopher Rodriguez

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v3] gnu: Add dbqn.
  2022-08-05  2:20 [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
                   ` (4 preceding siblings ...)
  2022-08-05  5:46 ` [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
@ 2022-08-06  2:20 ` Christopher Rodriguez
  2022-08-07 16:28   ` Liliana Marie Prikler
  2022-08-08  9:19   ` Maxime Devos
  2022-08-07 14:43 ` [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
                   ` (3 subsequent siblings)
  9 siblings, 2 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-06  2:20 UTC (permalink / raw)
  To: 56989; +Cc: Christopher Rodriguez

* gnu/packages/bqn.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Registered it here.
---
 gnu/local.mk         |  1 +
 gnu/packages/bqn.scm | 89 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 90 insertions(+)
 create mode 100644 gnu/packages/bqn.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 0e8b7b0447..c3f4cc782c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -138,6 +138,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/boost.scm			\
   %D%/packages/bootloaders.scm			\
   %D%/packages/bootstrap.scm			\
+  %D%/packages/bqn.scm				\
   %D%/packages/browser-extensions.scm		\
   %D%/packages/build-tools.scm			\
   %D%/packages/busybox.scm			\
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
new file mode 100644
index 0000000000..456983f71f
--- /dev/null
+++ b/gnu/packages/bqn.scm
@@ -0,0 +1,89 @@
+(define-module (gnu packages bqn)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix gexp)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system copy)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix utils)
+  #:use-module (guix deprecation)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages libffi)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages llvm)
+  #:use-module (gnu packages java)
+  #:use-module (gnu packages compression))
+(define-public dbqn
+  (let ((commit "0bbe096fc07d278b679a8479318f1722d096a03e")
+        (revision "1"))
+    (package
+      (name "dbqn")
+      (version (git-version "0.2.1" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/dzaima/BQN")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1kxzxz2hrd1871281s4rsi569qk314aqfmng9pkqn8gv9nqhmph0"))))
+      (outputs '("out"))
+      (build-system gnu-build-system)
+      (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)
+                          #:prefix ant:)
+                         (guix build utils))
+             #:phases #~(modify-phases %standard-phases
+                          (delete 'configure)
+                          (replace 'build
+                            (lambda* _
+                              (invoke "./build")))
+                          (replace 'check
+                            (lambda* (:#key tests?
+                                            #:allow-other-tags)
+                              (when tests?
+                                (chmod "./BQN" 493)
+                                (system "./BQN ./test/test"))))
+                          (add-after 'install 'reorder-jar-content
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (apply (assoc-ref ant:%standard-phases
+                                                'reorder-jar-content)
+                                     #:outputs (list outputs))))
+                          (add-after 'reorder-jar-content 'jar-indices
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (apply (assoc-ref ant:%standard-phases
+                                                'generate-jar-indices)
+                                     #:outputs (list outputs))))
+                          (add-after 'jar-indices 'fix-jar-timestamps
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (apply (assoc-ref ant:%standard-phases
+                                                'reorder-jar-content)
+                                     #:outputs (list outputs))))
+                          (replace 'install
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (let* ((out (assoc-ref outputs "out"))
+                                     (dest-bin (string-append out "/bin"))
+                                     (dest-jar (string-append out
+                                                              "/share/java")))
+                                (mkdir-p dest-bin)
+                                (mkdir-p dest-jar)
+                                (copy-recursively "BQN"
+                                                  (string-append dest-bin
+                                                                 "/dbqn"))
+                                (chmod (string-append dest-bin "/dbqn") 493)
+                                (install-file "BQN.jar" dest-jar)
+                                (substitute* (string-append dest-bin "/dbqn")
+                                  (("BQN.jar")
+                                   (string-append dest-jar "/BQN.jar")))))))))
+      (native-inputs (list `(,icedtea-8 "jdk") coreutils zip))
+      (synopsis "BQN implementation based on dzaima/APL")
+      (description "BQN implementation based on dzaima/APL.")
+      (home-page "https://github.com/dzaima/BQN")
+      (license license:expat))))

base-commit: 116c0268ffd387c88b6b47135203fb330eb422f0
-- 
2.37.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package.
  2022-08-05  2:20 [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
                   ` (5 preceding siblings ...)
  2022-08-06  2:20 ` [bug#56989] [PATCH v3] gnu: Add dbqn Christopher Rodriguez
@ 2022-08-07 14:43 ` Christopher Rodriguez
  2022-08-08  9:20 ` [bug#56989] [PATCH v1 1/5] " Maxime Devos
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-07 14:43 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: Christopher Rodriguez, 56989

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]


Please let me know if this is acceptable. I'm willing to make any other
changes needed.

I'll start working through the other patches and apply the given
feedback from this one as well, in the meantime.

Thanks!


--

Christopher Rodriguez

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v3] gnu: Add dbqn.
  2022-08-06  2:20 ` [bug#56989] [PATCH v3] gnu: Add dbqn Christopher Rodriguez
@ 2022-08-07 16:28   ` Liliana Marie Prikler
  2022-08-08  9:19   ` Maxime Devos
  1 sibling, 0 replies; 29+ messages in thread
From: Liliana Marie Prikler @ 2022-08-07 16:28 UTC (permalink / raw)
  To: Christopher Rodriguez, 56989

Am Freitag, dem 05.08.2022 um 22:20 -0400 schrieb Christopher
Rodriguez:
> * gnu/packages/bqn.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Registered it here.
Don't know if that's just my preference or everyone's, but I like
present tense.

> ---
>  gnu/local.mk         |  1 +
>  gnu/packages/bqn.scm | 89
> ++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 90 insertions(+)
>  create mode 100644 gnu/packages/bqn.scm
> 
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 0e8b7b0447..c3f4cc782c 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -138,6 +138,7 @@ GNU_SYSTEM_MODULES
> =                                \
>    %D%/packages/boost.scm                       \
>    %D%/packages/bootloaders.scm                 \
>    %D%/packages/bootstrap.scm                   \
> +  %D%/packages/bqn.scm                         \
>    %D%/packages/browser-extensions.scm          \
>    %D%/packages/build-tools.scm                 \
>    %D%/packages/busybox.scm                     \
> diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
> new file mode 100644
> index 0000000000..456983f71f
> --- /dev/null
> +++ b/gnu/packages/bqn.scm
> @@ -0,0 +1,89 @@
> +(define-module (gnu packages bqn)
> +  #:use-module ((guix licenses) #:prefix license:)
> +  #:use-module (guix gexp)
> +  #:use-module (guix packages)
> +  #:use-module (guix download)
> +  #:use-module (guix git-download)
> +  #:use-module (guix build-system copy)
> +  #:use-module (guix build-system gnu)
> +  #:use-module (guix utils)
> +  #:use-module (guix deprecation)
> +  #:use-module (gnu packages)
> +  #:use-module (gnu packages libffi)
> +  #:use-module (gnu packages base)
> +  #:use-module (gnu packages pkg-config)
> +  #:use-module (gnu packages llvm)
> +  #:use-module (gnu packages java)
> +  #:use-module (gnu packages compression))
> +(define-public dbqn
> +  (let ((commit "0bbe096fc07d278b679a8479318f1722d096a03e")
> +        (revision "1"))
> +    (package
> +      (name "dbqn")
> +      (version (git-version "0.2.1" revision commit))
> +      (source (origin
> +                (method git-fetch)
> +                (uri (git-reference
> +                      (url "https://github.com/dzaima/BQN")
> +                      (commit commit)))
> +                (file-name (git-file-name name version))
> +                (sha256
> +                 (base32
> +                 
> "1kxzxz2hrd1871281s4rsi569qk314aqfmng9pkqn8gv9nqhmph0"))))
> +      (outputs '("out"))
> +      (build-system gnu-build-system)
> +      (arguments
> +       (list #:imported-modules `(,@%gnu-build-system-modules (guix
> build
> +                                                                   
> syscalls)
Put #:imported modules on a new line, same for (guix build syscalls).
> +                                  (guix build ant-build-system))
> +             #:modules `((guix build gnu-build-system)
> +                         ((guix build ant-build-system)
> +                          #:prefix ant:)
> +                         (guix build utils))
> +             #:phases #~(modify-phases %standard-phases
> +                          (delete 'configure)
> +                          (replace 'build
> +                            (lambda* _
> +                              (invoke "./build")))
> +                          (replace 'check
> +                            (lambda* (:#key tests?
> +                                            #:allow-other-tags)
> +                              (when tests?
> +                                (chmod "./BQN" 493)
Use octal notation for chmod.
> +                                (system "./BQN ./test/test"))))
> +                          (add-after 'install 'reorder-jar-content
> +                            (lambda* (#:key outputs #:allow-other-
> keys)
> +                              (apply (assoc-ref ant:%standard-phases
> +                                                'reorder-jar-
> content)
> +                                     #:outputs (list outputs))))
> +                          (add-after 'reorder-jar-content 'jar-
> indices
> +                            (lambda* (#:key outputs #:allow-other-
> keys)
> +                              (apply (assoc-ref ant:%standard-phases
> +                                                'generate-jar-
> indices)
> +                                     #:outputs (list outputs))))
> +                          (add-after 'jar-indices 'fix-jar-
> timestamps
> +                            (lambda* (#:key outputs #:allow-other-
> keys)
> +                              (apply (assoc-ref ant:%standard-phases
> +                                                'reorder-jar-
> content)
> +                                     #:outputs (list outputs))))
> +                          (replace 'install
> +                            (lambda* (#:key outputs #:allow-other-
> keys)
> +                              (let* ((out (assoc-ref outputs "out"))
> +                                     (dest-bin (string-append out
> "/bin"))
> +                                     (dest-jar (string-append out
> +                                                             
> "/share/java")))
> +                                (mkdir-p dest-bin)
> +                                (mkdir-p dest-jar)
> +                                (copy-recursively "BQN"
> +                                                  (string-append
> dest-bin
> +                                                                
> "/dbqn"))
> +                                (chmod (string-append dest-bin
> "/dbqn") 493)
> +                                (install-file "BQN.jar" dest-jar)
> +                                (substitute* (string-append dest-bin
> "/dbqn")
> +                                  (("BQN.jar")
> +                                   (string-append dest-jar
> "/BQN.jar")))))))))
Other than that LGTM modulo not having tested anything as of yet.

Cheers




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v3] gnu: Add dbqn.
  2022-08-06  2:20 ` [bug#56989] [PATCH v3] gnu: Add dbqn Christopher Rodriguez
  2022-08-07 16:28   ` Liliana Marie Prikler
@ 2022-08-08  9:19   ` Maxime Devos
  2022-08-08 13:54     ` Christopher Rodriguez
  1 sibling, 1 reply; 29+ messages in thread
From: Maxime Devos @ 2022-08-08  9:19 UTC (permalink / raw)
  To: Christopher Rodriguez, 56989


[-- Attachment #1.1.1: Type: text/plain, Size: 6054 bytes --]

On 06-08-2022 04:20, Christopher Rodriguez wrote:

> +(define-module (gnu packages bqn)

Copyright and license headers are missing. Also, usually we don't do 
per-package modules but rather thematic modules, though that's not a 
hard rule especially if there are technical problems with that.

> +  #:use-module ((guix licenses) #:prefix license:)
> +  #:use-module (guix gexp)
> +  #:use-module (guix packages)
> +  #:use-module (guix download)
> +  #:use-module (guix git-download)
> +  #:use-module (guix build-system copy)
> +  #:use-module (guix build-system gnu)
> +  #:use-module (guix utils)
> +  #:use-module (guix deprecation)
I don't think you are using (guix deprecation) below?
> +  #:use-module (gnu packages)
> +  #:use-module (gnu packages libffi)
> +  #:use-module (gnu packages base)
> +  #:use-module (gnu packages pkg-config)
> +  #:use-module (gnu packages llvm)
> +  #:use-module (gnu packages java)
> +  #:use-module (gnu packages compression))
> +(define-public dbqn
> +  (let ((commit "0bbe096fc07d278b679a8479318f1722d096a03e")
> +        (revision "1"))
> +    (package
> +      (name "dbqn")
> +      (version (git-version "0.2.1" revision commit))
> +      (source (origin
> +                (method git-fetch)
> +                (uri (git-reference
> +                      (url"https://github.com/dzaima/BQN")
> +                      (commit commit)))
> +                (file-name (git-file-name name version))
> +                (sha256
> +                 (base32
> +                  "1kxzxz2hrd1871281s4rsi569qk314aqfmng9pkqn8gv9nqhmph0"))))

I have looked at the 'v0.2.1' tag, and it points at the 0bbe096... 
commit, so you are actually packaging version 0.2.1, not some git commit 
after v0.2.1. As such, no need for (git-version ...), you can just write 
"0.2.1" there. Then 'revision' becomes unused and can be dropped, and 
'commit' is only used in a single place anymore so it can be inlined.

> +      (native-inputs (list `(,icedtea-8 "jdk") coreutils zip))
coreutils is an implicit (native-)input, likely no need to to mention it.

Also, the Makefile mentions that the executable to start things has 
#!/bin/bash -- to properly patch is when cross-compiling, you need 
'bash-minimal' or 'bash' in inputs, otherwise it will be patched for the 
wrong architecture.

Also, that script runs 'java' -- make sure it is patched too such that 
java will actually be found -- and to patch it, you need to have 
icedtea:out or openjdk:out in 'inputs'.

> +      (outputs '("out"))
That's the default, no need to set it.

> +       (list #:imported-modules `(,@%gnu-build-system-modules (guix build
> +                                                                    syscalls)
For formatting, (guix build syscalls) should be on a separate line.

> +      (synopsis "BQN implementation based on dzaima/APL")
> +      (description "BQN implementation based on dzaima/APL.")
The synopsis and description are identical, and this doesn't explain 
much to people who don't know what 'BQN' is. Can it be rewritten such 
that people not familiar with BQN can decide whether this ‘BQN’ is 
something that's useful for them? '(guix)Synopses and Descriptions' has 
more information.

> +                            (lambda* (:#key tests?
> +                                            #:allow-other-tags)
Why the : before #:key? Also, no need to break it in separate lines.

> +                          (add-after 'install 'reorder-jar-content
> +                            (lambda* (#:key outputs #:allow-other-keys)
> +                              (apply (assoc-ref ant:%standard-phases
> +                                                'reorder-jar-content)
> +                                     #:outputs (list outputs))))
'output's is a list of strings, now you are giving reorder-jar-content a 
list of lists of strings
However, looking at (guix build ant-build-system), it looks like it just 
wants a list of strings.

As such, maybe it should be:

(add-after 'install 'reorder-jar-content
   (assoc-ref ant:%standard-phases 'reorder-jar-content))

? (untested)  Possibly likewise for the other phases.

> (the implementation is even under single-license GPL!) [...]
You are writing license:expat in the 'license' field, not 
license:gplN/license:gplN+. Is it Expat or is it GPL?

> +      (synopsis "Official BQN sources in BQN")
If they are just sources, you can do (define bqn-bytecode-sources 
(origin ...))

> +      (home-page"https://github.com/mlochbaum/BQN.git")
> +      (license license:gpl3))))
The 'LICENSE' file says something different. I don't think that's the 
home page, maybe <https://mlochbaum.github.io/BQN/> instead?

> +                              (chmod "BQN" 493)
Hexadecimal would be clearer.
> +       "The expected implementation for the BQN language,
> +according to the official documentation of that specification.")
expected -> standard (what's 'expected' depends on the user, they might 
want a different implementation), unless it's not the standard 
implementation.

'documentation of that specification' -> 'the specification (pleonasm)

And maybe remove 'official', given the absence of 'official' in the 
descriptions of, say, guile, gcc, openjdk and java, this sounds 
marketing and unfair to me.

(singeli-bootstrap:)

> +  (let* ((tag "0")
> +         (revision "1")
> +         (commit "fd17b144483549dbd2bcf23e3a37a09219171a99")
> +         (hash "1rr4l7ijzcg25n2igi1mzya6qllh5wsrf3m5i429rlgwv1fwvfji")
> +         (version (git-version tag revision commit)))
I'm not seeing a '0' tag anywhere in the repository -- I dont see any 
tags at all tere.

> +    (inputs (list bqn-bytecode-sources libffi singeli-bootstrap))))
For cross-compilation, I would have expected sengili-bootstrap in 
native-inputs, not inputs, assuming that it is used as a compiler. Does 
cross-compilation (with --target) work?

Greetings,
Maxime.


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package.
  2022-08-05  2:20 [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
                   ` (6 preceding siblings ...)
  2022-08-07 14:43 ` [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
@ 2022-08-08  9:20 ` Maxime Devos
  2022-08-09  1:22 ` [bug#56989] [PATCH v4] gnu: Add dbqn Christopher Rodriguez
  2022-08-10 17:27 ` [bug#56989] [PATCH v5 1/5] gnu: Add dbqn package Christopher Rodriguez
  9 siblings, 0 replies; 29+ messages in thread
From: Maxime Devos @ 2022-08-08  9:20 UTC (permalink / raw)
  To: Christopher Rodriguez, 56989


[-- Attachment #1.1.1: Type: text/plain, Size: 114 bytes --]

Nevermind my remarks on hexadecimal, octal would be better I think, like 
lilyp wrote.

Greetings,
Maxime.


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v3] gnu: Add dbqn.
  2022-08-08  9:19   ` Maxime Devos
@ 2022-08-08 13:54     ` Christopher Rodriguez
  2022-08-08 21:09       ` Maxime Devos
  2022-08-09  8:58       ` Maxime Devos
  0 siblings, 2 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-08 13:54 UTC (permalink / raw)
  To: Maxime Devos; +Cc: Christopher Rodriguez, 56989

[-- Attachment #1: Type: text/plain, Size: 9137 bytes --]


> Maxime Devos <maximedevos@telenet.be> writes:
> Copyright and license headers are missing. Also, usually we don't do
> per-package modules but rather thematic modules, though that's not a hard
> rule especially if there are technical problems with that.
Ah, right, I forgot about those. Not used to creating new files. Will be
in the patch I'm sending shortly.

As for the per-package rule, this will not be the only package for this
file. Aside from the 2 user-facing packages and 3 bootstrap packages in
this series, I'm hoping to package a further (at least) 3 packages—a
standard library, a DSL, and a primer (info).

I'm also hoping to package an emacs mode, a few fonts, and an update to
a few packages to add BQN support. But those have their own files, and
won't be included here.

Is that enough of a justification for a new file, or should I look to
add this to another? I /suppose/ apl.scm would work, though technically
that would be like scheme, common lisp, arc, clojure, et al being
grouped in the same language. WDYT?

> I don't think you are using (guix deprecation) below?
I don't think I am either, now that You mention it. Somehow that made
its way into my starting template; I will remove it in the forthcoming
patch.

> I have looked at the 'v0.2.1' tag, and it points at the 0bbe096... commit, so
> you are actually packaging version 0.2.1, not some git commit after
> v0.2.1. As such, no need for (git-version ...), you can just write "0.2.1"
> there. Then 'revision' becomes unused and can be dropped, and 'commit' is
> only used in a single place anymore so it can be inlined.
This honestly confused me a bit at first, but I think I see what You
mean now. Since it's an official upstream version, that can be the
version, instead of using git-version. I will apply these changes as well.

>> +      (native-inputs (list `(,icedtea-8 "jdk") coreutils zip))
> coreutils is an implicit (native-)input, likely no need to to mention it.
>
> Also, the Makefile mentions that the executable to start things has
> #!/bin/bash -- to properly patch is when cross-compiling, you need
> 'bash-minimal' or 'bash' in inputs, otherwise it will be patched for the
> wrong architecture.
>
> Also, that script runs 'java' -- make sure it is patched too such that java
> will actually be found -- and to patch it, you need to have icedtea:out or
> openjdk:out in 'inputs'.
Per the feedback I received from Liliana, I will use icedtea:out to (as
there is less bootstrapping required if building everything from
source). I'll also add bash-minimal in place of the unneeded
coreutils, and place both icedtea:out and bash-minimal in inputs rather
than native, as they are expected for the target machine.

>> +      (outputs '("out"))
> That's the default, no need to set it.
>> +       (list #:imported-modules `(,@%gnu-build-system-modules (guix build
>> +                                                                    syscalls)
> For formatting, (guix build syscalls) should be on a separate line.
>> +      (synopsis "BQN implementation based on dzaima/APL")
>> +      (description "BQN implementation based on dzaima/APL.")
> The synopsis and description are identical, and this doesn't explain much to
> people who don't know what 'BQN' is. Can it be rewritten such that people not
> familiar with BQN can decide whether this ‘BQN’ is something that's useful
> for them? '(guix)Synopses and Descriptions' has more information.
>> +                            (lambda* (:#key tests?
>> +                                            #:allow-other-tags)
> Why the : before #:key? Also, no need to break it in separate lines.
All of these points are addressed in the forthcoming (v4) patch. In
particular, thanks for calling out the description: It had been a
placeholder while I was getting things working, and I'm happy to replace
it with something more descriptive. And the `:#key` was a typo, unsure
how it has worked thus far, as I had tests disabled up until
recently. Maybe I was using the stock check phase, then. I forget, tbh.

>> +                          (add-after 'install 'reorder-jar-content
>> +                            (lambda* (#:key outputs #:allow-other-keys)
>> +                              (apply (assoc-ref ant:%standard-phases
>> +                                                'reorder-jar-content)
>> +                                     #:outputs (list outputs))))
> 'output's is a list of strings, now you are giving reorder-jar-content a list
> of lists of strings
> However, looking at (guix build ant-build-system), it looks like it just
> wants a list of strings.
>
> As such, maybe it should be:
>
> (add-after 'install 'reorder-jar-content
>   (assoc-ref ant:%standard-phases 'reorder-jar-content))
>
> ? (untested)  Possibly likewise for the other phases.
This intrigues me. The list of outputs was a kludge to allow the
function to accept the singleton output. If the singleton is still
wrapped in a list, then I'm unsure why it fails. Perhaps I need to test
this more; will do so before sending v4.

>> (the implementation is even under single-license GPL!) [...]
> You are writing license:expat in the 'license' field, not
> license:gplN/license:gplN+. Is it Expat or is it GPL?
So, this package (dbqn) is expat. The implementation I referenced above
(which is recommended and actively developed) is a different one (cbqn)
that relies on this one as a dependency for bootstrapping, and is under
gpl.

I really just wanted to add cbqn to guix, but can't do so without dbqn,
which /is/ still functional, is depended on by a bunch of tooling for
the language, and may as well also be a package because of the above
(sort of like how someone using common lisp may view clisp as a slow
dependency of sbcl, or they may instead choose to use it as their target
implementation).

>> +      (synopsis "Official BQN sources in BQN")
> If they are just sources, you can do (define bqn-bytecode-sources (origin
> ...))
I had not realized the package was unneeded! That might simplify things
greatly. I love packaging things for guix; I always learn something new.

>> +      (home-page"https://github.com/mlochbaum/BQN.git")
>> +      (license license:gpl3))))
> The 'LICENSE' file says something different. I don't think that's the home
> page, maybe <https://mlochbaum.github.io/BQN/> instead?
So, <https://mlochbaum.github.io/BQN> is the homepage of the language,
but the sources we're using are only a part of that language
definition.

In particular, we're only using the src/ and test/ directories of that
repository. We're ignoring the docs, commentary, editor plugins, fonts,
implementation instructions, spec, tutorial, javascript implementation,
etc. We really are just targetting the sources for the bytecode and the
tests, which is why I thought the repo itself makes a better homepage.

Should I change that to the homepage for the language?

As for the LICENSE file, indeed, it is isc. Thanks for the catch.

>
>> +                              (chmod "BQN" 493)
> Hexadecimal would be clearer.
As in Your second message, I will use the octal notation per Liliana.

>> +       "The expected implementation for the BQN language,
>> +according to the official documentation of that specification.")
> expected -> standard (what's 'expected' depends on the user, they might want
> a different implementation), unless it's not the standard implementation.
>
> 'documentation of that specification' -> 'the specification (pleonasm)
>
> And maybe remove 'official', given the absence of 'official' in the
> descriptions of, say, guile, gcc, openjdk and java, this sounds marketing and
> unfair to me.
I will change this to "The standard implementation of the BQN language,
according to the specification." (Also, thank You for teaching me
'pleonasm'!)

> (singeli-bootstrap:)
>
>> +  (let* ((tag "0")
>> +         (revision "1")
>> +         (commit "fd17b144483549dbd2bcf23e3a37a09219171a99")
>> +         (hash "1rr4l7ijzcg25n2igi1mzya6qllh5wsrf3m5i429rlgwv1fwvfji")
>> +         (version (git-version tag revision commit)))
> I'm not seeing a '0' tag anywhere in the repository -- I dont see any tags at
> all tere.
There are none; I thought the absence of any tage necessitates a '0' for
the version number, and wanted to keep the definitions
standardized. Should I inline the 0 instead in the git-version?

>> +    (inputs (list bqn-bytecode-sources libffi singeli-bootstrap))))
> For cross-compilation, I would have expected sengili-bootstrap in
> native-inputs, not inputs, assuming that it is used as a compiler. Does
> cross-compilation (with --target) work?
Singeli is written in BQN, which is an interpreted language. So, as long
as the BQN interpreter is for the correct architecture, it will work. It
will never be compiled itelf.

Thank You for all of the feedback! I'll try to have a revised set of
patches in by this evening EDT, in the next 8 hours.

--

Christopher Rodriguez

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v3] gnu: Add dbqn.
  2022-08-08 13:54     ` Christopher Rodriguez
@ 2022-08-08 21:09       ` Maxime Devos
  2022-08-09  8:58       ` Maxime Devos
  1 sibling, 0 replies; 29+ messages in thread
From: Maxime Devos @ 2022-08-08 21:09 UTC (permalink / raw)
  To: Christopher Rodriguez; +Cc: 56989


[-- Attachment #1.1.1.1: Type: text/plain, Size: 1220 bytes --]


On 08-08-2022 15:54, Christopher Rodriguez wrote:
>> Maxime Devos<maximedevos@telenet.be>  writes:
>> Copyright and license headers are missing. Also, usually we don't do
>> per-package modules but rather thematic modules, though that's not a hard
>> rule especially if there are technical problems with that.
> Ah, right, I forgot about those. Not used to creating new files. Will be
> in the patch I'm sending shortly.
>
> As for the per-package rule, this will not be the only package for this
> file. Aside from the 2 user-facing packages and 3 bootstrap packages in
> this series, I'm hoping to package a further (at least) 3 packages—a
> standard library, a DSL, and a primer (info).
>
> I'm also hoping to package an emacs mode, a few fonts, and an update to
> a few packages to add BQN support. But those have their own files, and
> won't be included here.
>
> Is that enough of a justification for a new file, or should I look to
> add this to another? I/suppose/  apl.scm would work, though technically
> that would be like scheme, common lisp, arc, clojure, et al being

I didn't notice the [2/5, 3/5, 4/5, 5/5] patches, the new file should be 
fine I think

Greetings,
Maxime


[-- Attachment #1.1.1.2: Type: text/html, Size: 1899 bytes --]

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v4] gnu: Add dbqn.
  2022-08-05  2:20 [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
                   ` (7 preceding siblings ...)
  2022-08-08  9:20 ` [bug#56989] [PATCH v1 1/5] " Maxime Devos
@ 2022-08-09  1:22 ` Christopher Rodriguez
  2022-08-10 17:27 ` [bug#56989] [PATCH v5 1/5] gnu: Add dbqn package Christopher Rodriguez
  9 siblings, 0 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-09  1:22 UTC (permalink / raw)
  To: 56989; +Cc: Christopher Rodriguez

* gnu/packages/bqn.scm: Create module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Register module.
---
 gnu/local.mk         |   1 +
 gnu/packages/bqn.scm | 105 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 106 insertions(+)
 create mode 100644 gnu/packages/bqn.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 0e8b7b0447..c3f4cc782c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -138,6 +138,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/boost.scm			\
   %D%/packages/bootloaders.scm			\
   %D%/packages/bootstrap.scm			\
+  %D%/packages/bqn.scm				\
   %D%/packages/browser-extensions.scm		\
   %D%/packages/build-tools.scm			\
   %D%/packages/busybox.scm			\
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
new file mode 100644
index 0000000000..1fc2dc82af
--- /dev/null
+++ b/gnu/packages/bqn.scm
@@ -0,0 +1,105 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2022 Christopher Rodriguez <yewscion@gmail.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+(define-module (gnu packages bqn)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix gexp)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system copy)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix utils)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages bash)
+  #:use-module (gnu packages libffi)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages llvm)
+  #:use-module (gnu packages java)
+  #:use-module (gnu packages compression))
+(define-public dbqn
+  (package
+    (name "dbqn")
+    (version "0.2.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/dzaima/BQN")
+                    (commit "0bbe096fc07d278b679a8479318f1722d096a03e")))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1kxzxz2hrd1871281s4rsi569qk314aqfmng9pkqn8gv9nqhmph0"))))
+    (build-system gnu-build-system)
+    (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)
+                   #:prefix ant:)
+                  (guix build utils))
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'configure)
+                   (replace 'build
+                     (lambda* _
+                       (invoke "./build")
+                       (chmod "./BQN" #o755)))
+                   (replace 'check
+                     (lambda* (#:key tests? #:allow-other-keys)
+                       (when tests?
+                         (system "./BQN ./test/test"))))
+                   (add-after 'install 'reorder-jar-content
+                     (lambda* (#:key outputs #:allow-other-keys)
+                       (apply (assoc-ref ant:%standard-phases
+                                         'reorder-jar-content)
+                              #:outputs (list outputs))))
+                   (add-after 'reorder-jar-content 'jar-indices
+                     (lambda* (#:key outputs #:allow-other-keys)
+                       (apply (assoc-ref ant:%standard-phases
+                                         'generate-jar-indices)
+                              #:outputs (list outputs))))
+                   (add-after 'jar-indices 'fix-jar-timestamps
+                     (lambda* (#:key outputs #:allow-other-keys)
+                       (apply (assoc-ref ant:%standard-phases
+                                         'reorder-jar-content)
+                              #:outputs (list outputs))))
+                   (replace 'install
+                     (lambda* (#:key outputs #:allow-other-keys)
+                       (let* ((out (assoc-ref outputs "out"))
+                              (dest-bin (string-append out "/bin"))
+                              (dest-jar (string-append out "/share/java")))
+                         (mkdir-p dest-bin)
+                         (mkdir-p dest-jar)
+                         (copy-recursively "BQN"
+                                           (string-append dest-bin
+                                                          "/dbqn"))
+                         (install-file "BQN.jar" dest-jar)
+                         (substitute* (string-append dest-bin "/dbqn")
+                           (("BQN.jar")
+                            (string-append dest-jar "/BQN.jar")))))))))
+    (native-inputs (list `(,icedtea-8 "jdk") zip))
+    (inputs (list icedtea-8 bash-minimal))
+    (synopsis "BQN implementation based on dzaima/APL")
+    (description
+     "dbqn is a java implementation of the BQN programming
+language that does not need to be bootstrapped, based on an earlier java
+implementation of APL by the same author.")
+    (home-page "https://github.com/dzaima/BQN")
+    (license license:expat)))

base-commit: 116c0268ffd387c88b6b47135203fb330eb422f0
-- 
2.37.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v3] gnu: Add dbqn.
  2022-08-08 13:54     ` Christopher Rodriguez
  2022-08-08 21:09       ` Maxime Devos
@ 2022-08-09  8:58       ` Maxime Devos
  2022-08-09  9:02         ` Maxime Devos
  1 sibling, 1 reply; 29+ messages in thread
From: Maxime Devos @ 2022-08-09  8:58 UTC (permalink / raw)
  To: Christopher Rodriguez; +Cc: 56989


[-- Attachment #1.1.1.1: Type: text/plain, Size: 1189 bytes --]


On 08-08-2022 15:54, Christopher Rodriguez wrote:
>>> +         (commit "fd17b144483549dbd2bcf23e3a37a09219171a99")
>>> +         (hash "1rr4l7ijzcg25n2igi1mzya6qllh5wsrf3m5i429rlgwv1fwvfji")
>>> +         (version (git-version tag revision commit)))
>> I'm not seeing a '0' tag anywhere in the repository -- I dont see any tags at
>> all tere.
> There are none; I thought the absence of any tage necessitates a '0' for
> the version number, and wanted to keep the definitions
> standardized. Should I inline the 0 instead in the git-version?
>
Yes, if upstream doesn't do versioning we use "0" or sometimes "0.0", in 
combination with git-version (or hg-version, ...). However, "0" is not a 
tag, so the variable 'tag' needs to be renamed or inlined.  As it is 
only used in a signle place, I would recommend inlining it. Likewise for 
'version'.

Additionally, 'hash' needs to be inlined -- not only because it is used 
in a single place, but also because there is some compile-time error 
checking for hashes that only can work when it is inlined.

Also, I've seen a v2 for the first patch, but what happened to 2/5, 3/5, 
4/5 and 5/5?

Greetings,
Maxime.


[-- Attachment #1.1.1.2: Type: text/html, Size: 1867 bytes --]

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v3] gnu: Add dbqn.
  2022-08-09  8:58       ` Maxime Devos
@ 2022-08-09  9:02         ` Maxime Devos
  0 siblings, 0 replies; 29+ messages in thread
From: Maxime Devos @ 2022-08-09  9:02 UTC (permalink / raw)
  To: Christopher Rodriguez; +Cc: 56989


[-- Attachment #1.1.1: Type: text/plain, Size: 176 bytes --]


On 09-08-2022 10:58, Maxime Devos wrote:
> Also, I've seen a v2 for the first patch, but what happened to 2/5, 
> 3/5, 4/5 and 5/5? 

I meant v4.

Greetings,
Maxime.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v5 1/5] gnu: Add dbqn package.
  2022-08-05  2:20 [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
                   ` (8 preceding siblings ...)
  2022-08-09  1:22 ` [bug#56989] [PATCH v4] gnu: Add dbqn Christopher Rodriguez
@ 2022-08-10 17:27 ` Christopher Rodriguez
  2022-08-10 17:27   ` [bug#56989] [PATCH v5 2/5] gnu: Add bqn-sources Christopher Rodriguez
                     ` (4 more replies)
  9 siblings, 5 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-10 17:27 UTC (permalink / raw)
  To: 56989; +Cc: Christopher Rodriguez

* gnu/packages/bqn.scm: Create module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Register module.
---
 gnu/packages/bqn.scm | 108 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 108 insertions(+)
 create mode 100644 gnu/packages/bqn.scm

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
new file mode 100644
index 0000000000..f00392a4f9
--- /dev/null
+++ b/gnu/packages/bqn.scm
@@ -0,0 +1,108 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2022 Christopher Rodriguez <yewscion@gmail.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+(define-module (gnu packages bqn)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix gexp)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system copy)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix utils)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages bash)
+  #:use-module (gnu packages libffi)
+  #:use-module (gnu packages base)
+  #: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
+  (let ((commit "88f2b43966a75cc2c382421218eb30003bb16f4a")
+        (revision "1"))
+  (package
+    (name "dbqn")
+    (version (git-version "0.2.1" revision commit))
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/dzaima/BQN")
+                    (commit commit)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "06mzvv7kmandhgwb6jwz3rivsj4ic549sy8afnb5zr6mfn5isyg5"))))
+    (build-system gnu-build-system)
+    (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)
+                   #:prefix ant:)
+                  (guix build utils))
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'configure)
+                   (replace 'build
+                     (lambda* _
+                       (invoke "./build")
+                       (chmod "./BQN" #o755)))
+                   (replace 'check
+                     (lambda* (#:key tests? #:allow-other-keys)
+                       (when tests?
+                         (system "./BQN ./test/test"))))
+                   (add-after 'install 'reorder-jar-content
+                     (lambda* (#:key outputs #:allow-other-keys)
+                       (apply (assoc-ref ant:%standard-phases
+                                         'reorder-jar-content)
+                              #:outputs (list outputs))))
+                   (add-after 'reorder-jar-content 'jar-indices
+                     (lambda* (#:key outputs #:allow-other-keys)
+                       (apply (assoc-ref ant:%standard-phases
+                                         'generate-jar-indices)
+                              #:outputs (list outputs))))
+                   (add-after 'jar-indices 'fix-jar-timestamps
+                     (lambda* (#:key outputs #:allow-other-keys)
+                       (apply (assoc-ref ant:%standard-phases
+                                         'reorder-jar-content)
+                              #:outputs (list outputs))))
+                   (replace 'install
+                     (lambda* (#:key outputs #:allow-other-keys)
+                       (let* ((out (assoc-ref outputs "out"))
+                              (dest-bin (string-append out "/bin"))
+                              (dest-jar (string-append out "/share/java")))
+                         (mkdir-p dest-bin)
+                         (mkdir-p dest-jar)
+                         (copy-recursively "BQN"
+                                           (string-append dest-bin
+                                                          "/dbqn"))
+                         (install-file "BQN.jar" dest-jar)
+                         (substitute* (string-append dest-bin "/dbqn")
+                           (("BQN.jar")
+                            (string-append dest-jar "/BQN.jar")))))))))
+    (native-inputs (list `(,icedtea-8 "jdk") zip))
+    (inputs (list icedtea-8 bash-minimal))
+    (synopsis "BQN implementation based on dzaima/APL")
+    (description
+     "dbqn is a java implementation of the BQN programming
+language that does not need to be bootstrapped, based on an earlier java
+implementation of APL by the same author.")
+    (home-page "https://github.com/dzaima/BQN")
+    (license license:expat))))

base-commit: b21d05d232ec0aba5abec20e83cc52c1d5163cc3
-- 
2.37.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v5 2/5] gnu: Add bqn-sources.
  2022-08-10 17:27 ` [bug#56989] [PATCH v5 1/5] gnu: Add dbqn package Christopher Rodriguez
@ 2022-08-10 17:27   ` Christopher Rodriguez
  2022-08-10 17:27   ` [bug#56989] [PATCH v5 3/5] gnu: Add cbqn-bootstrap Christopher Rodriguez
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-10 17:27 UTC (permalink / raw)
  To: 56989; +Cc: Christopher Rodriguez

* gnu/packages/bqn.scm: Add bqn-sources origin definition.
---
 gnu/packages/bqn.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index f00392a4f9..3c98102659 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -106,3 +106,16 @@ (define-public dbqn
 implementation of APL by the same author.")
     (home-page "https://github.com/dzaima/BQN")
     (license license:expat))))
+(define bqn-sources
+  ;; 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"))
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+              (url "https://github.com/mlochbaum/BQN")
+              (commit commit)))
+        (file-name (git-file-name "bqn-sources" commit))
+        (sha256
+         (base32 "0r6pa9lscl2395g4xlvmg90vpdsjzhin4f1r0s7brymmpvmns2yc")))))
-- 
2.37.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v5 3/5] gnu: Add cbqn-bootstrap.
  2022-08-10 17:27 ` [bug#56989] [PATCH v5 1/5] gnu: Add dbqn package Christopher Rodriguez
  2022-08-10 17:27   ` [bug#56989] [PATCH v5 2/5] gnu: Add bqn-sources Christopher Rodriguez
@ 2022-08-10 17:27   ` Christopher Rodriguez
  2022-08-10 17:27   ` [bug#56989] [PATCH v5 4/5] gnu: Add singeli-sources Christopher Rodriguez
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-10 17:27 UTC (permalink / raw)
  To: 56989; +Cc: Christopher Rodriguez

* gnu/packages/bqn.scm: Add cbqn-bootstrap package.
---
 gnu/packages/bqn.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 3c98102659..61aa37fdf5 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -119,3 +119,43 @@ (define bqn-sources
         (file-name (git-file-name "bqn-sources" commit))
         (sha256
          (base32 "0r6pa9lscl2395g4xlvmg90vpdsjzhin4f1r0s7brymmpvmns2yc")))))
+(define cbqn-bootstrap
+  (let* ((revision "1")
+         (commit "9c1cbdc99863b1da0116df61cd832137b196dc5c"))
+    (package
+      (name "cbqn-bootstrap")
+      (version (git-version "0" "1" 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
+                  "0w38fhwf20drkyijy6nfnhmc5g5gw0zmzgmy1q605x57znlj85a2"))))
+      (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))
+      (inputs (list icedtea-8 libffi))
+      (synopsis "BQN implementation in C")
+      (description "The standard implementation of the BQN language,
+according to the specification.")
+      (home-page "https://mlochbaum.github.io/BQN/")
+      (license license:gpl3))))
-- 
2.37.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v5 4/5] gnu: Add singeli-sources.
  2022-08-10 17:27 ` [bug#56989] [PATCH v5 1/5] gnu: Add dbqn package Christopher Rodriguez
  2022-08-10 17:27   ` [bug#56989] [PATCH v5 2/5] gnu: Add bqn-sources Christopher Rodriguez
  2022-08-10 17:27   ` [bug#56989] [PATCH v5 3/5] gnu: Add cbqn-bootstrap Christopher Rodriguez
@ 2022-08-10 17:27   ` Christopher Rodriguez
  2022-08-10 17:28   ` [bug#56989] [PATCH v5 5/5] gnu: Add cbqn Christopher Rodriguez
  2022-08-31 21:10   ` bug#56989: bug#56993: [PATCH v1 5/5] gnu: bqn: " Ludovic Courtès
  4 siblings, 0 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-10 17:27 UTC (permalink / raw)
  To: 56989; +Cc: Christopher Rodriguez

* gnu/packages/bqn.scm: Add singeli-sources origin definition.
---
 gnu/packages/bqn.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 61aa37fdf5..a87534fcd5 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -159,3 +159,13 @@ (define cbqn-bootstrap
 according to the specification.")
       (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")))))
-- 
2.37.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#56989] [PATCH v5 5/5] gnu: Add cbqn.
  2022-08-10 17:27 ` [bug#56989] [PATCH v5 1/5] gnu: Add dbqn package Christopher Rodriguez
                     ` (2 preceding siblings ...)
  2022-08-10 17:27   ` [bug#56989] [PATCH v5 4/5] gnu: Add singeli-sources Christopher Rodriguez
@ 2022-08-10 17:28   ` Christopher Rodriguez
  2022-08-31 21:10   ` bug#56989: bug#56993: [PATCH v1 5/5] gnu: bqn: " Ludovic Courtès
  4 siblings, 0 replies; 29+ messages in thread
From: Christopher Rodriguez @ 2022-08-10 17:28 UTC (permalink / raw)
  To: 56989; +Cc: Christopher Rodriguez

* gnu/packages/bqn.scm: Add cbqn package.
---
 gnu/packages/bqn.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index a87534fcd5..95bc2f2eab 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -169,3 +169,49 @@ (define singeli-sources
       (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)))))))
+    (native-inputs (list dbqn
+                         bqn-sources
+                         singeli-sources
+                         libffi
+                         clang-toolchain
+                         linux-libre-headers))))
-- 
2.37.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* bug#56989: bug#56993: [PATCH v1 5/5] gnu: bqn: Add cbqn.
  2022-08-10 17:27 ` [bug#56989] [PATCH v5 1/5] gnu: Add dbqn package Christopher Rodriguez
                     ` (3 preceding siblings ...)
  2022-08-10 17:28   ` [bug#56989] [PATCH v5 5/5] gnu: Add cbqn Christopher Rodriguez
@ 2022-08-31 21:10   ` Ludovic Courtès
  4 siblings, 0 replies; 29+ messages in thread
From: Ludovic Courtès @ 2022-08-31 21:10 UTC (permalink / raw)
  To: Christopher Rodriguez; +Cc: 56993-done, 56989-done

Hi Christopher,

Christopher Rodriguez <yewscion@gmail.com> skribis:

> * gnu/packages/bqn.scm: Create module.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Register module.

I applied the whole series with minor changes: adding newlines in
between definitions, tweaking descriptions, etc.

Thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2022-08-31 21:11 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05  2:20 [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
2022-08-05  2:20 ` [bug#56990] [PATCH v1 2/5] gnu: bqn: Add bqn-bytecode-sources Christopher Rodriguez
2022-08-05  2:20 ` [bug#56992] [PATCH v1 3/5] gnu: bqn: Add cbqn-bootstrap Christopher Rodriguez
2022-08-05  2:20 ` [bug#56991] [PATCH v1 4/5] gnu: bqn: Add singeli-bootstrap Christopher Rodriguez
2022-08-05  2:20 ` [bug#56993] [PATCH v1 5/5] gnu: bqn: Add cbqn Christopher Rodriguez
2022-08-05  5:46 ` [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
2022-08-05  7:15   ` Liliana Marie Prikler
2022-08-05 15:12     ` Christopher Rodriguez
2022-08-05 15:37       ` ( via Guix-patches via
2022-08-05 15:50         ` Christopher Rodriguez
2022-08-05 15:50         ` Christopher Rodriguez
2022-08-05 22:33       ` Liliana Marie Prikler
2022-08-06  1:47         ` Christopher Rodriguez
2022-08-06  2:20 ` [bug#56989] [PATCH v3] gnu: Add dbqn Christopher Rodriguez
2022-08-07 16:28   ` Liliana Marie Prikler
2022-08-08  9:19   ` Maxime Devos
2022-08-08 13:54     ` Christopher Rodriguez
2022-08-08 21:09       ` Maxime Devos
2022-08-09  8:58       ` Maxime Devos
2022-08-09  9:02         ` Maxime Devos
2022-08-07 14:43 ` [bug#56989] [PATCH v2] gnu: bqn: Add bqn.scm and dbqn package Christopher Rodriguez
2022-08-08  9:20 ` [bug#56989] [PATCH v1 1/5] " Maxime Devos
2022-08-09  1:22 ` [bug#56989] [PATCH v4] gnu: Add dbqn Christopher Rodriguez
2022-08-10 17:27 ` [bug#56989] [PATCH v5 1/5] gnu: Add dbqn package Christopher Rodriguez
2022-08-10 17:27   ` [bug#56989] [PATCH v5 2/5] gnu: Add bqn-sources Christopher Rodriguez
2022-08-10 17:27   ` [bug#56989] [PATCH v5 3/5] gnu: Add cbqn-bootstrap Christopher Rodriguez
2022-08-10 17:27   ` [bug#56989] [PATCH v5 4/5] gnu: Add singeli-sources Christopher Rodriguez
2022-08-10 17:28   ` [bug#56989] [PATCH v5 5/5] gnu: Add cbqn Christopher Rodriguez
2022-08-31 21:10   ` bug#56989: bug#56993: [PATCH v1 5/5] gnu: bqn: " Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.