unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#68355] [PATCH 0/8] guix: Add or1k-elf platform.
@ 2024-01-09 23:12 Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-09 23:14 ` [bug#68355] [PATCH 1/8] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
                   ` (8 more replies)
  0 siblings, 9 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-09 23:12 UTC (permalink / raw)
  To: 68355; +Cc: Jean-Pierre De Jesus DIAZ, Efraim Flashner, Vagrant Cascadian

This patch series adds the or1k-elf platform, a cross-gcc-toolchain
package for it and refactors the sole user of it to use GNU Guix
cross-compilation means (for MAKE-CRUST-PACKAGE).

The latter procedure has been split into MAKE-CRUST-TOOLS and
MAKE-CRUST-FIRMWARE since there's a part for the or1k-elf target
and other for the current system or target, adding to that the tools has
been disabled by default on the recent version by the upstream project
since the firmware should be loaded by U-Boot, however decided to build
the tool anyway to avoid breaking any users of this package, as a result
MAKE-CRUST-PACKAGE combines MAKE-CRUST-TOOLS and MAKE-CRUST-FIRMWARE.

Jean-Pierre De Jesus DIAZ (8):
  guix: Add ork1-elf platform.
  gnu: cross-gcc-toolchain: Use fixed name.
  gnu: Add gcc-cross-or1k-elf-toolchain.
  gnu: make-crust-package: Memoize.
  gnu: make-crust-package: Update to 0.6.
  gnu: make-crust-package: Use or1k-elf as target.
  gnu: Add make-crust-tools.
  gnu: make-crust-package: Unite firmware and tools.

 Makefile.am                      |   1 +
 doc/guix.texi                    |   6 +
 gnu/packages/cross-base.scm      |   4 +-
 gnu/packages/cross-toolchain.scm |   3 +
 gnu/packages/firmware.scm        | 187 ++++++++++++++++++-------------
 guix/platforms/or1k.scm          |  28 +++++
 6 files changed, 152 insertions(+), 77 deletions(-)
 create mode 100644 guix/platforms/or1k.scm


base-commit: 8920cf302c5a2fd457a2629afe24cf4768f1fed7
-- 
2.41.0





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

