[bug#77148,2/9] gnu: Add slof-qemu.

Message ID 57c58c9ff4122ff61e15250d842ddd1d699a2b97.1742546953.git.efraim@flashner.co.il
State New
Headers
Series New firmware and updates |

Commit Message

Efraim Flashner March 21, 2025, 8:53 a.m. UTC
  * gnu/packages/firmware.scm (slof-qemu): New variable.

Change-Id: I01664bae53c79c46b9e293c0cf4287338134bab0
---
 gnu/packages/firmware.scm | 51 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 50 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 63f767f72bf..88ee0f5777c 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -2,7 +2,7 @@ 
 ;;; Copyright © 2014-2016, 2024 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2017 David Craven <david@craven.ch>
-;;; Copyright © 2017, 2018, 2022-2024 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017, 2018, 2022-2025 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
@@ -830,6 +830,55 @@  (define-public sgabios
 after an operating system boots.")
       (license license:asl2.0))))
 
+(define-public slof-qemu
+  (package
+    (name "slof")
+    (version "20241106")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/aik/SLOF")
+                    (commit (string-append "qemu-slof-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1gfqnaxgvdv6s2gkkzrazijgs7rrvigmm878q81l9m5vnyyj12kx"))
+              (snippet
+               #~(begin (use-modules (guix build utils))
+                        (for-each delete-file-recursively
+                                  (cons* "FlashingSLOF.pdf"
+                                         (find-files "." "\\.oco$")))))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:make-flags
+           #~(list #$@(if (not (string-prefix? "powerpc64" (%current-system)))
+                          `("CROSS=powerpc64-linux-gnu-")
+                          `())
+                   "qemu")
+           #:target #f              ; Package produces firmware.
+           #:tests? #f              ; No tests.
+           #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure)  ; No configure script.
+               (replace 'install
+                 (lambda _
+                   (copy-file "boot_rom.bin" "slof.bin")
+                   (install-file "slof.bin"
+                                 (string-append #$output "/share/qemu")))))))
+    (native-inputs
+     (append
+       (if (not (string-prefix? "powerpc64" (%current-system)))
+           (list (cross-gcc "powerpc64-linux-gnu")
+                 (cross-binutils "powerpc64-linux-gnu")))
+       (list perl)))
+    (home-page "https://openbios.info/SLOF")
+    (synopsis "Implementation of IEEE1275 Open Firmware for some POWER ISA systems")
+    (description
+     "@acronym{SLOF, Slimline Open Firmware} is an implementation of the IEEE
+1275 standard.  It can be used as partition firmware for pSeries machines running
+on QEMU or KVM.")
+    (license license:bsd-3)))
+
 (define-public edk2-tools
   (package
     (name "edk2-tools")