1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 David Craven <david@craven.ch>
3 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
5 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages spice)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages autotools)
25 #:use-module (gnu packages base)
26 #:use-module (gnu packages compression)
27 #:use-module (gnu packages cyrus-sasl)
28 #:use-module (gnu packages gl)
29 #:use-module (gnu packages glib)
30 #:use-module (gnu packages gnome)
31 #:use-module (gnu packages gstreamer)
32 #:use-module (gnu packages gtk)
33 #:use-module (gnu packages image)
34 #:use-module (gnu packages libusb)
35 #:use-module (gnu packages linux)
36 #:use-module (gnu packages nss)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages pulseaudio)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages security-token)
41 #:use-module (gnu packages tls)
42 #:use-module (gnu packages xorg)
43 #:use-module (gnu packages xdisorg)
44 #:use-module (gnu packages xiph)
45 #:use-module (gnu packages xml)
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system meson)
48 #:use-module (guix download)
49 #:use-module (guix packages)
50 #:use-module ((guix licenses) #:prefix license:)
51 #:use-module (guix utils))
53 (define-public usbredir
56 (home-page "https://spice-space.org")
60 (uri (string-append home-page "/download/" name "/" name "-"
64 "19jnpzlanq0a1m5lmlcsp50wxf7icxvpvclx7hnf0zxw8azngqd3"))))
65 (build-system gnu-build-system)
67 `(("libusb" ,libusb)))
69 `(("autoconf" ,autoconf)
70 ("automake" ,automake)
72 ("pkg-config" ,pkg-config)))
73 (synopsis "Tools for sending USB device traffic over a network")
75 "Usbredir is a network protocol for sending USB device traffic over a
76 network connection. It can be used to redirect traffic from a USB device to a
77 different (virtual) machine than the one to which the USB device is attached.")
78 (license (list license:gpl2+ license:lgpl2.0+ license:lgpl2.1+))))
80 (define-public virglrenderer
82 (name "virglrenderer")
87 "https://www.freedesktop.org/software/virgl/"
88 "virglrenderer-" version ".tar.bz2"))
89 (patches (search-patches "virglrenderer-CVE-2017-6386.patch"))
92 "06kf0q4l52gzx5p63l8850hff8pmhp7xv1hk8zgx2apbw18y6jd5"))))
93 (build-system gnu-build-system)
95 `(("libepoxy" ,libepoxy)
99 `(("pkg-config" ,pkg-config)))
100 (synopsis "Virtual 3D GPU library")
101 (description "A virtual 3D GPU library that enables a virtualized operating
102 system to use the host GPU to accelerate 3D rendering.")
103 (home-page "https://virgil3d.github.io")
104 (license (list license:expat license:bsd-3))))
106 (define-public spice-protocol
108 (name "spice-protocol")
113 "https://www.spice-space.org/download/releases/"
114 "spice-protocol-" version ".tar.xz"))
117 "0yj8k7gcirrsf21w0q6146n5g4nzn2pqky4p90n5760m5ayfb1pr"))))
118 (build-system meson-build-system)
121 (modify-phases %standard-phases
122 (add-after 'unpack 'install-documentation
123 (lambda* (#:key outputs #:allow-other-keys)
124 (let* ((out (assoc-ref outputs "out"))
125 (doc (string-append out "/share/doc/"
126 ,name "-" ,version)))
127 (install-file "COPYING" doc)
129 (synopsis "Protocol headers for the SPICE protocol")
130 (description "SPICE (the Simple Protocol for Independent Computing
131 Environments) is a remote-display system built for virtual environments
132 which allows users to view a desktop computing environment.")
133 (home-page "https://www.spice-space.org")
134 (license (list license:bsd-3 license:lgpl2.1+))))
136 (define-public spice-gtk
143 "https://spice-space.org/download/gtk/"
144 "spice-gtk-" version ".tar.bz2"))
147 "1drvj8y35gnxbnrxsipwi15yh0vs9ixzv4wslz6r3lra8w3bfa0z"))))
148 (build-system gnu-build-system)
150 `(("gstreamer" ,gstreamer)
151 ("gst-plugins-base" ,gst-plugins-base)
152 ("gst-plugins-good" ,gst-plugins-good)
153 ("spice-protocol" ,spice-protocol)
155 ;; These are required by the pkg-config files.
158 ("openssl" ,openssl)))
160 `(("glib-networking" ,glib-networking)
161 ("gobject-introspection" ,gobject-introspection)
162 ("json-glib" ,json-glib)
163 ("libepoxy" ,libepoxy)
164 ("libjpeg" ,libjpeg-turbo)
168 ("pulseaudio" ,pulseaudio)
171 ("usbredir" ,usbredir)))
173 `(("glib:bin" ,glib "bin")
174 ("intltool" ,intltool)
175 ("pkg-config" ,pkg-config)
179 '("--enable-gstaudio"
183 "--enable-introspection")
185 (modify-phases %standard-phases
186 (add-before 'check 'disable-session-test
188 ;; XXX: Disable session tests, because they require USB support,
189 ;; which is not available in the build container.
190 (substitute* "tests/Makefile"
191 (("test-session\\$\\(EXEEXT\\) ") ""))
193 (add-after 'install 'patch-la-files
194 (lambda* (#:key inputs outputs #:allow-other-keys)
195 (let ((out (assoc-ref outputs "out"))
196 (libjpeg (assoc-ref inputs "libjpeg")))
197 ;; Add an absolute reference for libjpeg in the .la files
198 ;; so it does not have to be propagated.
199 (substitute* (find-files (string-append out "/lib") "\\.la$")
201 (string-append "-L" libjpeg "/lib -ljpeg")))
205 (lambda* (#:key inputs outputs #:allow-other-keys)
206 (let ((out (assoc-ref outputs "out"))
207 (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH")))
208 (wrap-program (string-append out "/bin/spicy")
209 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
211 (synopsis "Gtk client and libraries for SPICE remote desktop servers")
212 (description "Gtk client and libraries for SPICE remote desktop servers.")
213 (home-page "https://www.spice-space.org")
214 (license (list license:lgpl2.1+ license:lgpl2.0+))))
223 "https://www.spice-space.org/download/releases/"
224 "spice-server/spice-" version ".tar.bz2"))
227 "05512vkfayw18ypg4acqbbpr72nsnsz9bj7k8c2wyrvnl3j4n7am"))))
228 (build-system gnu-build-system)
230 `(("openssl" ,openssl)
232 ("spice-protocol" ,spice-protocol)))
234 `(("cyrus-sasl" ,cyrus-sasl)
236 ("libjpeg-turbo" ,libjpeg-turbo)
237 ("libcacard" ,libcacard) ; smartcard support
243 `(("pkg-config" ,pkg-config)
245 ("spice-gtk" ,spice-gtk)
247 ;; These are needed for the server listen tests.
248 ("glib-networking" ,glib-networking)
249 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)))
253 "--enable-automated-tests")
255 ;; Several tests appear to be opening the same sockets concurrently.
256 #:parallel-tests? #f))
257 (synopsis "Server implementation of the SPICE protocol")
258 (description "SPICE is a remote display system built for virtual
259 environments which allows you to view a computing @code{desktop} environment
260 not only on the machine where it is running, but from anywhere on the
261 Internet and from a wide variety of machine architectures.")
262 (home-page "https://www.spice-space.org")
263 (license (list license:lgpl2.1+ license:lgpl2.0+))))
265 (define-public spice-vdagent
267 (name "spice-vdagent")
272 "http://www.spice-space.org/download/releases/"
273 "spice-vdagent-" version ".tar.bz2"))
276 "0n9k2kna2gd1zi6jv45zsp2jlv439nz5l5jjijirxqaycwi74srf"))))
277 (build-system gnu-build-system)
280 '("--localstatedir=/var")
282 (modify-phases %standard-phases
283 (add-after 'unpack 'patch-makefile.in
285 (substitute* "Makefile.in"
286 (((string-append "\\$\\(mkdir_p\\) \\$\\(DESTDIR\\)"
287 "\\$\\(localstatedir\\)/run/spice-vdagentd"))
288 "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd"))
290 (add-after 'unpack 'patch-spice-vdagent.desktop
291 (lambda* (#:key outputs #:allow-other-keys)
292 (substitute* "data/spice-vdagent.desktop"
293 (("Exec=/usr/bin/spice-vdagent")
294 (string-append "Exec=" (assoc-ref outputs "out")
295 "/bin/spice-vdagent")))
298 `(("alsa-lib" ,alsa-lib)
302 ("libpciaccess" ,libpciaccess)
305 ("libxfixes" ,libxfixes)
306 ("libxinerama" ,libxinerama)
307 ("libxrandr" ,libxrandr)
308 ("spice-protocol" ,spice-protocol)))
310 `(("pkg-config" ,pkg-config)))
311 (synopsis "Spice agent for Linux")
312 (description "Spice-vdagent enables sharing the clipboard and guest display
313 resolution scaling on graphical console window resize.")
314 (home-page "https://www.spice-space.org")
315 (license license:gpl3+)))
317 (define-public libcacard
324 "https://gitlab.freedesktop.org/spice/libcacard/uploads/"
325 "56cb2499198e78e560a1d4c716cd8ab1"
326 "/libcacard-" version ".tar.xz"))
329 "0vyvkk4b6xjwq1ccggql13c1x7g4y90clpkqw28257azgn2a1c8n"))))
330 (build-system gnu-build-system)
332 '(#:tests? #f ; TODO Tests require gnutls built with
335 (modify-phases %standard-phases
336 (add-after 'unpack 'patch-tests
337 (lambda* (#:key inputs #:allow-other-keys)
338 (substitute* "tests/setup-softhsm2.sh"
339 (("\\/usr\\/lib64\\/pkcs11\\/libsofthsm2\\.so")
340 (string-append (assoc-ref inputs "softhsm")
341 "/lib/softhsm/libsofthsm2.so")))
344 `(("glib" ,glib) ; Requires: in the pkg-config file
345 ("nss" ,nss))) ; Requires.private: in the pkg-config
348 `(("openssl" ,openssl)
353 ("pkg-config" ,pkg-config)
355 (synopsis "Emulate and share smart cards with virtual machines")
357 "The @acronym{CAC,Common Access Card} library can be used to emulate and
358 share smart cards from client system to local or remote virtual machines.")
359 (home-page "https://gitlab.freedesktop.org/spice/libcacard")
360 (license license:lgpl2.1+)))
362 (define-public virt-viewer
369 "https://virt-manager.org/download/sources/virt-viewer/"
370 "virt-viewer-" version ".tar.gz"))
373 "00y9vi69sja4pkrfnvrkwsscm41bqrjzvp8aijb20pvg6ymczhj7"))))
374 (build-system gnu-build-system)
380 ("spice-gtk" ,spice-gtk)))
382 `(("glib:bin" ,glib "bin")
383 ("intltool" ,intltool)
384 ("pkg-config" ,pkg-config)))
387 '("--with-spice-gtk")
389 (modify-phases %standard-phases
391 'install 'wrap-remote-viewer
392 (lambda* (#:key inputs outputs #:allow-other-keys)
393 (let ((out (assoc-ref outputs "out"))
394 (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH")))
395 (wrap-program (string-append out "/bin/remote-viewer")
396 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
398 (synopsis "Graphical console client for virtual machines")
399 (description "Graphical console client for virtual machines using SPICE or
401 (home-page "https://virt-manager.org")
402 (license license:gpl2+)))