* [bug#68355] [PATCH 1/8] guix: Add ork1-elf platform.
  2024-01-09 23:12 [bug#68355] [PATCH 0/8] guix: Add or1k-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-09 23:14 ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-12 20:22   ` Mathieu Othacehe
  2024-01-09 23:14 ` [bug#68355] [PATCH 2/8] gnu: cross-gcc-toolchain: Use fixed name Jean-Pierre De Jesus DIAZ via Guix-patches via
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-09 23:14 UTC (permalink / raw)
  To: 68355
  Cc: Jean-Pierre De Jesus DIAZ, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Ricardo Wurmus,
	Simon Tournier, Tobias Geerinckx-Rice

* Makefile.am (MODULES): Add guix/platforms/or1k.scm.

* doc/guix.texi: Document or1k-elf platform.

* guix/platforms/or1k.scm (or1k-elf): New variable.

Change-Id: I3f71a0fa97f1ebd2bbdbf6cd00a93b477a123648
---
 Makefile.am             |  1 +
 doc/guix.texi           |  6 ++++++
 guix/platforms/or1k.scm | 28 ++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)
 create mode 100644 guix/platforms/or1k.scm

diff --git a/Makefile.am b/Makefile.am
index b64dcaa77c..deee38232f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -140,6 +140,7 @@ MODULES =					\
   guix/platforms/arm.scm                        \
   guix/platforms/avr.scm                        \
   guix/platforms/mips.scm                       \
+  guix/platforms/or1k.scm                       \
   guix/platforms/powerpc.scm                    \
   guix/platforms/riscv.scm                      \
   guix/platforms/x86.scm                        \
diff --git a/doc/guix.texi b/doc/guix.texi
index 395545bed7..8b32722d64 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -16902,6 +16902,7 @@ Cross-Compilation
    - i686-linux-gnu
    - i686-w64-mingw32
    - mips64el-linux-gnu
+   - or1k-elf
    - powerpc-linux-gnu
    - powerpc64le-linux-gnu
    - riscv64-linux-gnu
@@ -46093,6 +46094,11 @@ Supported Platforms
 from AVR Libc.
 @end defvar
 
+@defvar or1k-elf
+Platform targeting OpenRISC 1000 CPU without an operating system and without a
+C standard library.
+@end defvar
+
 @node System Images
 @chapter Creating System Images
 
diff --git a/guix/platforms/or1k.scm b/guix/platforms/or1k.scm
new file mode 100644
index 0000000000..bf983085c5
--- /dev/null
+++ b/guix/platforms/or1k.scm
@@ -0,0 +1,28 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2024 Foundation Devices, Inc. <hello@foundationdevices.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 (guix platforms or1k)
+  #:use-module (guix platform)
+  #:use-module (guix records)
+  #:export (or1k-elf))
+
+(define or1k-elf
+  (platform
+   (target "or1k-elf")
+   (system #f)
+   (glibc-dynamic-linker #f)))
-- 
2.41.0





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

* [bug#68355] [PATCH 2/8] gnu: cross-gcc-toolchain: Use fixed name.
  2024-01-09 23:12 [bug#68355] [PATCH 0/8] guix: Add or1k-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-09 23:14 ` [bug#68355] [PATCH 1/8] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-09 23:14 ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-12 20:25   ` Mathieu Othacehe
  2024-01-09 23:14 ` [bug#68355] [PATCH 3/8] gnu: Add gcc-cross-or1k-elf-toolchain Jean-Pierre De Jesus DIAZ via Guix-patches via
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-09 23:14 UTC (permalink / raw)
  To: 68355; +Cc: Jean-Pierre De Jesus DIAZ, Ludovic Courtès

* gnu/packages/cross-base.scm (cross-gcc-toolchain) <name>: Always use
  gcc-cross- prefix regardless of TARGET having a C standard library or
  not.

Change-Id: I5cbe89c61e5bd324a385db17c27131ea5ef75669
---
 gnu/packages/cross-base.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 6ee7b315d8..6abf07be17 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -745,7 +745,9 @@ (define* (cross-gcc-toolchain/implementation target
   "Returns PACKAGE that contains a cross-compilation tool chain for TARGET
 with XBINUTILS, XGCC and LIBC (if exists for TARGET)."
   (package
-    (name (string-append (package-name xgcc) "-toolchain"))
+    ;; Using PACKAGE-NAME of XGCC is avoided here as there are platforms that still
+    ;; need a toolchain but don't have a libc.
+    (name (string-append "gcc-cross-" target "-toolchain"))
     (version (package-version xgcc))
     (source #f)
     (build-system trivial-build-system)
-- 
2.41.0





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

* [bug#68355] [PATCH 3/8] gnu: Add gcc-cross-or1k-elf-toolchain.
  2024-01-09 23:12 [bug#68355] [PATCH 0/8] guix: Add or1k-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-09 23:14 ` [bug#68355] [PATCH 1/8] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-09 23:14 ` [bug#68355] [PATCH 2/8] gnu: cross-gcc-toolchain: Use fixed name Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-09 23:14 ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-09 23:14 ` [bug#68355] [PATCH 4/8] gnu: make-crust-package: Memoize Jean-Pierre De Jesus DIAZ via Guix-patches via
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-09 23:14 UTC (permalink / raw)
  To: 68355; +Cc: Jean-Pierre De Jesus DIAZ

* gnu/packages/cross-toolchain.scm (gcc-cross-or1k-elf-toolchain): New
  variable.

Change-Id: Iaf7ed60dbbe116a5efbad8e94be9b2dee51faf15
---
 gnu/packages/cross-toolchain.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/cross-toolchain.scm b/gnu/packages/cross-toolchain.scm
index ab071e1005..5072462cbb 100644
--- a/gnu/packages/cross-toolchain.scm
+++ b/gnu/packages/cross-toolchain.scm
@@ -38,5 +38,8 @@ (define-public gcc-cross-avr-toolchain
 (define-public gcc-cross-i686-w64-mingw32-toolchain
   (cross-gcc-toolchain "i686-w64-mingw32"))
 
+(define-public gcc-cross-or1k-elf-toolchain
+  (cross-gcc-toolchain "or1k-elf"))
+
 (define-public gcc-cross-x86_64-w64-mingw32-toolchain
   (cross-gcc-toolchain "x86_64-w64-mingw32"))
-- 
2.41.0





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

* [bug#68355] [PATCH 4/8] gnu: make-crust-package: Memoize.
  2024-01-09 23:12 [bug#68355] [PATCH 0/8] guix: Add or1k-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
                   ` (2 preceding siblings ...)
  2024-01-09 23:14 ` [bug#68355] [PATCH 3/8] gnu: Add gcc-cross-or1k-elf-toolchain Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-09 23:14 ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-09 23:14 ` [bug#68355] [PATCH 5/8] gnu: make-crust-package: Update to 0.6 Jean-Pierre De Jesus DIAZ via Guix-patches via
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-09 23:14 UTC (permalink / raw)
  To: 68355; +Cc: Jean-Pierre De Jesus DIAZ, Efraim Flashner, Vagrant Cascadian

* gnu/packages/firmware.scm (make-crust-package): Use mlambda.

Change-Id: I2d916b96bc650f3731a69505e086cf8f8f470809
---
 gnu/packages/firmware.scm | 153 +++++++++++++++++++-------------------
 1 file changed, 77 insertions(+), 76 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index e691bf33da..5567bcfe45 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1190,81 +1190,82 @@ (define-public arm-trusted-firmware-imx8mq
           ;; Adding debug symbols causes the size to exceed limits.
           #~(delete "DEBUG=1" #$flags)))))))
 
-(define (make-crust-package platform)
-  (package
-    (name (string-append "crust-"
-                         (string-replace-substring platform "_" "-")))
-    (version "0.5")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             ;; There are only GitHub generated release snapshots.
-             (url "https://github.com/crust-firmware/crust")
-             (commit (string-append "v" version))))
-       (file-name (git-file-name "crust" version))
-       (sha256
-        (base32
-         "0xgbbhifg3miwd3yp6jq9kp7nqgz5gzy00w95vba45j8jk5vjvvz"))))
-    (build-system gnu-build-system)
-    (arguments
-     (list
-      #:tests? #f                       ;no test suite
-      #:make-flags
-      (let ((triplet-without-vendor
-             (and (%current-target-system)
-                  ;; TODO: Is there a use case for allowing this?
-                  (not (target-avr?))
-                  (match (string-split (nix-system->gnu-triplet
-                                        (%current-target-system)) #\-)
-                    ((arch vendor os ..1)
-                     (string-join `(,arch ,@os) "-"))))))
-        #~(list "CROSS_COMPILE=or1k-elf-"
-                "V=1"
-                #$@(if triplet-without-vendor
-                       ;; We are cross-compiling the tools, intended to be
-                       ;; executable for the target system.
-                       (list (string-append "HOSTAR=" triplet-without-vendor
-                                            "-ar")
-                             (string-append "HOSTCC=" triplet-without-vendor
-                                            "-gcc"))
-                       ;; Not cross-compiling.
-                       (list "HOSTAR=ar"
-                             "HOSTCC=gcc"))
-                "LEX=flex"))
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-after 'unpack 'do-not-build-tests
-            (lambda _
-              ;; Attempting to build the tools test binary on a non-aarch64
-              ;; architecture fails with: "No cache cleaning implementation
-              ;; available for this architecture".  Avoid building it (see:
-              ;; https://github.com/crust-firmware/crust/issues/182).
-              (substitute* "tools/Makefile"
-                (("tools-y \\+= test") ""))))
-          (delete 'configure)
-          (add-before 'build 'defconfig
-            (lambda* (#:key make-flags #:allow-other-keys)
-              (let ((config-name (string-append #$platform "_defconfig")))
-                (apply invoke "make" (cons config-name make-flags)))))
-          (replace 'install
-            (lambda _
-              (for-each (lambda (file)
-                          (install-file file (string-append #$output
-                                                            "/libexec")))
-                        (find-files "." "(scp\\.bin|\\.config)$"))
-              (install-file "build/tools/load"
-                            (string-append #$output "/bin")))))))
-    ;; The firmware is cross-compiled using a "bare bones" compiler (no libc).
-    ;; Use our own tool chain for that.
-    (native-inputs
-     (list bison
-           (cross-gcc "or1k-elf")
-           (cross-binutils "or1k-elf")
-           flex))
-    (home-page "https://github.com/crust-firmware/crust")
-    (synopsis "System control processor firmware for Allwinner sunxi boards")
-    (description "Crust improves battery life and thermal performance by
+(define make-crust-package
+  (mlambda (platform)
+    (package
+      (name (string-append "crust-"
+                           (string-replace-substring platform "_" "-")))
+      (version "0.5")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               ;; There are only GitHub generated release snapshots.
+               (url "https://github.com/crust-firmware/crust")
+               (commit (string-append "v" version))))
+         (file-name (git-file-name "crust" version))
+         (sha256
+          (base32
+           "0xgbbhifg3miwd3yp6jq9kp7nqgz5gzy00w95vba45j8jk5vjvvz"))))
+      (build-system gnu-build-system)
+      (arguments
+       (list
+        #:tests? #f                       ;no test suite
+        #:make-flags
+        (let ((triplet-without-vendor
+               (and (%current-target-system)
+                    ;; TODO: Is there a use case for allowing this?
+                    (not (target-avr?))
+                    (match (string-split (nix-system->gnu-triplet
+                                          (%current-target-system)) #\-)
+                      ((arch vendor os ..1)
+                       (string-join `(,arch ,@os) "-"))))))
+          #~(list "CROSS_COMPILE=or1k-elf-"
+                  "V=1"
+                  #$@(if triplet-without-vendor
+                         ;; We are cross-compiling the tools, intended to be
+                         ;; executable for the target system.
+                         (list (string-append "HOSTAR=" triplet-without-vendor
+                                              "-ar")
+                               (string-append "HOSTCC=" triplet-without-vendor
+                                              "-gcc"))
+                         ;; Not cross-compiling.
+                         (list "HOSTAR=ar"
+                               "HOSTCC=gcc"))
+                  "LEX=flex"))
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'do-not-build-tests
+              (lambda _
+                ;; Attempting to build the tools test binary on a non-aarch64
+                ;; architecture fails with: "No cache cleaning implementation
+                ;; available for this architecture".  Avoid building it (see:
+                ;; https://github.com/crust-firmware/crust/issues/182).
+                (substitute* "tools/Makefile"
+                  (("tools-y \\+= test") ""))))
+            (delete 'configure)
+            (add-before 'build 'defconfig
+              (lambda* (#:key make-flags #:allow-other-keys)
+                (let ((config-name (string-append #$platform "_defconfig")))
+                  (apply invoke "make" (cons config-name make-flags)))))
+            (replace 'install
+              (lambda _
+                (for-each (lambda (file)
+                            (install-file file (string-append #$output
+                                                              "/libexec")))
+                          (find-files "." "(scp\\.bin|\\.config)$"))
+                (install-file "build/tools/load"
+                              (string-append #$output "/bin")))))))
+      ;; The firmware is cross-compiled using a "bare bones" compiler (no libc).
+      ;; Use our own tool chain for that.
+      (native-inputs
+       (list bison
+             (cross-gcc "or1k-elf")
+             (cross-binutils "or1k-elf")
+             flex))
+      (home-page "https://github.com/crust-firmware/crust")
+      (synopsis "System control processor firmware for Allwinner sunxi boards")
+      (description "Crust improves battery life and thermal performance by
 implementing a deep sleep state.  During deep sleep, the CPU cores, the DRAM
 controller, and most onboard peripherals are powered down, reducing power
 consumption by 80% or more compared to an idle device.  On boards without a
@@ -1274,7 +1275,7 @@ (define (make-crust-package platform)
 Crust is designed to run on a specific SCP implementation, Allwinner's
 AR100.")
     ;; Most files are dual-licensed "BSD-3 OR GPL2", a few are GPL2 only.
-    (license (list license:bsd-3 license:gpl2))))
+    (license (list license:bsd-3 license:gpl2)))))
 
 (define-public crust-pinebook
   (make-crust-package "pinebook"))
-- 
2.41.0





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

* [bug#68355] [PATCH 5/8] gnu: make-crust-package: Update to 0.6.
  2024-01-09 23:12 [bug#68355] [PATCH 0/8] guix: Add or1k-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
                   ` (3 preceding siblings ...)
  2024-01-09 23:14 ` [bug#68355] [PATCH 4/8] gnu: make-crust-package: Memoize Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-09 23:14 ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-12 20:26   ` Mathieu Othacehe
  2024-01-09 23:14 ` [bug#68355] [PATCH 6/8] gnu: make-crust-package: Use or1k-elf as target Jean-Pierre De Jesus DIAZ via Guix-patches via
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-09 23:14 UTC (permalink / raw)
  To: 68355; +Cc: Jean-Pierre De Jesus DIAZ, Efraim Flashner, Vagrant Cascadian

* gnu/packages/firmware.scm (make-crust-package): Update to 0.6.

* gnu/packages/firmware.scm (make-crust-package): Do not install host
  tool as it is not built by default.

Change-Id: Ia79ae8208589601d32235f6d8ace9dce3f8d74f9
---
 gnu/packages/firmware.scm | 42 ++++++++-------------------------------
 1 file changed, 8 insertions(+), 34 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 5567bcfe45..30422a573c 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1195,7 +1195,7 @@ (define make-crust-package
     (package
       (name (string-append "crust-"
                            (string-replace-substring platform "_" "-")))
-      (version "0.5")
+      (version "0.6")
       (source
        (origin
          (method git-fetch)
@@ -1206,43 +1206,19 @@ (define make-crust-package
          (file-name (git-file-name "crust" version))
          (sha256
           (base32
-           "0xgbbhifg3miwd3yp6jq9kp7nqgz5gzy00w95vba45j8jk5vjvvz"))))
+           "1blq6bi2rmg4qqwwr07pamv28b50mwcsybhpn9bws8vbzxa43afd"))))
       (build-system gnu-build-system)
       (arguments
        (list
         #:tests? #f                       ;no test suite
         #:make-flags
-        (let ((triplet-without-vendor
-               (and (%current-target-system)
-                    ;; TODO: Is there a use case for allowing this?
-                    (not (target-avr?))
-                    (match (string-split (nix-system->gnu-triplet
-                                          (%current-target-system)) #\-)
-                      ((arch vendor os ..1)
-                       (string-join `(,arch ,@os) "-"))))))
-          #~(list "CROSS_COMPILE=or1k-elf-"
-                  "V=1"
-                  #$@(if triplet-without-vendor
-                         ;; We are cross-compiling the tools, intended to be
-                         ;; executable for the target system.
-                         (list (string-append "HOSTAR=" triplet-without-vendor
-                                              "-ar")
-                               (string-append "HOSTCC=" triplet-without-vendor
-                                              "-gcc"))
-                         ;; Not cross-compiling.
-                         (list "HOSTAR=ar"
-                               "HOSTCC=gcc"))
-                  "LEX=flex"))
+        #~(list "CROSS_COMPILE=or1k-elf-"
+                "V=1"
+                "HOSTAR=ar"
+                "HOSTCC=gcc"
+                "LEX=flex")
         #:phases
         #~(modify-phases %standard-phases
-            (add-after 'unpack 'do-not-build-tests
-              (lambda _
-                ;; Attempting to build the tools test binary on a non-aarch64
-                ;; architecture fails with: "No cache cleaning implementation
-                ;; available for this architecture".  Avoid building it (see:
-                ;; https://github.com/crust-firmware/crust/issues/182).
-                (substitute* "tools/Makefile"
-                  (("tools-y \\+= test") ""))))
             (delete 'configure)
             (add-before 'build 'defconfig
               (lambda* (#:key make-flags #:allow-other-keys)
@@ -1253,9 +1229,7 @@ (define make-crust-package
                 (for-each (lambda (file)
                             (install-file file (string-append #$output
                                                               "/libexec")))
-                          (find-files "." "(scp\\.bin|\\.config)$"))
-                (install-file "build/tools/load"
-                              (string-append #$output "/bin")))))))
+                          (find-files "." "(scp\\.bin|\\.config)$")))))))
       ;; The firmware is cross-compiled using a "bare bones" compiler (no libc).
       ;; Use our own tool chain for that.
       (native-inputs
-- 
2.41.0





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

* [bug#68355] [PATCH 6/8] gnu: make-crust-package: Use or1k-elf as target.
  2024-01-09 23:12 [bug#68355] [PATCH 0/8] guix: Add or1k-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
                   ` (4 preceding siblings ...)
  2024-01-09 23:14 ` [bug#68355] [PATCH 5/8] gnu: make-crust-package: Update to 0.6 Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-09 23:14 ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-09 23:14 ` [bug#68355] [PATCH 7/8] gnu: Add make-crust-tools Jean-Pierre De Jesus DIAZ via Guix-patches via
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-09 23:14 UTC (permalink / raw)
  To: 68355; +Cc: Jean-Pierre De Jesus DIAZ, Efraim Flashner, Vagrant Cascadian

* gnu/packages/firmware.scm (make-crust-package): Use or1k-elf as the
  target.

Change-Id: I6c8bf053527f1e12e35402f18cebf8e75557c788
---
 gnu/packages/firmware.scm | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 30422a573c..e62f29993a 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1210,13 +1210,13 @@ (define make-crust-package
       (build-system gnu-build-system)
       (arguments
        (list
+        #:target "or1k-elf"
         #:tests? #f                       ;no test suite
-        #:make-flags
-        #~(list "CROSS_COMPILE=or1k-elf-"
-                "V=1"
-                "HOSTAR=ar"
-                "HOSTCC=gcc"
-                "LEX=flex")
+        #:make-flags #~'("CROSS_COMPILE=or1k-elf-"
+                         "V=1"
+                         "HOSTAR=ar"
+                         "HOSTCC=gcc"
+                         "LEX=flex")
         #:phases
         #~(modify-phases %standard-phases
             (delete 'configure)
@@ -1230,13 +1230,7 @@ (define make-crust-package
                             (install-file file (string-append #$output
                                                               "/libexec")))
                           (find-files "." "(scp\\.bin|\\.config)$")))))))
-      ;; The firmware is cross-compiled using a "bare bones" compiler (no libc).
-      ;; Use our own tool chain for that.
-      (native-inputs
-       (list bison
-             (cross-gcc "or1k-elf")
-             (cross-binutils "or1k-elf")
-             flex))
+      (native-inputs (list bison flex))
       (home-page "https://github.com/crust-firmware/crust")
       (synopsis "System control processor firmware for Allwinner sunxi boards")
       (description "Crust improves battery life and thermal performance by
-- 
2.41.0





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

* [bug#68355] [PATCH 7/8] gnu: Add make-crust-tools.
  2024-01-09 23:12 [bug#68355] [PATCH 0/8] guix: Add or1k-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
                   ` (5 preceding siblings ...)
  2024-01-09 23:14 ` [bug#68355] [PATCH 6/8] gnu: make-crust-package: Use or1k-elf as target Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-09 23:14 ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-12 20:30   ` Mathieu Othacehe
  2024-01-09 23:14 ` [bug#68355] [PATCH 8/8] gnu: make-crust-package: Unite firmware and tools Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-19 13:54 ` [bug#68355] [PATCH v2 1/9] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
  8 siblings, 1 reply; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-09 23:14 UTC (permalink / raw)
  To: 68355; +Cc: Jean-Pierre De Jesus DIAZ, Efraim Flashner, Vagrant Cascadian

* gnu/packages/firmware.scm (make-crust-tools): New procedure.

Change-Id: Iac05ecf1796e4c10692a423c12423ea9b078d141
---
 gnu/packages/firmware.scm | 42 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index e62f29993a..c3deab5224 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1245,6 +1245,48 @@ (define make-crust-package
     ;; Most files are dual-licensed "BSD-3 OR GPL2", a few are GPL2 only.
     (license (list license:bsd-3 license:gpl2)))))
 
+(define make-crust-tools
+  (mlambda (platform firmware)
+    (package
+      (inherit firmware)
+      (name (string-append "crust-"
+                           (string-replace-substring platform "_" "-")
+                           "-tools"))
+      (arguments
+       (list #:make-flags
+             #~(list "V=1"
+                     "LEX=flex"
+                     (string-append "HOSTAR=" #$(ar-for-target))
+                     (string-append "HOSTCC=" #$(cc-for-target)))
+             #:phases
+             #~(modify-phases %standard-phases
+                 (add-after 'unpack 'do-not-build-tests
+                   (lambda _
+                     ;; Attempting to build the tools test binary on a
+                     ;; non-aarch64 architecture fails with: "No cache
+                     ;; cleaning implementation available for this
+                     ;; architecture".  Avoid building it (see:
+                     ;; https://github.com/crust-firmware/crust/issues/182).
+                     (substitute* "tools/Makefile"
+                       (("tools-y \\+= test") ""))))
+                 (replace 'configure
+                   (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                     (copy-file (search-input-file inputs "/libexec/.config")
+                                ".config")))
+                 (replace 'build
+                   (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+                     (apply invoke "make" "tools"
+                            `(,@(if parallel-build?
+                                    `("-j" ,(number->string (parallel-job-count)))
+                                     '())
+                              ,@make-flags))))
+                 (replace 'install
+                   (lambda _
+                     (install-file "build/tools/load"
+                                   (string-append #$output "/bin")))))))
+      (synopsis "System control processor firmware for Allwinner sunxi boards (tools)")
+      (inputs (list firmware)))))
+
 (define-public crust-pinebook
   (make-crust-package "pinebook"))
 
-- 
2.41.0





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

* [bug#68355] [PATCH 8/8] gnu: make-crust-package: Unite firmware and tools.
  2024-01-09 23:12 [bug#68355] [PATCH 0/8] guix: Add or1k-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
                   ` (6 preceding siblings ...)
  2024-01-09 23:14 ` [bug#68355] [PATCH 7/8] gnu: Add make-crust-tools Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-09 23:14 ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-19 13:54 ` [bug#68355] [PATCH v2 1/9] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
  8 siblings, 0 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-09 23:14 UTC (permalink / raw)
  To: 68355; +Cc: Jean-Pierre De Jesus DIAZ, Efraim Flashner, Vagrant Cascadian

* gnu/packages/firmware.scm (make-crust-package): Perform union of
  make-crust-firmware and make-crust-tools.

* gnu/packages/firmware.scm (make-crust-firmware): New procedure.

Change-Id: I687bb6d53aae9bd60ed988baf9d17e92f31faa7b
---
 gnu/packages/firmware.scm | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index c3deab5224..71444f190d 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1190,11 +1190,12 @@ (define-public arm-trusted-firmware-imx8mq
           ;; Adding debug symbols causes the size to exceed limits.
           #~(delete "DEBUG=1" #$flags)))))))
 
-(define make-crust-package
+(define make-crust-firmware
   (mlambda (platform)
     (package
       (name (string-append "crust-"
-                           (string-replace-substring platform "_" "-")))
+                           (string-replace-substring platform "_" "-")
+                           "-firmware"))
       (version "0.6")
       (source
        (origin
@@ -1287,6 +1288,29 @@ (define make-crust-tools
       (synopsis "System control processor firmware for Allwinner sunxi boards (tools)")
       (inputs (list firmware)))))
 
+(define make-crust-package
+  (mlambda (platform)
+    (let* ((firmware (make-crust-firmware platform))
+           (tools (make-crust-tools platform firmware)))
+      (package
+        (inherit firmware)
+        (name (string-append "crust-"
+                             (string-replace-substring platform "_" "-")))
+        (source #f)
+        (build-system trivial-build-system)
+        (arguments
+         (list #:modules '((guix build union))
+               #:builder
+               #~(begin
+                   (use-modules (ice-9 match)
+                                (guix build union))
+
+                   (match %build-inputs
+                     (((names . directory) ...)
+                      (union-build #$output directory))))))
+        (native-inputs '())
+        (inputs (list firmware tools))))))
+
 (define-public crust-pinebook
   (make-crust-package "pinebook"))
 
-- 
2.41.0





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

* [bug#68355] [PATCH 1/8] guix: Add ork1-elf platform.
  2024-01-09 23:14 ` [bug#68355] [PATCH 1/8] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-12 20:22   ` Mathieu Othacehe
  0 siblings, 0 replies; 23+ messages in thread
From: Mathieu Othacehe @ 2024-01-12 20:22 UTC (permalink / raw)
  To: Jean-Pierre De Jesus DIAZ
  Cc: Josselin Poiret, 68355, Simon Tournier, Ludovic Courtès,
	Tobias Geerinckx-Rice, Ricardo Wurmus, Christopher Baines


Hello,

This looks good and I have only cosmetic remarks.

> * Makefile.am (MODULES): Add guix/platforms/or1k.scm.
>
> * doc/guix.texi: Document or1k-elf platform.

No new line between those commit log entries.

Thanks,

Mathieu




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

* [bug#68355] [PATCH 2/8] gnu: cross-gcc-toolchain: Use fixed name.
  2024-01-09 23:14 ` [bug#68355] [PATCH 2/8] gnu: cross-gcc-toolchain: Use fixed name Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-12 20:25   ` Mathieu Othacehe
  0 siblings, 0 replies; 23+ messages in thread
From: Mathieu Othacehe @ 2024-01-12 20:25 UTC (permalink / raw)
  To: Jean-Pierre De Jesus DIAZ; +Cc: Ludovic Courtès, 68355


> * gnu/packages/cross-base.scm (cross-gcc-toolchain) <name>: Always use
>   gcc-cross- prefix regardless of TARGET having a C standard library or
>   not.
  ^
  no alignment here

> -    (name (string-append (package-name xgcc) "-toolchain"))
> +    ;; Using PACKAGE-NAME of XGCC is avoided here as there are platforms that still
> +    ;; need a toolchain but don't have a libc.

There is a 78 columns limit. If you are using Emacs, you can enable
whitespace mode to display the characters that are over the limit, then
use `fill-paragraph` to have Emacs fix it for you.

Thanks,

Mathieu




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

* [bug#68355] [PATCH 5/8] gnu: make-crust-package: Update to 0.6.
  2024-01-09 23:14 ` [bug#68355] [PATCH 5/8] gnu: make-crust-package: Update to 0.6 Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-12 20:26   ` Mathieu Othacehe
  0 siblings, 0 replies; 23+ messages in thread
From: Mathieu Othacehe @ 2024-01-12 20:26 UTC (permalink / raw)
  To: Jean-Pierre De Jesus DIAZ; +Cc: Vagrant Cascadian, 68355, Efraim Flashner


> * gnu/packages/firmware.scm (make-crust-package): Update to 0.6.
>

No new line.

> * gnu/packages/firmware.scm (make-crust-package): Do not install host
>   tool as it is not built by default.
  ^
  no indent

here and in other patches.

Thanks,

Mathieu




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

* [bug#68355] [PATCH 7/8] gnu: Add make-crust-tools.
  2024-01-09 23:14 ` [bug#68355] [PATCH 7/8] gnu: Add make-crust-tools Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-12 20:30   ` Mathieu Othacehe
  0 siblings, 0 replies; 23+ messages in thread
From: Mathieu Othacehe @ 2024-01-12 20:30 UTC (permalink / raw)
  To: Jean-Pierre De Jesus DIAZ; +Cc: Vagrant Cascadian, 68355, Efraim Flashner

>  
> +                 (replace 'configure
> +                   (lambda* (#:key inputs native-inputs #:allow-other-keys)
> +                     (copy-file (search-input-file inputs "/libexec/.config")
> +                                ".config")))
> +                 (replace 'build
> +                   (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
> +                     (apply invoke "make" "tools"
> +                            `(,@(if parallel-build?
> +                                    `("-j" ,(number->string (parallel-job-count)))
> +                                     '())
> +                              ,@make-flags))))

Please wrap everything above the 78 columns limit.

> +                 (replace 'install
> +                   (lambda _
> +                     (install-file "build/tools/load"
> +                                   (string-append #$output "/bin")))))))
> +      (synopsis "System control processor firmware for Allwinner sunxi boards (tools)")

This synopsis is too long (>= 80 characters). Fixing it implies to fix
the one of make-crust-firmware I guess.

Thanks,

Mathieu




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

* [bug#68355] [PATCH v2 1/9] guix: Add ork1-elf platform.
  2024-01-09 23:12 [bug#68355] [PATCH 0/8] guix: Add or1k-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
                   ` (7 preceding siblings ...)
  2024-01-09 23:14 ` [bug#68355] [PATCH 8/8] gnu: make-crust-package: Unite firmware and tools Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-19 13:54 ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 2/9] gnu: cross-gcc-toolchain: Use fixed name Jean-Pierre De Jesus DIAZ via Guix-patches via
                     ` (8 more replies)
  8 siblings, 9 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-19 13:54 UTC (permalink / raw)
  To: 68355
  Cc: othacehe, Jean-Pierre De Jesus DIAZ, Christopher Baines,
	Josselin Poiret, Ludovic Courtès, Mathieu Othacehe,
	Ricardo Wurmus, Simon Tournier, Tobias Geerinckx-Rice

* doc/guix.texi: Document or1k-elf platform.
* guix/platforms/or1k.scm (or1k-elf): New variable.
* Makefile.am (MODULES): Add guix/platforms/or1k.scm.

Change-Id: I3f71a0fa97f1ebd2bbdbf6cd00a93b477a123648
---
 Makefile.am             |  1 +
 doc/guix.texi           |  6 ++++++
 guix/platforms/or1k.scm | 28 ++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)
 create mode 100644 guix/platforms/or1k.scm

diff --git a/Makefile.am b/Makefile.am
index d3b9532c7a..bdc97498aa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -140,6 +140,7 @@ MODULES =					\
   guix/platforms/arm.scm                        \
   guix/platforms/avr.scm                        \
   guix/platforms/mips.scm                       \
+  guix/platforms/or1k.scm                       \
   guix/platforms/powerpc.scm                    \
   guix/platforms/riscv.scm                      \
   guix/platforms/x86.scm                        \
diff --git a/doc/guix.texi b/doc/guix.texi
index ac17f91f7d..df6ce91736 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -16903,6 +16903,7 @@ Cross-Compilation
    - i686-linux-gnu
    - i686-w64-mingw32
    - mips64el-linux-gnu
+   - or1k-elf
    - powerpc-linux-gnu
    - powerpc64le-linux-gnu
    - riscv64-linux-gnu
@@ -46167,6 +46168,11 @@ Supported Platforms
 from AVR Libc.
 @end defvar
 
+@defvar or1k-elf
+Platform targeting OpenRISC 1000 CPU without an operating system and without a
+C standard library.
+@end defvar
+
 @node System Images
 @chapter Creating System Images
 
diff --git a/guix/platforms/or1k.scm b/guix/platforms/or1k.scm
new file mode 100644
index 0000000000..bf983085c5
--- /dev/null
+++ b/guix/platforms/or1k.scm
@@ -0,0 +1,28 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2024 Foundation Devices, Inc. <hello@foundationdevices.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 (guix platforms or1k)
+  #:use-module (guix platform)
+  #:use-module (guix records)
+  #:export (or1k-elf))
+
+(define or1k-elf
+  (platform
+   (target "or1k-elf")
+   (system #f)
+   (glibc-dynamic-linker #f)))

base-commit: 0eadd486484fcf9a234758842f74ba28361640db
-- 
2.41.0





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

* [bug#68355] [PATCH v2 2/9] gnu: cross-gcc-toolchain: Use fixed name.
  2024-01-19 13:54 ` [bug#68355] [PATCH v2 1/9] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-19 13:54   ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 3/9] gnu: Add gcc-cross-or1k-elf-toolchain Jean-Pierre De Jesus DIAZ via Guix-patches via
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-19 13:54 UTC (permalink / raw)
  To: 68355; +Cc: othacehe, Jean-Pierre De Jesus DIAZ, Ludovic Courtès

* gnu/packages/cross-base.scm (cross-gcc-toolchain) <name>: Always use
gcc-cross- prefix regardless of TARGET having a C standard library or not.

Change-Id: I5cbe89c61e5bd324a385db17c27131ea5ef75669
---
 gnu/packages/cross-base.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 6ee7b315d8..2d79e0acf6 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -745,7 +745,9 @@ (define* (cross-gcc-toolchain/implementation target
   "Returns PACKAGE that contains a cross-compilation tool chain for TARGET
 with XBINUTILS, XGCC and LIBC (if exists for TARGET)."
   (package
-    (name (string-append (package-name xgcc) "-toolchain"))
+    ;; Using PACKAGE-NAME of XGCC is avoided here as there are platforms that
+    ;; still need a toolchain but don't have a libc (e.g. or1k-elf).
+    (name (string-append "gcc-cross-" target "-toolchain"))
     (version (package-version xgcc))
     (source #f)
     (build-system trivial-build-system)
-- 
2.41.0





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

* [bug#68355] [PATCH v2 3/9] gnu: Add gcc-cross-or1k-elf-toolchain.
  2024-01-19 13:54 ` [bug#68355] [PATCH v2 1/9] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 2/9] gnu: cross-gcc-toolchain: Use fixed name Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-19 13:54   ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 4/9] gnu: make-crust-package: Use shorter synopsis Jean-Pierre De Jesus DIAZ via Guix-patches via
                     ` (6 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-19 13:54 UTC (permalink / raw)
  To: 68355; +Cc: othacehe, Jean-Pierre De Jesus DIAZ

* gnu/packages/cross-toolchain.scm (gcc-cross-or1k-elf-toolchain): New
variable.

Change-Id: Iaf7ed60dbbe116a5efbad8e94be9b2dee51faf15
---
 gnu/packages/cross-toolchain.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/packages/cross-toolchain.scm b/gnu/packages/cross-toolchain.scm
index ab071e1005..5072462cbb 100644
--- a/gnu/packages/cross-toolchain.scm
+++ b/gnu/packages/cross-toolchain.scm
@@ -38,5 +38,8 @@ (define-public gcc-cross-avr-toolchain
 (define-public gcc-cross-i686-w64-mingw32-toolchain
   (cross-gcc-toolchain "i686-w64-mingw32"))
 
+(define-public gcc-cross-or1k-elf-toolchain
+  (cross-gcc-toolchain "or1k-elf"))
+
 (define-public gcc-cross-x86_64-w64-mingw32-toolchain
   (cross-gcc-toolchain "x86_64-w64-mingw32"))
-- 
2.41.0





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

* [bug#68355] [PATCH v2 4/9] gnu: make-crust-package: Use shorter synopsis.
  2024-01-19 13:54 ` [bug#68355] [PATCH v2 1/9] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 2/9] gnu: cross-gcc-toolchain: Use fixed name Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 3/9] gnu: Add gcc-cross-or1k-elf-toolchain Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-19 13:54   ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 5/9] gnu: make-crust-package: Memoize Jean-Pierre De Jesus DIAZ via Guix-patches via
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-19 13:54 UTC (permalink / raw)
  To: 68355
  Cc: othacehe, Jean-Pierre De Jesus DIAZ, Efraim Flashner,
	Vagrant Cascadian

* gnu/packages/firmware.scm (make-crust-package) <synopsis>: Make it
short.

Change-Id: I8b93b25a9a6a75aaa92ffa590d0fd46a5511fd49
---
 gnu/packages/firmware.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 75294fadf4..533cbca550 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1270,7 +1270,7 @@ (define (make-crust-package platform)
            (cross-binutils "or1k-elf")
            flex))
     (home-page "https://github.com/crust-firmware/crust")
-    (synopsis "System control processor firmware for Allwinner sunxi boards")
+    (synopsis "Firmware for Allwinner sunxi SoCs")
     (description "Crust improves battery life and thermal performance by
 implementing a deep sleep state.  During deep sleep, the CPU cores, the DRAM
 controller, and most onboard peripherals are powered down, reducing power
-- 
2.41.0





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

* [bug#68355] [PATCH v2 5/9] gnu: make-crust-package: Memoize.
  2024-01-19 13:54 ` [bug#68355] [PATCH v2 1/9] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
                     ` (2 preceding siblings ...)
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 4/9] gnu: make-crust-package: Use shorter synopsis Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-19 13:54   ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 6/9] gnu: make-crust-package: Update to 0.6 Jean-Pierre De Jesus DIAZ via Guix-patches via
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-19 13:54 UTC (permalink / raw)
  To: 68355
  Cc: othacehe, Jean-Pierre De Jesus DIAZ, Efraim Flashner,
	Vagrant Cascadian

* gnu/packages/firmware.scm (make-crust-package): Use mlambda.

Change-Id: I2d916b96bc650f3731a69505e086cf8f8f470809
---
 gnu/packages/firmware.scm | 155 +++++++++++++++++++-------------------
 1 file changed, 78 insertions(+), 77 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 533cbca550..eb5251de5e 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1197,81 +1197,82 @@ (define-public arm-trusted-firmware-imx8mq
           ;; Adding debug symbols causes the size to exceed limits.
           #~(delete "DEBUG=1" #$flags)))))))
 
-(define (make-crust-package platform)
-  (package
-    (name (string-append "crust-"
-                         (string-replace-substring platform "_" "-")))
-    (version "0.5")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             ;; There are only GitHub generated release snapshots.
-             (url "https://github.com/crust-firmware/crust")
-             (commit (string-append "v" version))))
-       (file-name (git-file-name "crust" version))
-       (sha256
-        (base32
-         "0xgbbhifg3miwd3yp6jq9kp7nqgz5gzy00w95vba45j8jk5vjvvz"))))
-    (build-system gnu-build-system)
-    (arguments
-     (list
-      #:tests? #f                       ;no test suite
-      #:make-flags
-      (let ((triplet-without-vendor
-             (and (%current-target-system)
-                  ;; TODO: Is there a use case for allowing this?
-                  (not (target-avr?))
-                  (match (string-split (nix-system->gnu-triplet
-                                        (%current-target-system)) #\-)
-                    ((arch vendor os ..1)
-                     (string-join `(,arch ,@os) "-"))))))
-        #~(list "CROSS_COMPILE=or1k-elf-"
-                "V=1"
-                #$@(if triplet-without-vendor
-                       ;; We are cross-compiling the tools, intended to be
-                       ;; executable for the target system.
-                       (list (string-append "HOSTAR=" triplet-without-vendor
-                                            "-ar")
-                             (string-append "HOSTCC=" triplet-without-vendor
-                                            "-gcc"))
-                       ;; Not cross-compiling.
-                       (list "HOSTAR=ar"
-                             "HOSTCC=gcc"))
-                "LEX=flex"))
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-after 'unpack 'do-not-build-tests
-            (lambda _
-              ;; Attempting to build the tools test binary on a non-aarch64
-              ;; architecture fails with: "No cache cleaning implementation
-              ;; available for this architecture".  Avoid building it (see:
-              ;; https://github.com/crust-firmware/crust/issues/182).
-              (substitute* "tools/Makefile"
-                (("tools-y \\+= test") ""))))
-          (delete 'configure)
-          (add-before 'build 'defconfig
-            (lambda* (#:key make-flags #:allow-other-keys)
-              (let ((config-name (string-append #$platform "_defconfig")))
-                (apply invoke "make" (cons config-name make-flags)))))
-          (replace 'install
-            (lambda _
-              (for-each (lambda (file)
-                          (install-file file (string-append #$output
-                                                            "/libexec")))
-                        (find-files "." "(scp\\.bin|\\.config)$"))
-              (install-file "build/tools/load"
-                            (string-append #$output "/bin")))))))
-    ;; The firmware is cross-compiled using a "bare bones" compiler (no libc).
-    ;; Use our own tool chain for that.
-    (native-inputs
-     (list bison
-           (cross-gcc "or1k-elf")
-           (cross-binutils "or1k-elf")
-           flex))
-    (home-page "https://github.com/crust-firmware/crust")
-    (synopsis "Firmware for Allwinner sunxi SoCs")
-    (description "Crust improves battery life and thermal performance by
+(define make-crust-package
+  (mlambda (platform)
+    (package
+      (name (string-append "crust-"
+                           (string-replace-substring platform "_" "-")))
+      (version "0.5")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               ;; There are only GitHub generated release snapshots.
+               (url "https://github.com/crust-firmware/crust")
+               (commit (string-append "v" version))))
+         (file-name (git-file-name "crust" version))
+         (sha256
+          (base32
+           "0xgbbhifg3miwd3yp6jq9kp7nqgz5gzy00w95vba45j8jk5vjvvz"))))
+      (build-system gnu-build-system)
+      (arguments
+       (list
+        #:tests? #f                       ;no test suite
+        #:make-flags
+        (let ((triplet-without-vendor
+               (and (%current-target-system)
+                    ;; TODO: Is there a use case for allowing this?
+                    (not (target-avr?))
+                    (match (string-split (nix-system->gnu-triplet
+                                          (%current-target-system)) #\-)
+                      ((arch vendor os ..1)
+                       (string-join `(,arch ,@os) "-"))))))
+          #~(list "CROSS_COMPILE=or1k-elf-"
+                  "V=1"
+                  #$@(if triplet-without-vendor
+                         ;; We are cross-compiling the tools, intended to be
+                         ;; executable for the target system.
+                         (list (string-append "HOSTAR=" triplet-without-vendor
+                                              "-ar")
+                               (string-append "HOSTCC=" triplet-without-vendor
+                                              "-gcc"))
+                         ;; Not cross-compiling.
+                         (list "HOSTAR=ar"
+                               "HOSTCC=gcc"))
+                  "LEX=flex"))
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'do-not-build-tests
+              (lambda _
+                ;; Attempting to build the tools test binary on a non-aarch64
+                ;; architecture fails with: "No cache cleaning implementation
+                ;; available for this architecture".  Avoid building it (see:
+                ;; https://github.com/crust-firmware/crust/issues/182).
+                (substitute* "tools/Makefile"
+                  (("tools-y \\+= test") ""))))
+            (delete 'configure)
+            (add-before 'build 'defconfig
+              (lambda* (#:key make-flags #:allow-other-keys)
+                (let ((config-name (string-append #$platform "_defconfig")))
+                  (apply invoke "make" (cons config-name make-flags)))))
+            (replace 'install
+              (lambda _
+                (for-each (lambda (file)
+                            (install-file file (string-append #$output
+                                                              "/libexec")))
+                          (find-files "." "(scp\\.bin|\\.config)$"))
+                (install-file "build/tools/load"
+                              (string-append #$output "/bin")))))))
+      ;; The firmware is cross-compiled using a "bare bones" compiler (no libc).
+      ;; Use our own tool chain for that.
+      (native-inputs
+       (list bison
+             (cross-gcc "or1k-elf")
+             (cross-binutils "or1k-elf")
+             flex))
+      (home-page "https://github.com/crust-firmware/crust")
+      (synopsis "Firmware for Allwinner sunxi SoCs")
+      (description "Crust improves battery life and thermal performance by
 implementing a deep sleep state.  During deep sleep, the CPU cores, the DRAM
 controller, and most onboard peripherals are powered down, reducing power
 consumption by 80% or more compared to an idle device.  On boards without a
@@ -1280,8 +1281,8 @@ (define (make-crust-package platform)
 dedicated always-on microprocessor called a System Control Processor (SCP).
 Crust is designed to run on a specific SCP implementation, Allwinner's
 AR100.")
-    ;; Most files are dual-licensed "BSD-3 OR GPL2", a few are GPL2 only.
-    (license (list license:bsd-3 license:gpl2))))
+      ;; Most files are dual-licensed "BSD-3 OR GPL2", a few are GPL2 only.
+      (license (list license:bsd-3 license:gpl2)))))
 
 (define-public crust-pinebook
   (make-crust-package "pinebook"))
-- 
2.41.0





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

* [bug#68355] [PATCH v2 6/9] gnu: make-crust-package: Update to 0.6.
  2024-01-19 13:54 ` [bug#68355] [PATCH v2 1/9] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
                     ` (3 preceding siblings ...)
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 5/9] gnu: make-crust-package: Memoize Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-19 13:54   ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 7/9] gnu: make-crust-package: Use or1k-elf as target Jean-Pierre De Jesus DIAZ via Guix-patches via
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-19 13:54 UTC (permalink / raw)
  To: 68355
  Cc: othacehe, Jean-Pierre De Jesus DIAZ, Efraim Flashner,
	Vagrant Cascadian

* gnu/packages/firmware.scm (make-crust-package): Update to 0.6.  Do not
install host tool as it is not built by default.

Change-Id: Ia79ae8208589601d32235f6d8ace9dce3f8d74f9
---
 gnu/packages/firmware.scm | 42 ++++++++-------------------------------
 1 file changed, 8 insertions(+), 34 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index eb5251de5e..a2e3f785d5 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1202,7 +1202,7 @@ (define make-crust-package
     (package
       (name (string-append "crust-"
                            (string-replace-substring platform "_" "-")))
-      (version "0.5")
+      (version "0.6")
       (source
        (origin
          (method git-fetch)
@@ -1213,43 +1213,19 @@ (define make-crust-package
          (file-name (git-file-name "crust" version))
          (sha256
           (base32
-           "0xgbbhifg3miwd3yp6jq9kp7nqgz5gzy00w95vba45j8jk5vjvvz"))))
+           "1blq6bi2rmg4qqwwr07pamv28b50mwcsybhpn9bws8vbzxa43afd"))))
       (build-system gnu-build-system)
       (arguments
        (list
         #:tests? #f                       ;no test suite
         #:make-flags
-        (let ((triplet-without-vendor
-               (and (%current-target-system)
-                    ;; TODO: Is there a use case for allowing this?
-                    (not (target-avr?))
-                    (match (string-split (nix-system->gnu-triplet
-                                          (%current-target-system)) #\-)
-                      ((arch vendor os ..1)
-                       (string-join `(,arch ,@os) "-"))))))
-          #~(list "CROSS_COMPILE=or1k-elf-"
-                  "V=1"
-                  #$@(if triplet-without-vendor
-                         ;; We are cross-compiling the tools, intended to be
-                         ;; executable for the target system.
-                         (list (string-append "HOSTAR=" triplet-without-vendor
-                                              "-ar")
-                               (string-append "HOSTCC=" triplet-without-vendor
-                                              "-gcc"))
-                         ;; Not cross-compiling.
-                         (list "HOSTAR=ar"
-                               "HOSTCC=gcc"))
-                  "LEX=flex"))
+        #~(list "CROSS_COMPILE=or1k-elf-"
+                "V=1"
+                "HOSTAR=ar"
+                "HOSTCC=gcc"
+                "LEX=flex")
         #:phases
         #~(modify-phases %standard-phases
-            (add-after 'unpack 'do-not-build-tests
-              (lambda _
-                ;; Attempting to build the tools test binary on a non-aarch64
-                ;; architecture fails with: "No cache cleaning implementation
-                ;; available for this architecture".  Avoid building it (see:
-                ;; https://github.com/crust-firmware/crust/issues/182).
-                (substitute* "tools/Makefile"
-                  (("tools-y \\+= test") ""))))
             (delete 'configure)
             (add-before 'build 'defconfig
               (lambda* (#:key make-flags #:allow-other-keys)
@@ -1260,9 +1236,7 @@ (define make-crust-package
                 (for-each (lambda (file)
                             (install-file file (string-append #$output
                                                               "/libexec")))
-                          (find-files "." "(scp\\.bin|\\.config)$"))
-                (install-file "build/tools/load"
-                              (string-append #$output "/bin")))))))
+                          (find-files "." "(scp\\.bin|\\.config)$")))))))
       ;; The firmware is cross-compiled using a "bare bones" compiler (no libc).
       ;; Use our own tool chain for that.
       (native-inputs
-- 
2.41.0





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

* [bug#68355] [PATCH v2 7/9] gnu: make-crust-package: Use or1k-elf as target.
  2024-01-19 13:54 ` [bug#68355] [PATCH v2 1/9] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
                     ` (4 preceding siblings ...)
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 6/9] gnu: make-crust-package: Update to 0.6 Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-19 13:54   ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 8/9] gnu: Add make-crust-tools Jean-Pierre De Jesus DIAZ via Guix-patches via
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-19 13:54 UTC (permalink / raw)
  To: 68355
  Cc: othacehe, Jean-Pierre De Jesus DIAZ, Efraim Flashner,
	Vagrant Cascadian

* gnu/packages/firmware.scm (make-crust-package): Use or1k-elf as the
target.

Change-Id: I6c8bf053527f1e12e35402f18cebf8e75557c788
---
 gnu/packages/firmware.scm | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index a2e3f785d5..129dd0dfdd 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1217,13 +1217,13 @@ (define make-crust-package
       (build-system gnu-build-system)
       (arguments
        (list
+        #:target "or1k-elf"
         #:tests? #f                       ;no test suite
-        #:make-flags
-        #~(list "CROSS_COMPILE=or1k-elf-"
-                "V=1"
-                "HOSTAR=ar"
-                "HOSTCC=gcc"
-                "LEX=flex")
+        #:make-flags #~'("CROSS_COMPILE=or1k-elf-"
+                         "V=1"
+                         "HOSTAR=ar"
+                         "HOSTCC=gcc"
+                         "LEX=flex")
         #:phases
         #~(modify-phases %standard-phases
             (delete 'configure)
@@ -1237,13 +1237,7 @@ (define make-crust-package
                             (install-file file (string-append #$output
                                                               "/libexec")))
                           (find-files "." "(scp\\.bin|\\.config)$")))))))
-      ;; The firmware is cross-compiled using a "bare bones" compiler (no libc).
-      ;; Use our own tool chain for that.
-      (native-inputs
-       (list bison
-             (cross-gcc "or1k-elf")
-             (cross-binutils "or1k-elf")
-             flex))
+      (native-inputs (list bison flex))
       (home-page "https://github.com/crust-firmware/crust")
       (synopsis "Firmware for Allwinner sunxi SoCs")
       (description "Crust improves battery life and thermal performance by
-- 
2.41.0





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

* [bug#68355] [PATCH v2 8/9] gnu: Add make-crust-tools.
  2024-01-19 13:54 ` [bug#68355] [PATCH v2 1/9] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
                     ` (5 preceding siblings ...)
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 7/9] gnu: make-crust-package: Use or1k-elf as target Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-19 13:54   ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 9/9] gnu: make-crust-package: Unite firmware and tools Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-22 10:32   ` bug#68355: [PATCH v2 1/9] guix: Add ork1-elf platform Mathieu Othacehe
  8 siblings, 0 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-19 13:54 UTC (permalink / raw)
  To: 68355
  Cc: othacehe, Jean-Pierre De Jesus DIAZ, Efraim Flashner,
	Vagrant Cascadian

* gnu/packages/firmware.scm (make-crust-tools): New procedure.

Change-Id: Iac05ecf1796e4c10692a423c12423ea9b078d141
---
 gnu/packages/firmware.scm | 44 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 129dd0dfdd..41fe55eb2e 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1252,6 +1252,50 @@ (define make-crust-package
       ;; Most files are dual-licensed "BSD-3 OR GPL2", a few are GPL2 only.
       (license (list license:bsd-3 license:gpl2)))))
 
+(define make-crust-tools
+  (mlambda (platform firmware)
+    (package
+      (inherit firmware)
+      (name (string-append "crust-"
+                           (string-replace-substring platform "_" "-")
+                           "-tools"))
+      (arguments
+       (list #:make-flags
+             #~(list "V=1"
+                     "LEX=flex"
+                     (string-append "HOSTAR=" #$(ar-for-target))
+                     (string-append "HOSTCC=" #$(cc-for-target)))
+             #:phases
+             #~(modify-phases %standard-phases
+                 (add-after 'unpack 'do-not-build-tests
+                   (lambda _
+                     ;; Attempting to build the tools test binary on a
+                     ;; non-aarch64 architecture fails with: "No cache
+                     ;; cleaning implementation available for this
+                     ;; architecture".  Avoid building it (see:
+                     ;; https://github.com/crust-firmware/crust/issues/182).
+                     (substitute* "tools/Makefile"
+                       (("tools-y \\+= test") ""))))
+                 (replace 'configure
+                   (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                     (copy-file (search-input-file inputs "/libexec/.config")
+                                ".config")))
+                 (replace 'build
+                   (lambda* (#:key make-flags parallel-build?
+                             #:allow-other-keys)
+                     (apply invoke "make" "tools"
+                            `(,@(if parallel-build?
+                                    `("-j"
+                                      ,(number->string (parallel-job-count)))
+                                     '())
+                              ,@make-flags))))
+                 (replace 'install
+                   (lambda _
+                     (install-file "build/tools/load"
+                                   (string-append #$output "/bin")))))))
+      (synopsis "Firmware for Allwinner sunxi SoCs (tools)")
+      (inputs (list firmware)))))
+
 (define-public crust-pinebook
   (make-crust-package "pinebook"))
 
-- 
2.41.0





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

* [bug#68355] [PATCH v2 9/9] gnu: make-crust-package: Unite firmware and tools.
  2024-01-19 13:54 ` [bug#68355] [PATCH v2 1/9] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
                     ` (6 preceding siblings ...)
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 8/9] gnu: Add make-crust-tools Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-19 13:54   ` Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-01-22 10:32   ` bug#68355: [PATCH v2 1/9] guix: Add ork1-elf platform Mathieu Othacehe
  8 siblings, 0 replies; 23+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2024-01-19 13:54 UTC (permalink / raw)
  To: 68355
  Cc: othacehe, Jean-Pierre De Jesus DIAZ, Efraim Flashner,
	Vagrant Cascadian

* gnu/packages/firmware.scm (make-crust-package): Perform union of
make-crust-firmware and make-crust-tools.
* gnu/packages/firmware.scm (make-crust-firmware): New procedure.

Change-Id: I687bb6d53aae9bd60ed988baf9d17e92f31faa7b
---
 gnu/packages/firmware.scm | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 41fe55eb2e..828bc7402a 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1197,11 +1197,12 @@ (define-public arm-trusted-firmware-imx8mq
           ;; Adding debug symbols causes the size to exceed limits.
           #~(delete "DEBUG=1" #$flags)))))))
 
-(define make-crust-package
+(define make-crust-firmware
   (mlambda (platform)
     (package
       (name (string-append "crust-"
-                           (string-replace-substring platform "_" "-")))
+                           (string-replace-substring platform "_" "-")
+                           "-firmware"))
       (version "0.6")
       (source
        (origin
@@ -1296,6 +1297,29 @@ (define make-crust-tools
       (synopsis "Firmware for Allwinner sunxi SoCs (tools)")
       (inputs (list firmware)))))
 
+(define make-crust-package
+  (mlambda (platform)
+    (let* ((firmware (make-crust-firmware platform))
+           (tools (make-crust-tools platform firmware)))
+      (package
+        (inherit firmware)
+        (name (string-append "crust-"
+                             (string-replace-substring platform "_" "-")))
+        (source #f)
+        (build-system trivial-build-system)
+        (arguments
+         (list #:modules '((guix build union))
+               #:builder
+               #~(begin
+                   (use-modules (ice-9 match)
+                                (guix build union))
+
+                   (match %build-inputs
+                     (((names . directory) ...)
+                      (union-build #$output directory))))))
+        (native-inputs '())
+        (inputs (list firmware tools))))))
+
 (define-public crust-pinebook
   (make-crust-package "pinebook"))
 
-- 
2.41.0





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

* bug#68355: [PATCH v2 1/9] guix: Add ork1-elf platform.
  2024-01-19 13:54 ` [bug#68355] [PATCH v2 1/9] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
                     ` (7 preceding siblings ...)
  2024-01-19 13:54   ` [bug#68355] [PATCH v2 9/9] gnu: make-crust-package: Unite firmware and tools Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-01-22 10:32   ` Mathieu Othacehe
  8 siblings, 0 replies; 23+ messages in thread
From: Mathieu Othacehe @ 2024-01-22 10:32 UTC (permalink / raw)
  To: Jean-Pierre De Jesus DIAZ
  Cc: Josselin Poiret, Simon Tournier, Ludovic Courtès,
	Tobias Geerinckx-Rice, Ricardo Wurmus, 68355-done,
	Christopher Baines


Hello,

Thanks for the v2, I applied the series.

Mathieu




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

end of thread, other threads:[~2024-01-22 10:34 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-09 23:12 [bug#68355] [PATCH 0/8] guix: Add or1k-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-09 23:14 ` [bug#68355] [PATCH 1/8] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-12 20:22   ` Mathieu Othacehe
2024-01-09 23:14 ` [bug#68355] [PATCH 2/8] gnu: cross-gcc-toolchain: Use fixed name Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-12 20:25   ` Mathieu Othacehe
2024-01-09 23:14 ` [bug#68355] [PATCH 3/8] gnu: Add gcc-cross-or1k-elf-toolchain Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-09 23:14 ` [bug#68355] [PATCH 4/8] gnu: make-crust-package: Memoize Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-09 23:14 ` [bug#68355] [PATCH 5/8] gnu: make-crust-package: Update to 0.6 Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-12 20:26   ` Mathieu Othacehe
2024-01-09 23:14 ` [bug#68355] [PATCH 6/8] gnu: make-crust-package: Use or1k-elf as target Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-09 23:14 ` [bug#68355] [PATCH 7/8] gnu: Add make-crust-tools Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-12 20:30   ` Mathieu Othacehe
2024-01-09 23:14 ` [bug#68355] [PATCH 8/8] gnu: make-crust-package: Unite firmware and tools Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-19 13:54 ` [bug#68355] [PATCH v2 1/9] guix: Add ork1-elf platform Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-19 13:54   ` [bug#68355] [PATCH v2 2/9] gnu: cross-gcc-toolchain: Use fixed name Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-19 13:54   ` [bug#68355] [PATCH v2 3/9] gnu: Add gcc-cross-or1k-elf-toolchain Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-19 13:54   ` [bug#68355] [PATCH v2 4/9] gnu: make-crust-package: Use shorter synopsis Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-19 13:54   ` [bug#68355] [PATCH v2 5/9] gnu: make-crust-package: Memoize Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-19 13:54   ` [bug#68355] [PATCH v2 6/9] gnu: make-crust-package: Update to 0.6 Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-19 13:54   ` [bug#68355] [PATCH v2 7/9] gnu: make-crust-package: Use or1k-elf as target Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-19 13:54   ` [bug#68355] [PATCH v2 8/9] gnu: Add make-crust-tools Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-19 13:54   ` [bug#68355] [PATCH v2 9/9] gnu: make-crust-package: Unite firmware and tools Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-01-22 10:32   ` bug#68355: [PATCH v2 1/9] guix: Add ork1-elf platform Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).