summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/package-management.scm8
-rw-r--r--gnu/packages/spice.scm26
-rw-r--r--gnu/services/spice.scm45
-rw-r--r--gnu/system.scm2
-rw-r--r--gnu/system/examples/vm-image.tmpl26
-rw-r--r--gnu/system/locale.scm4
6 files changed, 75 insertions, 36 deletions
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 09fa7208dc..ef5d973e19 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -131,9 +131,9 @@
   ;; Latest version of Guix, which may or may not correspond to a release.
   ;; Note: the 'update-guix-package.scm' script expects this definition to
   ;; start precisely like this.
-  (let ((version "1.2.0")
-        (commit "4dff6ecde85eec473ab231cf75f51e98e8aca1e9")
-        (revision 21))
+  (let ((version "1.3.0")
+        (commit "771b866c55e5f992df60f6c32f5fdd78b64e17f6")
+        (revision 1))
     (package
       (name "guix")
 
@@ -149,7 +149,7 @@
                       (commit commit)))
                 (sha256
                  (base32
-                  "1n16j7rb4n4pjmp8ck5g206rphmzxii2mbyz1nk4qk70zc3mwszq"))
+                  "0w8w05w6v3lc6478vfw67jzn0hbd9nsncpx9i9ch1lck53r8vs44"))
                 (file-name (string-append "guix-" version "-checkout"))))
       (build-system gnu-build-system)
       (arguments
diff --git a/gnu/packages/spice.scm b/gnu/packages/spice.scm
index 31c2ce0ebe..9833ddaf05 100644
--- a/gnu/packages/spice.scm
+++ b/gnu/packages/spice.scm
@@ -265,7 +265,7 @@ Internet and from a wide variety of machine architectures.")
 (define-public spice-vdagent
   (package
     (name "spice-vdagent")
-    (version "0.20.0")
+    (version "0.21.0")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -273,11 +273,14 @@ Internet and from a wide variety of machine architectures.")
                 "spice-vdagent-" version ".tar.bz2"))
               (sha256
                (base32
-                "0n9k2kna2gd1zi6jv45zsp2jlv439nz5l5jjijirxqaycwi74srf"))))
+                "0n8jlc1pv6mkry161y656b1nk9hhhminjq6nymzmmyjl7k95ymzx"))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags
        '("--localstatedir=/var")
