guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: gnu: make-openbios-package: Enable building from aarch64, riscv64


From: guix-commits
Subject: 02/03: gnu: make-openbios-package: Enable building from aarch64, riscv64.
Date: Thu, 9 Mar 2023 08:11:45 -0500 (EST)

efraim pushed a commit to branch master
in repository guix.

commit e22a6ed8f82eb094242a3c4c723f7ab7635a4976
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Wed Mar 8 16:10:08 2023 +0200

    gnu: make-openbios-package: Enable building from aarch64, riscv64.
    
    * gnu/packages/firmware.scm (make-openbios-package)[source]: Add patch
    to correctly detect aarch64 and riscv64 build hosts.
    (openbios-qemu-ppc)[arguments]: Remove aarch64 workaround for #:system.
    * gnu/packages/patches/openbios-aarch64-riscv64-support.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Register it.
---
 gnu/local.mk                                            |  1 +
 gnu/packages/firmware.scm                               |  8 ++------
 .../patches/openbios-aarch64-riscv64-support.patch      | 17 +++++++++++++++++
 3 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 4dbe603512..53a09f79cd 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1606,6 +1606,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/onnx-use-system-googletest.patch        \
   %D%/packages/patches/onnx-shared-libraries.patch     \
   %D%/packages/patches/onnx-skip-model-downloads.patch         \
+  %D%/packages/patches/openbios-aarch64-riscv64-support.patch  \
   %D%/packages/patches/openboardview-use-system-imgui.patch    \
   %D%/packages/patches/openboardview-use-system-utf8.patch     \
   %D%/packages/patches/openbox-python3.patch                   \
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 873ad02ae1..956ece5d6d 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -410,7 +410,8 @@ utilites used to process FCODE, OpenFirmware's byte code, 
consisting of:
               (file-name (git-file-name "openbios" version))
               (sha256
                (base32
-                "1xp1b6xgx40i0j3a5y3id0d1p8vdvapai8szganxg3zrvj53fh0n"))))
+                "1xp1b6xgx40i0j3a5y3id0d1p8vdvapai8szganxg3zrvj53fh0n"))
+              (patches (search-patches 
"openbios-aarch64-riscv64-support.patch"))))
     (build-system gnu-build-system)
     (arguments
      (list #:tests? #f                  ;no tests
@@ -457,11 +458,6 @@ provide OpenFirmware functionality on top of an already 
running system.")
       (inherit base)
       (arguments
        (substitute-keyword-arguments (package-arguments base)
-         ((#:system system (%current-system))
-          (if (string-prefix? "aarch64-linux" (or (%current-system)
-                                                  (%current-target-system)))
-            "armhf-linux"
-            system))
          ;; No need to cross-compile, package produces reproducible firmware.
          ((#:target _ #f) #f)
          ((#:phases phases)
diff --git a/gnu/packages/patches/openbios-aarch64-riscv64-support.patch 
b/gnu/packages/patches/openbios-aarch64-riscv64-support.patch
new file mode 100644
index 0000000000..25cf2499b8
--- /dev/null
+++ b/gnu/packages/patches/openbios-aarch64-riscv64-support.patch
@@ -0,0 +1,17 @@
+This was submitted upstream
+https://github.com/openbios/openbios/pull/12
+
+diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch
+index b5acc6c..a96ef4b 100755
+--- a/config/scripts/switch-arch
++++ b/config/scripts/switch-arch
+@@ -38,7 +38,8 @@ longbits()
+     if test "$cpu" = "sparc64" -o "$cpu" = "ia64" \
+         -o "$cpu" = "amd64" -o "$cpu" = "x86_64" \
+         -o "$cpu" = "powerpc64" -o "$cpu" = "ppc64" \
+-        -o "$cpu" = "ppc64le" -o "$cpu" = "alpha" ; then
++        -o "$cpu" = "ppc64le" -o "$cpu" = "alpha" \
++        -o "$cpu" = "aarch64" -o "$cpu" = "riscv64" ; then
+         echo 64
+     else
+         echo 32



reply via email to

[Prev in Thread] Current Thread [Next in Thread]