gnu: SeaBIOS: Use G-expression.
* gnu/packages/firmware.scm (seabios)[arguments]: Rewrite as gexp.
parent
d241517d2c
commit
6ea7d25396
|
@ -415,66 +415,67 @@ executing in M-mode.")
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(native-inputs (list python-wrapper))
|
(native-inputs (list python-wrapper))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:tests? #f ; no check target
|
(list
|
||||||
#:make-flags '("EXTRAVERSION=-guix" ;upstream wants distros to set this
|
#:tests? #f ;no tests
|
||||||
"V=1") ;build verbosely
|
#:make-flags
|
||||||
#:modules (,@%gnu-build-system-modules
|
#~'("EXTRAVERSION=-guix" ;upstream wants distros to set this
|
||||||
|
"V=1") ;build verbosely
|
||||||
|
#:modules `(,@%gnu-build-system-modules
|
||||||
(ice-9 match))
|
(ice-9 match))
|
||||||
#:phases
|
#:phases
|
||||||
(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
(replace 'configure
|
(replace 'configure
|
||||||
(lambda _
|
(lambda _
|
||||||
;; Create the ".version" file that is present in release tarballs.
|
;; Create the ".version" file that is present in release tarballs.
|
||||||
;; Otherwise this will be regarded as an "unclean" build, and the
|
;; Otherwise this will be regarded as an "unclean" build, and the
|
||||||
;; build system ends up encoding the build date in the binaries.
|
;; build system ends up encoding the build date in the binaries.
|
||||||
(call-with-output-file ".version"
|
(call-with-output-file ".version"
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
(format port ,(package-version this-package))))
|
(format port #$(package-version this-package))))
|
||||||
(setenv "CC" "gcc")))
|
(setenv "CC" "gcc")))
|
||||||
(add-after 'build 'build-vgabios
|
(add-after 'build 'build-vgabios
|
||||||
(lambda* (#:key (make-flags ''()) #:allow-other-keys)
|
(lambda* (#:key (make-flags #~'()) #:allow-other-keys)
|
||||||
(for-each
|
(for-each
|
||||||
(match-lambda
|
(match-lambda
|
||||||
((target . config)
|
((target . config)
|
||||||
(let* ((dot-config (string-append (getcwd) "/" target "/.config"))
|
(let* ((dot-config (string-append (getcwd) "/" target "/.config"))
|
||||||
(flags (append make-flags
|
(flags (append make-flags
|
||||||
(list (string-append "KCONFIG_CONFIG="
|
(list (string-append "KCONFIG_CONFIG="
|
||||||
dot-config)
|
dot-config)
|
||||||
(string-append "OUT=" target "/")))))
|
(string-append "OUT=" target "/")))))
|
||||||
(mkdir target)
|
(mkdir target)
|
||||||
(call-with-output-file dot-config
|
(call-with-output-file dot-config
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
(for-each (lambda (entry)
|
(for-each (lambda (entry)
|
||||||
(if (string-suffix? "=n" entry)
|
(if (string-suffix? "=n" entry)
|
||||||
(format port "# CONFIG_~a is not set~%"
|
(format port "# CONFIG_~a is not set~%"
|
||||||
(string-drop-right entry 2))
|
(string-drop-right entry 2))
|
||||||
(format port "CONFIG_~a~%" entry)))
|
(format port "CONFIG_~a~%" entry)))
|
||||||
(cons "BUILD_VGABIOS=y" config))))
|
(cons "BUILD_VGABIOS=y" config))))
|
||||||
(apply invoke "make" "oldnoconfig" flags)
|
(apply invoke "make" "oldnoconfig" flags)
|
||||||
(apply invoke "make" flags)
|
(apply invoke "make" flags)
|
||||||
(link (string-append target "/bios.bin")
|
(link (string-append target "/bios.bin")
|
||||||
(string-append "out/" target ".bin")))))
|
(string-append "out/" target ".bin")))))
|
||||||
;; These tuples are modelled after Debians packaging:
|
;; These tuples are modelled after Debians packaging:
|
||||||
;; https://salsa.debian.org/qemu-team/seabios/-/blob/master/debian/rules
|
;; https://salsa.debian.org/qemu-team/seabios/-/blob/master/debian/rules
|
||||||
'(("ati" . ("VGA_ATI=y" "VGA_PCI=y"))
|
'(("ati" . ("VGA_ATI=y" "VGA_PCI=y"))
|
||||||
("bochs-display" . ("DISPLAY_BOCHS=y" "VGA_PCI=y"))
|
("bochs-display" . ("DISPLAY_BOCHS=y" "VGA_PCI=y"))
|
||||||
("cirrus" . ("VGA_CIRRUS=y" "VGA_PCI=y"))
|
("cirrus" . ("VGA_CIRRUS=y" "VGA_PCI=y"))
|
||||||
("stdvga" . ("VGA_BOCHS=y" "VGA_PCI=y"))
|
("stdvga" . ("VGA_BOCHS=y" "VGA_PCI=y"))
|
||||||
("virtio" . ("VGA_BOCHS_VIRTIO=y" "VGA_PCI=y"))
|
("virtio" . ("VGA_BOCHS_VIRTIO=y" "VGA_PCI=y"))
|
||||||
("vmware" . ("VGA_BOCHS_VMWARE=y" "VGA_PCI=y"))
|
("vmware" . ("VGA_BOCHS_VMWARE=y" "VGA_PCI=y"))
|
||||||
("qxl" . ("VGA_BOCHS_QXL=y" "VGA_PCI=y"))
|
("qxl" . ("VGA_BOCHS_QXL=y" "VGA_PCI=y"))
|
||||||
("isavga" . ("VGA_BOCHS=y" "VGA_PCI=n"))
|
("isavga" . ("VGA_BOCHS=y" "VGA_PCI=n"))
|
||||||
("ramfb" . ("VGA_RAMFB=y" "VGA_PCI=n"))))))
|
("ramfb" . ("VGA_RAMFB=y" "VGA_PCI=n"))))))
|
||||||
(replace 'install
|
(replace 'install
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda _
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(let ((fmw (string-append #$output "/share/firmware")))
|
||||||
(fmw (string-append out "/share/firmware")))
|
(for-each (lambda (bios)
|
||||||
(for-each (lambda (bios)
|
(install-file bios fmw))
|
||||||
(install-file bios fmw))
|
(find-files "out" "\\.bin$"))
|
||||||
(find-files "out" "\\.bin$"))
|
(with-directory-excursion fmw
|
||||||
(with-directory-excursion fmw
|
;; QEMU 1.7 and later looks only for the latter.
|
||||||
;; QEMU 1.7 and later looks only for the latter.
|
(symlink "bios.bin" "bios-256k.bin"))))))))
|
||||||
(symlink "bios.bin" "bios-256k.bin"))))))))
|
|
||||||
(home-page "https://www.seabios.org/SeaBIOS")
|
(home-page "https://www.seabios.org/SeaBIOS")
|
||||||
(synopsis "x86 BIOS implementation")
|
(synopsis "x86 BIOS implementation")
|
||||||
(description "SeaBIOS is an implementation of a 16bit x86 BIOS. SeaBIOS
|
(description "SeaBIOS is an implementation of a 16bit x86 BIOS. SeaBIOS
|
||||||
|
|
Reference in New Issue