Subject: [PATCH 2/9] gnu: Add slof-qemu.

From: Efraim Flashner <[email-masked]>
Date: Fri, 21 Mar 2025 10:53:03 +0200

* gnu/packages/firmware.scm (slof-qemu): New variable.

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

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 <[email-masked]>
 ;;; Copyright © 2016 Eric Bavier <[email-masked]>
 ;;; Copyright © 2017 David Craven <[email-masked]>
-;;; Copyright © 2017, 2018, 2022-2024 Efraim Flashner <[email-masked]>
+;;; Copyright © 2017, 2018, 2022-2025 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <[email-masked]>
 ;;; Copyright © 2018 Vagrant Cascadian <[email-masked]>
 ;;; Copyright © 2019 Mathieu Othacehe <[email-masked]>
@@ -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")
-- 
Efraim Flashner   <[email-masked]>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted