gnu: emacs-svg-icon: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / virtualization.scm
index 8fcdb66..a2df3e7 100644 (file)
@@ -12,7 +12,7 @@
 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
-;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re>
 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
@@ -43,6 +43,7 @@
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages backup)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages build-tools)
   #:use-module (gnu packages check)
@@ -98,6 +99,7 @@
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages readline)
   #:use-module (gnu packages selinux)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages sphinx)
@@ -1066,48 +1068,47 @@ manage system or application containers.")
 (define-public libvirt
   (package
     (name "libvirt")
-    (version "7.1.0")
+    (version "7.2.0")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "https://libvirt.org/sources/libvirt-"
                            version ".tar.xz"))
        (sha256
-        (base32 "0v50ckf56h6jd9bmqwp0lh2cmb7qqjmcb6y3mz2i2r15h06ih3w7"))
-       (patches
-        (search-patches "libvirt-do-not-create-var-dirs.patch"))))
+        (base32 "1l6i1rz1v9rnp61sgzlrlbsfh03208dbm3b259i0jl5sqz85kx01"))
+       (patches (search-patches "libvirt-add-install-prefix.patch"))))
     (build-system meson-build-system)
     (arguments
-     `(#:meson ,meson-0.55  ;; libvirt requires meson 0.54 or higher.
-       #:configure-flags
+     `(#:configure-flags
        (list "-Ddriver_qemu=enabled"
              "-Dqemu_user=nobody"
              "-Dqemu_group=kvm"
-             "-Dpolkit=enabled")
+             "-Dstorage_disk=enabled"
+             "-Dstorage_dir=enabled"
+             "-Dpolkit=enabled"
+             "-Dnls=enabled"            ;translations
+             (string-append "-Ddocdir=" (assoc-ref %outputs "out") "/share/doc/"
+                            ,name "-" ,version)
+             "-Dbash_completion=enabled"
+             (string-append "-Dinstall_prefix=" (assoc-ref %outputs "out"))
+             "--sysconfdir=/etc"
+             "--localstatedir=/var")
+       #:meson ,meson-0.55
        #:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'fix-sysconfdir-and-localstatedir
-           (lambda _
-             (substitute* "meson.build"
-               ;; We set the prefix to be the package output, but we need
-               ;; localstatedir to be /var.  Sadly the build system doesn't
-               ;; seem to allow that easily.
-               (("localstatedir = prefix / get_option\\('localstatedir'\\)")
-                "localstatedir = get_option('localstatedir')")
-               ;; On the other hand, we keep sysconfdir using the prefix so
-               ;; that we install configuration files in the package output.
-               ;; However, we need to make sure the C code refers to /etc via
-               ;; SYSCONFDIR, and not the read-only configuration in the
-               ;; package output.
-               (("set_quoted\\('SYSCONFDIR', sysconfdir\\)")
-                "set_quoted('SYSCONFDIR', '/etc')"))
-             #t))
          (add-before 'configure 'disable-broken-tests
            (lambda _
-             (substitute* "tests/meson.build"
-               (("\\{ 'name': 'commandtest'.*") "")        ; hangs idly
-               (("\\{ 'name': 'qemuxml2argvtest'.*") "")   ; fails
-               (("\\{ 'name': 'virnetsockettest'.*") ""))  ; tries to network
+             (let ((tests (list "commandtest"           ; hangs idly
+                                "qemuxml2argvtest"      ; fails
+                                "virnetsockettest")))   ; tries to network
+               (substitute* "tests/meson.build"
+                 (((format #f ".*'name': '(~a)'.*" (string-join tests "|")))
+                  ""))
+               #t)))
+         (add-before 'install 'no-polkit-magic
+           ;; Meson ‘magically’ invokes pkexec, which fails (not setuid).
+           (lambda _
+             (setenv "PKEXEC_UID" "something")
              #t)))))
     (inputs
      `(("libxml2" ,libxml2)
@@ -1117,27 +1118,32 @@ manage system or application containers.")
        ("dbus" ,dbus)
        ("libpcap" ,libpcap)
        ("libnl" ,libnl)
+       ("libssh2" ,libssh2)             ;optional
        ("libtirpc" ,libtirpc)           ;for <rpc/rpc.h>
        ("libuuid" ,util-linux "lib")
        ("lvm2" ,lvm2)                   ;for libdevmapper
        ("curl" ,curl)
        ("openssl" ,openssl)
+       ("readline" ,readline)
        ("cyrus-sasl" ,cyrus-sasl)
        ("libyajl" ,libyajl)
        ("audit" ,audit)
        ("dmidecode" ,dmidecode)
        ("dnsmasq" ,dnsmasq)
        ("ebtables" ,ebtables)
+       ("parted" ,parted)
        ("iproute" ,iproute)
        ("iptables" ,iptables)))
     (native-inputs
-     `(("xsltproc" ,libxslt)
+     `(("bash-completion" ,bash-completion)
+       ("gettext" ,gettext-minimal)
+       ("xsltproc" ,libxslt)
        ("perl" ,perl)
        ("pkg-config" ,pkg-config)
        ("polkit" ,polkit)
        ("python" ,python-wrapper)
        ("python-docutils" ,python-docutils) ;for rst2html
-       ("rpcsvc-proto" ,rpcsvc-proto)))     ;for 'rpcgen'
+       ("rpcsvc-proto" ,rpcsvc-proto)))     ;for rpcgen
     (home-page "https://libvirt.org")
     (synopsis "Simple API for virtualization")
     (description "Libvirt is a C toolkit to interact with the virtualization
@@ -1191,14 +1197,14 @@ three libraries:
 (define-public python-libvirt
   (package
     (name "python-libvirt")
-    (version "7.1.0")
+    (version "7.2.0")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "https://libvirt.org/sources/python/libvirt-python-"
                            version ".tar.gz"))
        (sha256
-        (base32 "0dq0qn0xx5hflaq5apj5pm79ba0wcl3w0j9klx8bg73z80gd7bzs"))))
+        (base32 "1ryfimhf47s9k4n0gys233bh15l68fccs2bvj8bjwqjm9k2vmhy0"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -1230,7 +1236,7 @@ virtualization library.")
 (define-public virt-manager
   (package
     (name "virt-manager")
-    (version "2.2.1")
+    (version "3.2.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://virt-manager.org/download/sources"
@@ -1238,11 +1244,10 @@ virtualization library.")
                                   version ".tar.gz"))
               (sha256
                (base32
-                "06ws0agxlip6p6n3n43knsnjyd91gqhh2dadgc33wl9lx1k8vn6g"))))
+                "11kvpzcmyir91qz0dsnk7748jbb4wr8mrc744w117qc91pcy6vrb"))))
     (build-system python-build-system)
     (arguments
      `(#:use-setuptools? #f          ; uses custom distutils 'install' command
-       #:test-target "test_ui"
        #:tests? #f                      ; TODO The tests currently fail
                                         ; RuntimeError: Loop condition wasn't
                                         ; met
@@ -1260,12 +1265,6 @@ virtualization library.")
              (substitute* "virtinst/buildconfig.py"
                (("/usr") (assoc-ref outputs "out")))
              #t))
-         (add-after 'unpack 'fix-qemu-img-reference
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "virtconv/formats.py"
-               (("/usr(/bin/qemu-img)" _ suffix)
-                (string-append (assoc-ref inputs "qemu") suffix)))
-             #t))
          (add-after 'unpack 'fix-default-uri
            (lambda* (#:key inputs #:allow-other-keys)
              ;; Xen is not available for now - so only patch qemu.
@@ -1296,11 +1295,12 @@ virtualization library.")
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests?
                (setenv "HOME" "/tmp")
+               (setenv "XDG_CACHE_HOME" "/tmp")
                (system "Xvfb :1 &")
                (setenv "DISPLAY" ":1")
                ;; Dogtail requires that Assistive Technology support be enabled
                (setenv "GTK_MODULES" "gail:atk-bridge")
-               (invoke "dbus-run-session" "--" "python" "setup.py" "test_ui"))
+               (invoke "dbus-run-session" "--" "pytest" "--uitests"))
              #t))
          (add-after 'install 'glib-or-gtk-compile-schemas
            (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
@@ -1330,7 +1330,9 @@ virtualization library.")
        ("gtk+" ,gtk+ "bin")             ; gtk-update-icon-cache
        ("perl" ,perl)                   ; pod2man
        ("intltool" ,intltool)
+       ("rst2man" ,python-docutils)
        ;; The following are required for running the tests
+       ;; ("python-pytest" ,python-pytest)
        ;; ("python-dogtail" ,python-dogtail)
        ;; ("xvfb" ,xorg-server-for-tests)
        ;; ("dbus" ,dbus)
@@ -1552,17 +1554,16 @@ monitor/GPU.")
 (define-public runc
   (package
     (name "runc")
-    (version "1.0.0-rc6")
+    (version "1.0.0-rc93")
     (source (origin
               (method url-fetch)
               (uri (string-append
                     "https://github.com/opencontainers/runc/releases/"
                     "download/v" version "/runc.tar.xz"))
               (file-name (string-append name "-" version ".tar.xz"))
-              (patches (search-patches "runc-CVE-2019-5736.patch"))
               (sha256
                (base32
-                "1c7832dq70slkjh8qp2civ1wxhhdd2hrx84pq7db1mmqc9fdr3cc"))))
+                "0b90r1bkvlqli53ca1yc1l488dba0isd3i6l7nlhszxi8p7hzvkh"))))
     (build-system go-build-system)
     (arguments
      '(#:import-path "github.com/opencontainers/runc"
@@ -1572,35 +1573,27 @@ monitor/GPU.")
        #:tests? #f
        #:phases
        (modify-phases %standard-phases
-         (replace 'unpack
-           (lambda* (#:key source import-path #:allow-other-keys)
-             ;; Unpack the tarball into 'runc' instead of 'runc-1.0.0-rc5'.
-             (let ((dest (string-append "src/" import-path)))
-               (mkdir-p dest)
-               (invoke "tar" "-C" (string-append "src/" import-path)
-                       "--strip-components=1"
-                       "-xvf" source))))
          (replace 'build
            (lambda* (#:key import-path #:allow-other-keys)
              (with-directory-excursion (string-append "src/" import-path)
-               ;; XXX: requires 'go-md2man'.
-               ;; (invoke "make" "man")
-               (invoke "make"))))
-         ;; (replace 'check
-         ;;   (lambda _
-         ;;     (invoke "make" "localunittest")))
+               (invoke "make" "all" "man"))))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "make" "localunittest"))))
          (replace 'install
            (lambda* (#:key import-path outputs #:allow-other-keys)
              (with-directory-excursion (string-append "src/" import-path)
                (let ((out (assoc-ref outputs "out")))
-                 (invoke "make" "install" "install-bash"
+                 (invoke "make" "install" "install-bash" "install-man"
                          (string-append "PREFIX=" out)))))))))
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     `(("go-md2man" ,go-github-com-go-md2man)
+       ("pkg-config" ,pkg-config)))
     (inputs
      `(("libseccomp" ,libseccomp)))
     (synopsis "Open container initiative runtime")
-    (home-page "https://www.opencontainers.org/")
+    (home-page "https://opencontainers.org/")
     (description
      "@command{runc} is a command line client for running applications
 packaged according to the
@@ -1612,7 +1605,7 @@ Open Container Initiative specification.")
 (define-public umoci
   (package
     (name "umoci")
-    (version "0.4.6")
+    (version "0.4.7")
     (source
      (origin
        (method url-fetch)
@@ -1621,7 +1614,7 @@ Open Container Initiative specification.")
              version "/umoci.tar.xz"))
        (file-name (string-append "umoci-" version ".tar.xz"))
        (sha256
-        (base32 "06q7xfwnqysc013hapx31jhlzmyg8qb467qfkynj673qc7p9bd6h"))))
+        (base32 "0fvljj9k4f83wbqzd8nbijz0p1zaq633f8yxyvl5sy3wjf03ffk9"))))
     (build-system go-build-system)
     (arguments
      '(#:import-path "github.com/opencontainers/umoci"
@@ -1658,7 +1651,7 @@ Open Container Initiative (OCI) image layout and its tagged images.")
 (define-public skopeo
   (package
     (name "skopeo")
-    (version "1.2.2")
+    (version "1.2.3")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -1667,7 +1660,7 @@ Open Container Initiative (OCI) image layout and its tagged images.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "03sznybn3rqjyplc6w4b7mfa6gas8db15p5vnmfm1xqw72ldylgc"))))
+                "0n22sdif437ddg5ch0ipwim3fg0n6ihc9bfi52qkhy3r1grz04hs"))))
     (build-system go-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)