+       ;; The test-session-info test fails for unknown reasons (see:
+       ;; https://gitlab.freedesktop.org/spice/linux/vd_agent/-/issues/24).
+       #:make-flags '("XFAIL_TESTS=tests/test-session-info")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-makefile.in
@@ -285,19 +288,27 @@ Internet and from a wide variety of machine architectures.")
              (substitute* "Makefile.in"
                (((string-append "\\$\\(mkdir_p\\) \\$\\(DESTDIR\\)"
                                 "\\$\\(localstatedir\\)/run/spice-vdagentd"))
-                 "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd"))
-             #t))
+                 "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd"))))
          (add-after 'unpack 'patch-spice-vdagent.desktop
            (lambda* (#:key outputs #:allow-other-keys)
             (substitute* "data/spice-vdagent.desktop"
               (("Exec=/usr/bin/spice-vdagent")
                (string-append "Exec=" (assoc-ref outputs "out")
-                              "/bin/spice-vdagent")))
-             #t)))))
+                              "/bin/spice-vdagent")))))
+         (add-after 'unpack 'fix-test-termination
+           (lambda _
+             ;; The termination tests depend on finding the socket file name
+             ;; in the spice-vdagent command line it launched, but by default
+             ;; ps truncates its output, which causes the test to fail (see:
+             ;; https://gitlab.freedesktop.org/spice/linux/vd_agent/-/merge_requests/36).
+             (substitute* "tests/test-termination.c"
+               (("ps -ef")
+                "ps -efww")))))))
     (inputs
       `(("alsa-lib" ,alsa-lib)
         ("dbus" ,dbus)
         ("glib" ,glib)
+        ("gtk+" ,gtk+)
         ("libdrm" ,libdrm)
         ("libpciaccess" ,libpciaccess)
         ("libx11" ,libx11)
@@ -307,7 +318,8 @@ Internet and from a wide variety of machine architectures.")
         ("libxrandr" ,libxrandr)
         ("spice-protocol" ,spice-protocol)))
     (native-inputs
-      `(("pkg-config" ,pkg-config)))
+     `(("pkg-config" ,pkg-config)
+       ("procps" ,procps)))             ;tests use 'ps'
     (synopsis "Spice agent for Linux")
     (description "Spice-vdagent enables sharing the clipboard and guest display
 resolution scaling on graphical console window resize.")
diff --git a/gnu/services/spice.scm b/gnu/services/spice.scm
index fd85dc234f..3b88e29043 100644
--- a/gnu/services/spice.scm
+++ b/gnu/services/spice.scm
@@ -34,41 +34,42 @@
   (spice-vdagent spice-vdagent-configuration-spice-vdagent
                  (default spice-vdagent)))
 
-(define (spice-vdagent-activation config)
-  "Return the activation gexp for CONFIG."
-  #~(begin
-      (use-modules (guix build utils))
-      (mkdir-p "/var/run/spice-vdagentd")))
-
 (define (spice-vdagent-shepherd-service config)
   "Return a <shepherd-service> for spice-vdagentd with CONFIG."
   (define spice-vdagent (spice-vdagent-configuration-spice-vdagent config))
 
   (define spice-vdagentd-command
     (list
-      (file-append spice-vdagent "/sbin/spice-vdagentd")
-      "-x"))
+     (file-append spice-vdagent "/sbin/spice-vdagentd")
+     "-x"))
 
   (list
-    (shepherd-service
-      (documentation "Spice vdagentd service")
-      (requirement '(udev))
-      (provision '(spice-vdagentd))
-      (start #~(make-forkexec-constructor '#$spice-vdagentd-command))
-      (stop #~(make-kill-destructor)))))
+   (shepherd-service
+    (documentation "Spice vdagentd service")
+    (requirement '(dbus-system))
+    (provision '(spice-vdagentd))
+    (start #~(lambda args
+               ;; spice-vdagentd supports being activated upon the client
+               ;; connecting to its socket; when not using such feature, the
+               ;; socket should not exist before vdagentd creates it itself.
+               (mkdir-p "/run/spice-vdagentd")
+               (false-if-exception
+                (delete-file "/run/spice-vdagentd/spice-vdagent-sock"))
+               (fork+exec-command '#$spice-vdagentd-command)))
+    (stop #~(make-kill-destructor)))))
 
 (define spice-vdagent-profile
   (compose list spice-vdagent-configuration-spice-vdagent))
 
 (define spice-vdagent-service-type
-  (service-type (name 'spice-vdagent)
-    (extensions
-      (list (service-extension shepherd-root-service-type
-                               spice-vdagent-shepherd-service)
-            (service-extension activation-service-type
-                               spice-vdagent-activation)
-            (service-extension profile-service-type
-                               spice-vdagent-profile)))))
+  (service-type
+   (name 'spice-vdagent)
+   (default-value (spice-vdagent-configuration))
+   (extensions
+    (list (service-extension shepherd-root-service-type
+                             spice-vdagent-shepherd-service)
+          (service-extension profile-service-type
+                             spice-vdagent-profile)))))
 
 (define* (spice-vdagent-service
           #:optional (config (spice-vdagent-configuration)))
diff --git a/gnu/system.scm b/gnu/system.scm
index 7cc4f134b7..8a3ae27d04 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -63,6 +63,7 @@
   #:use-module (gnu packages package-management)
   #:use-module (gnu packages pciutils)
   #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages wget)
   #:use-module (gnu packages zile)
   #:use-module (gnu services)
   #:use-module (gnu services shepherd)
@@ -790,6 +791,7 @@ of PROVENANCE-SERVICE-TYPE to its services."
   ;; Default set of networking packages.
   (list inetutils isc-dhcp
         iproute
+        wget
         ;; wireless-tools is deprecated in favor of iw, but it's still what
         ;; many people are familiar with, so keep it around.
         iw wireless-tools))
diff --git a/gnu/system/examples/vm-image.tmpl b/gnu/system/examples/vm-image.tmpl
index bcb2ba614c..697019e877 100644
--- a/gnu/system/examples/vm-image.tmpl
+++ b/gnu/system/examples/vm-image.tmpl
@@ -5,7 +5,7 @@
 ;;
 
 (use-modules (gnu) (guix) (srfi srfi-1))
-(use-service-modules desktop networking ssh xorg)
+(use-service-modules desktop mcron networking spice ssh xorg)
 (use-package-modules bootloaders certs fonts nvi
                      package-management wget xorg)
 
@@ -24,6 +24,18 @@ Run '\x1b[1;37minfo guix\x1b[0m' to browse documentation.
 accounts.\x1b[0m
 "))
 
+;;; XXX: Xfce does not implement what is needed for the SPICE dynamic
+;;; resolution to work (see:
+;;; https://gitlab.xfce.org/xfce/xfce4-settings/-/issues/142).  Workaround it
+;;; by manually invoking xrandr every second.
+(define auto-update-resolution-crutch
+  #~(job '(next-second)
+         (lambda ()
+           (setenv "DISPLAY" ":0.0")
+           (setenv "XAUTHORITY" "/home/guest/.Xauthority")
+           (execl (string-append #$xrandr "/bin/xrandr") "xrandr" "-s" "0"))
+         #:user "guest"))
+
 (operating-system
   (host-name "gnu")
   (timezone "Etc/UTC")
@@ -75,11 +87,23 @@ root ALL=(ALL) ALL
                            (default-user "guest")
                            (xorg-configuration
                             (xorg-configuration
+                             ;; The QXL virtual GPU driver is added to provide
+                             ;; a better SPICE experience.
+                             (modules (cons xf86-video-qxl
+                                            %default-xorg-modules))
                              (keyboard-layout keyboard-layout)))))
 
                  ;; Uncomment the line below to add an SSH server.
                  ;;(service openssh-service-type)
 
+                 ;; Add support for the SPICE protocol, which enables dynamic
+                 ;; resizing of the guest screen resolution, clipboard
+                 ;; integration with the host, etc.
+                 (service spice-vdagent-service-type)
+
+                 (simple-service 'cron-jobs mcron-service-type
+                                 (list auto-update-resolution-crutch))
+
                  ;; Use the DHCP client service rather than NetworkManager.
                  (service dhcp-client-service-type))
 
diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm
index 689d238d1a..18bbe5ba32 100644
--- a/gnu/system/locale.scm
+++ b/gnu/system/locale.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -148,7 +148,7 @@ data format changes between libc versions."
 (define %default-locale-libcs
   ;; The libcs for which we build locales by default.
   ;; List the previous and current libc to ease transition.
-  (list glibc-2.29 glibc))
+  (list glibc))
 
 (define %default-locale-definitions
   ;; Arbitrary set of locales that are built by default.  They are here mostly