me
/
guix
Archived
1
0
Fork 0

gnu: qemu: Fix indentation and remove trailing #t.

* gnu/packages/virtualization.scm (qemu): Fix indentation and remove
trailing #t, appeasing 'guix lint'.
master
Maxim Cournoyer 2021-02-20 13:27:58 -05:00
parent 29e992c030
commit 3fe46eef57
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 37 additions and 41 deletions

View File

@ -134,33 +134,34 @@
(package (package
(name "qemu") (name "qemu")
(version "5.1.0") (version "5.1.0")
(source (origin (source
(method url-fetch) (origin
(uri (string-append "https://download.qemu.org/qemu-" (method url-fetch)
version ".tar.xz")) (uri (string-append "https://download.qemu.org/qemu-"
(sha256 version ".tar.xz"))
(base32 (sha256
"1rd41wwlvp0vpialjp2czs6i3lsc338xc72l3zkbb7ixjfslw5y9")) (base32
(patches (search-patches "qemu-build-info-manual.patch" "1rd41wwlvp0vpialjp2czs6i3lsc338xc72l3zkbb7ixjfslw5y9"))
"qemu-CVE-2021-20203.patch")) (patches (search-patches "qemu-build-info-manual.patch"
(modules '((guix build utils))) "qemu-CVE-2021-20203.patch"))
(snippet (modules '((guix build utils)))
'(begin (snippet
;; Fix a bug in the do_ioctl_ifconf() function of qemu to '(begin
;; make ioctl(…, SIOCGIFCONF, …) work for emulated 64 bit ;; Fix a bug in the do_ioctl_ifconf() function of qemu to
;; architectures. The size of struct ifreq is handled ;; make ioctl(…, SIOCGIFCONF, …) work for emulated 64 bit
;; incorrectly. ;; architectures. The size of struct ifreq is handled
;; https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg01545.html ;; incorrectly.
(substitute* '("linux-user/syscall.c") ;; https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg01545.html
(("^([[:blank:]]*)const argtype ifreq_arg_type.*$" line indent) (substitute* '("linux-user/syscall.c")
(string-append line indent (("^([[:blank:]]*)const argtype ifreq_arg_type.*$" line indent)
"const argtype ifreq_max_type[] = { MK_STRUCT(STRUCT_ifmap_ifreq) };\n")) (string-append line indent "const argtype ifreq_max_type[] = "
(("^([[:blank:]]*)target_ifreq_size[[:blank:]]=.*$" _ indent) "{ MK_STRUCT(STRUCT_ifmap_ifreq) };\n"))
(string-append indent "target_ifreq_size = thunk_type_size(ifreq_max_type, 0);"))) (("^([[:blank:]]*)target_ifreq_size[[:blank:]]=.*$" _ indent)
#t)))) (string-append indent "target_ifreq_size = "
(outputs '("out" "doc")) ;4.7 MiB of HTML docs "thunk_type_size(ifreq_max_type, 0);")))))))
(build-system gnu-build-system) (outputs '("out" "doc")) ;4.7 MiB of HTML docs
(arguments (build-system gnu-build-system)
(arguments
`(;; FIXME: Disable tests on i686 to work around `(;; FIXME: Disable tests on i686 to work around
;; <https://bugs.gnu.org/40527>. ;; <https://bugs.gnu.org/40527>.
#:tests? ,(or (%current-target-system) #:tests? ,(or (%current-target-system)
@ -194,8 +195,7 @@
inputs))) inputs)))
(set-path-environment-variable "C_INCLUDE_PATH" (set-path-environment-variable "C_INCLUDE_PATH"
'("include") '("include")
input-directories) input-directories))))
#t)))
(add-after 'unpack 'extend-test-time-outs (add-after 'unpack 'extend-test-time-outs
(lambda _ (lambda _
;; These tests can time out on heavily-loaded and/or slow storage. ;; These tests can time out on heavily-loaded and/or slow storage.
@ -219,16 +219,14 @@
;; x86 CPUs (see https://issues.guix.info/43048 and ;; x86 CPUs (see https://issues.guix.info/43048 and
;; https://bugs.launchpad.net/qemu/+bug/1896263). ;; https://bugs.launchpad.net/qemu/+bug/1896263).
(("check-qtest-i386-y \\+= bios-tables-test" all) (("check-qtest-i386-y \\+= bios-tables-test" all)
(string-append "# " all))) (string-append "# " all)))))
#t))
(add-after 'patch-source-shebangs 'patch-/bin/sh-references (add-after 'patch-source-shebangs 'patch-/bin/sh-references
(lambda _ (lambda _
;; Ensure the executables created by these source files reference ;; Ensure the executables created by these source files reference
;; /bin/sh from the store so they work inside the build container. ;; /bin/sh from the store so they work inside the build container.
(substitute* '("block/cloop.c" "migration/exec.c" (substitute* '("block/cloop.c" "migration/exec.c"
"net/tap.c" "tests/qtest/libqtest.c") "net/tap.c" "tests/qtest/libqtest.c")
(("/bin/sh") (which "sh"))) (("/bin/sh") (which "sh")))))
#t))
(replace 'configure (replace 'configure
(lambda* (#:key inputs outputs (configure-flags '()) (lambda* (#:key inputs outputs (configure-flags '())
#:allow-other-keys) #:allow-other-keys)
@ -273,8 +271,7 @@
(format port "#!/bin/sh (format port "#!/bin/sh
exec smbd $@"))) exec smbd $@")))
(chmod "samba-wrapper" #o755) (chmod "samba-wrapper" #o755)
(install-file "samba-wrapper" libexec)) (install-file "samba-wrapper" libexec))))
#t))
(add-after 'install 'move-html-doc (add-after 'install 'move-html-doc
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
@ -282,23 +279,22 @@ exec smbd $@")))
(qemu-doc (string-append doc "/share/doc/qemu-" ,version))) (qemu-doc (string-append doc "/share/doc/qemu-" ,version)))
(mkdir-p qemu-doc) (mkdir-p qemu-doc)
(rename-file (string-append out "/share/doc/qemu") (rename-file (string-append out "/share/doc/qemu")
(string-append qemu-doc "/html"))) (string-append qemu-doc "/html"))))))))
#t))))) (inputs ; TODO: Add optional inputs.
(inputs ; TODO: Add optional inputs.
`(("alsa-lib" ,alsa-lib) `(("alsa-lib" ,alsa-lib)
("attr" ,attr) ("attr" ,attr)
("glib" ,glib) ("glib" ,glib)
("gtk+" ,gtk+) ("gtk+" ,gtk+)
("libaio" ,libaio) ("libaio" ,libaio)
("libattr" ,attr) ("libattr" ,attr)
("libcacard" ,libcacard) ; smartcard support ("libcacard" ,libcacard) ; smartcard support
("libcap-ng" ,libcap-ng) ; virtfs support requires libcap-ng & libattr ("libcap-ng" ,libcap-ng) ; virtfs support requires libcap-ng & libattr
("libdrm" ,libdrm) ("libdrm" ,libdrm)
("libepoxy" ,libepoxy) ("libepoxy" ,libepoxy)
("libjpeg" ,libjpeg-turbo) ("libjpeg" ,libjpeg-turbo)
("libpng" ,libpng) ("libpng" ,libpng)
("libseccomp" ,libseccomp) ("libseccomp" ,libseccomp)
("libusb" ,libusb) ;USB pass-through support ("libusb" ,libusb) ;USB pass-through support
("mesa" ,mesa) ("mesa" ,mesa)
("ncurses" ,ncurses) ("ncurses" ,ncurses)
;; ("pciutils" ,pciutils) ;; ("pciutils" ,pciutils)