gnu: Graphviz: Fix CVE-2020-18032.
[jackhill/guix/guix.git] / gnu / packages / spice.scm
CommitLineData
1d2c67c1
DC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 David Craven <david@craven.ch>
2aa18eeb 3;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
44ad1c16 4;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
29c6fb0d 5;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
1d2c67c1
DC
6;;;
7;;; This file is part of GNU Guix.
8;;;
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.
13;;;
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.
18;;;
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/>.
21
22(define-module (gnu packages spice)
23 #:use-module (gnu packages)
2aa18eeb 24 #:use-module (gnu packages autotools)
ee3d20b9 25 #:use-module (gnu packages base)
bb28cf90 26 #:use-module (gnu packages compression)
5f2a7f4f 27 #:use-module (gnu packages cyrus-sasl)
2ef2654d 28 #:use-module (gnu packages gl)
bb28cf90
DC
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)
1d2c67c1 34 #:use-module (gnu packages libusb)
2ef2654d 35 #:use-module (gnu packages linux)
ee3d20b9 36 #:use-module (gnu packages nss)
1d2c67c1 37 #:use-module (gnu packages pkg-config)
bb28cf90
DC
38 #:use-module (gnu packages pulseaudio)
39 #:use-module (gnu packages python)
ee3d20b9 40 #:use-module (gnu packages security-token)
bb28cf90
DC
41 #:use-module (gnu packages tls)
42 #:use-module (gnu packages xorg)
43 #:use-module (gnu packages xdisorg)
44 #:use-module (gnu packages xiph)
6144dff5 45 #:use-module (gnu packages xml)
1d2c67c1 46 #:use-module (guix build-system gnu)
6d215516 47 #:use-module (guix build-system meson)
1d2c67c1
DC
48 #:use-module (guix download)
49 #:use-module (guix packages)
50 #:use-module ((guix licenses) #:prefix license:)
51 #:use-module (guix utils))
52
53(define-public usbredir
41a659d2
MB
54 (package
55 (name "usbredir")
56 (home-page "https://spice-space.org")
2aa18eeb 57 (version "0.9.0")
41a659d2
MB
58 (source (origin
59 (method url-fetch)
60 (uri (string-append home-page "/download/" name "/" name "-"
2aa18eeb 61 version ".tar.xz"))
41a659d2
MB
62 (sha256
63 (base32
2aa18eeb 64 "19jnpzlanq0a1m5lmlcsp50wxf7icxvpvclx7hnf0zxw8azngqd3"))))
41a659d2
MB
65 (build-system gnu-build-system)
66 (propagated-inputs
67 `(("libusb" ,libusb)))
68 (native-inputs
2aa18eeb
TGR
69 `(("autoconf" ,autoconf)
70 ("automake" ,automake)
71 ("libtool" ,libtool)
72 ("pkg-config" ,pkg-config)))
41a659d2
MB
73 (synopsis "Tools for sending USB device traffic over a network")
74 (description
75 "Usbredir is a network protocol for sending USB device traffic over a
76network connection. It can be used to redirect traffic from a USB device to a
77different (virtual) machine than the one to which the USB device is attached.")
78 (license (list license:gpl2+ license:lgpl2.0+ license:lgpl2.1+))))
2ef2654d
DC
79
80(define-public virglrenderer
81 (package
82 (name "virglrenderer")
8b20a4d1 83 (version "0.6.0")
2ef2654d
DC
84 (source (origin
85 (method url-fetch)
86 (uri (string-append
87 "https://www.freedesktop.org/software/virgl/"
88 "virglrenderer-" version ".tar.bz2"))
1e5b8bee 89 (patches (search-patches "virglrenderer-CVE-2017-6386.patch"))
2ef2654d
DC
90 (sha256
91 (base32
8b20a4d1 92 "06kf0q4l52gzx5p63l8850hff8pmhp7xv1hk8zgx2apbw18y6jd5"))))
2ef2654d
DC
93 (build-system gnu-build-system)
94 (inputs
95 `(("libepoxy" ,libepoxy)
96 ("mesa" ,mesa)
97 ("udev" ,eudev)))
98 (native-inputs
99 `(("pkg-config" ,pkg-config)))
100 (synopsis "Virtual 3D GPU library")
101 (description "A virtual 3D GPU library that enables a virtualized operating
102system to use the host GPU to accelerate 3D rendering.")
103 (home-page "https://virgil3d.github.io")
104 (license (list license:expat license:bsd-3))))
289e472f
DC
105
106(define-public spice-protocol
107 (package
108 (name "spice-protocol")
05e9a463 109 (version "0.14.3")
289e472f
DC
110 (source (origin
111 (method url-fetch)
112 (uri (string-append
5e569d5c 113 "https://www.spice-space.org/download/releases/"
6d215516 114 "spice-protocol-" version ".tar.xz"))
289e472f
DC
115 (sha256
116 (base32
05e9a463 117 "0yj8k7gcirrsf21w0q6146n5g4nzn2pqky4p90n5760m5ayfb1pr"))))
6d215516
TGR
118 (build-system meson-build-system)
119 (arguments
120 `(#:phases
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)
128 #t))))))
289e472f
DC
129 (synopsis "Protocol headers for the SPICE protocol")
130 (description "SPICE (the Simple Protocol for Independent Computing
131Environments) is a remote-display system built for virtual environments
132which allows users to view a desktop computing environment.")
5e569d5c 133 (home-page "https://www.spice-space.org")
289e472f 134 (license (list license:bsd-3 license:lgpl2.1+))))
bb28cf90
DC
135
136(define-public spice-gtk
137 (package
138 (name "spice-gtk")
4f20e0a2 139 (version "0.37")
bb28cf90
DC
140 (source (origin
141 (method url-fetch)
142 (uri (string-append
f057755e 143 "https://spice-space.org/download/gtk/"
bb28cf90
DC
144 "spice-gtk-" version ".tar.bz2"))
145 (sha256
146 (base32
4f20e0a2 147 "1drvj8y35gnxbnrxsipwi15yh0vs9ixzv4wslz6r3lra8w3bfa0z"))))
bb28cf90
DC
148 (build-system gnu-build-system)
149 (propagated-inputs
150 `(("gstreamer" ,gstreamer)
bb28cf90
DC
151 ("gst-plugins-base" ,gst-plugins-base)
152 ("gst-plugins-good" ,gst-plugins-good)
4f20e0a2 153 ("spice-protocol" ,spice-protocol)
a2d2c0bf
MB
154
155 ;; These are required by the pkg-config files.
156 ("gtk+" ,gtk+)
157 ("pixman" ,pixman)
158 ("openssl" ,openssl)))
bb28cf90
DC
159 (inputs
160 `(("glib-networking" ,glib-networking)
c44dd0d6 161 ("gobject-introspection" ,gobject-introspection)
fbd2a245 162 ("json-glib" ,json-glib)
bb28cf90 163 ("libepoxy" ,libepoxy)
4bd428a7 164 ("libjpeg" ,libjpeg-turbo)
bb28cf90
DC
165 ("libxcb" ,libxcb)
166 ("lz4" ,lz4)
167 ("mesa" ,mesa)
bb28cf90
DC
168 ("pulseaudio" ,pulseaudio)
169 ("python" ,python)
bb28cf90 170 ("opus" ,opus)
bb28cf90
DC
171 ("usbredir" ,usbredir)))
172 (native-inputs
173 `(("glib:bin" ,glib "bin")
174 ("intltool" ,intltool)
10e73bbc
EF
175 ("pkg-config" ,pkg-config)
176 ("vala" ,vala)))
bb28cf90
DC
177 (arguments
178 `(#:configure-flags
179 '("--enable-gstaudio"
180 "--enable-gstvideo"
c44dd0d6 181 "--enable-pulse"
10e73bbc 182 "--enable-vala"
c44dd0d6 183 "--enable-introspection")
bb28cf90
DC
184 #:phases
185 (modify-phases %standard-phases
fbd2a245
MB
186 (add-before 'check 'disable-session-test
187 (lambda _
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\\) ") ""))
192 #t))
29c6fb0d
MB
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$")
200 (("-ljpeg")
201 (string-append "-L" libjpeg "/lib -ljpeg")))
202 #t)))
bb28cf90
DC
203 (add-after
204 'install 'wrap-spicy
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))))
210 #t)))))
211 (synopsis "Gtk client and libraries for SPICE remote desktop servers")
212 (description "Gtk client and libraries for SPICE remote desktop servers.")
f057755e 213 (home-page "https://www.spice-space.org")
bb28cf90 214 (license (list license:lgpl2.1+ license:lgpl2.0+))))
3cbd37e4
DC
215
216(define-public spice
217 (package
218 (name "spice")
c0dc4179 219 (version "0.14.3")
3cbd37e4
DC
220 (source (origin
221 (method url-fetch)
222 (uri (string-append
b142756d 223 "https://www.spice-space.org/download/releases/"
f6b7ccc9 224 "spice-server/spice-" version ".tar.bz2"))
3cbd37e4
DC
225 (sha256
226 (base32
c0dc4179 227 "05512vkfayw18ypg4acqbbpr72nsnsz9bj7k8c2wyrvnl3j4n7am"))))
3cbd37e4
DC
228 (build-system gnu-build-system)
229 (propagated-inputs
230 `(("openssl" ,openssl)
231 ("pixman" ,pixman)
232 ("spice-protocol" ,spice-protocol)))
233 (inputs
5f2a7f4f
DC
234 `(("cyrus-sasl" ,cyrus-sasl)
235 ("glib" ,glib)
9b81876f 236 ("libjpeg-turbo" ,libjpeg-turbo)
17adb70f 237 ("libcacard" ,libcacard) ; smartcard support
3cbd37e4
DC
238 ("lz4" ,lz4)
239 ("opus" ,opus)
b142756d 240 ("orc" ,orc)
3cbd37e4
DC
241 ("zlib" ,zlib)))
242 (native-inputs
243 `(("pkg-config" ,pkg-config)
244 ("python" ,python)
f6b7ccc9
MB
245 ("spice-gtk" ,spice-gtk)
246
247 ;; These are needed for the server listen tests.
248 ("glib-networking" ,glib-networking)
249 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)))
3cbd37e4
DC
250 (arguments
251 `(#:configure-flags
f6b7ccc9
MB
252 '("--enable-lz4"
253 "--enable-automated-tests")
8504d192
LC
254
255 ;; Several tests appear to be opening the same sockets concurrently.
65211552 256 #:parallel-tests? #f))
3cbd37e4
DC
257 (synopsis "Server implementation of the SPICE protocol")
258 (description "SPICE is a remote display system built for virtual
36a4366d 259environments which allows you to view a computing @code{desktop} environment
3cbd37e4
DC
260not only on the machine where it is running, but from anywhere on the
261Internet and from a wide variety of machine architectures.")
d5ae997a 262 (home-page "https://www.spice-space.org")
3cbd37e4 263 (license (list license:lgpl2.1+ license:lgpl2.0+))))
33b0f4a4
DC
264
265(define-public spice-vdagent
266 (package
267 (name "spice-vdagent")
a33afba4 268 (version "0.21.0")
33b0f4a4
DC
269 (source (origin
270 (method url-fetch)
271 (uri (string-append
272 "http://www.spice-space.org/download/releases/"
273 "spice-vdagent-" version ".tar.bz2"))
274 (sha256
275 (base32
a33afba4 276 "0n8jlc1pv6mkry161y656b1nk9hhhminjq6nymzmmyjl7k95ymzx"))))
33b0f4a4
DC
277 (build-system gnu-build-system)
278 (arguments
279 `(#:configure-flags
280 '("--localstatedir=/var")
a33afba4
MC
281 ;; The test-session-info test fails for unknown reasons (see:
282 ;; https://gitlab.freedesktop.org/spice/linux/vd_agent/-/issues/24).
283 #:make-flags '("XFAIL_TESTS=tests/test-session-info")
33b0f4a4
DC
284 #:phases
285 (modify-phases %standard-phases
286 (add-after 'unpack 'patch-makefile.in
287 (lambda _
288 (substitute* "Makefile.in"
289 (((string-append "\\$\\(mkdir_p\\) \\$\\(DESTDIR\\)"
290 "\\$\\(localstatedir\\)/run/spice-vdagentd"))
a33afba4 291 "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd"))))
e02cd2b8
DC
292 (add-after 'unpack 'patch-spice-vdagent.desktop
293 (lambda* (#:key outputs #:allow-other-keys)
294 (substitute* "data/spice-vdagent.desktop"
3f995aaf 295 (("Exec=/usr/bin/spice-vdagent")
e02cd2b8 296 (string-append "Exec=" (assoc-ref outputs "out")
a33afba4
MC
297 "/bin/spice-vdagent")))))
298 (add-after 'unpack 'fix-test-termination
299 (lambda _
300 ;; The termination tests depend on finding the socket file name
301 ;; in the spice-vdagent command line it launched, but by default
302 ;; ps truncates its output, which causes the test to fail (see:
303 ;; https://gitlab.freedesktop.org/spice/linux/vd_agent/-/merge_requests/36).
304 (substitute* "tests/test-termination.c"
305 (("ps -ef")
306 "ps -efww")))))))
33b0f4a4
DC
307 (inputs
308 `(("alsa-lib" ,alsa-lib)
309 ("dbus" ,dbus)
310 ("glib" ,glib)
a33afba4 311 ("gtk+" ,gtk+)
395489cd 312 ("libdrm" ,libdrm)
33b0f4a4
DC
313 ("libpciaccess" ,libpciaccess)
314 ("libx11" ,libx11)
315 ("libxext" ,libxext)
316 ("libxfixes" ,libxfixes)
317 ("libxinerama" ,libxinerama)
318 ("libxrandr" ,libxrandr)
319 ("spice-protocol" ,spice-protocol)))
320 (native-inputs
a33afba4
MC
321 `(("pkg-config" ,pkg-config)
322 ("procps" ,procps))) ;tests use 'ps'
33b0f4a4
DC
323 (synopsis "Spice agent for Linux")
324 (description "Spice-vdagent enables sharing the clipboard and guest display
325resolution scaling on graphical console window resize.")
d5ae997a 326 (home-page "https://www.spice-space.org")
33b0f4a4 327 (license license:gpl3+)))
6144dff5 328
ee3d20b9
CB
329(define-public libcacard
330 (package
331 (name "libcacard")
332 (version "2.7.0")
333 (source (origin
334 (method url-fetch)
335 (uri (string-append
336 "https://gitlab.freedesktop.org/spice/libcacard/uploads/"
337 "56cb2499198e78e560a1d4c716cd8ab1"
338 "/libcacard-" version ".tar.xz"))
339 (sha256
340 (base32
341 "0vyvkk4b6xjwq1ccggql13c1x7g4y90clpkqw28257azgn2a1c8n"))))
342 (build-system gnu-build-system)
343 (arguments
344 '(#:tests? #f ; TODO Tests require gnutls built with
345 ; p11-kit
346 #:phases
347 (modify-phases %standard-phases
348 (add-after 'unpack 'patch-tests
349 (lambda* (#:key inputs #:allow-other-keys)
350 (substitute* "tests/setup-softhsm2.sh"
351 (("\\/usr\\/lib64\\/pkcs11\\/libsofthsm2\\.so")
352 (string-append (assoc-ref inputs "softhsm")
353 "/lib/softhsm/libsofthsm2.so")))
354 #t)))))
355 (propagated-inputs
356 `(("glib" ,glib) ; Requires: in the pkg-config file
357 ("nss" ,nss))) ; Requires.private: in the pkg-config
358 ; file
359 (native-inputs
360 `(("openssl" ,openssl)
361 ("nss" ,nss "bin")
362 ("opensc" ,opensc)
363 ("softhsm" ,softhsm)
364 ("gnutls" ,gnutls)
365 ("pkg-config" ,pkg-config)
366 ("which" ,which)))
367 (synopsis "Emulate and share smart cards with virtual machines")
368 (description
369 "The @acronym{CAC,Common Access Card} library can be used to emulate and
370share smart cards from client system to local or remote virtual machines.")
371 (home-page "https://gitlab.freedesktop.org/spice/libcacard")
372 (license license:lgpl2.1+)))
373
6144dff5
DC
374(define-public virt-viewer
375 (package
376 (name "virt-viewer")
800248fe 377 (version "7.0")
6144dff5
DC
378 (source (origin
379 (method url-fetch)
380 (uri (string-append
381 "https://virt-manager.org/download/sources/virt-viewer/"
382 "virt-viewer-" version ".tar.gz"))
383 (sha256
384 (base32
800248fe 385 "00y9vi69sja4pkrfnvrkwsscm41bqrjzvp8aijb20pvg6ymczhj7"))))
6144dff5
DC
386 (build-system gnu-build-system)
387 (inputs
388 `(("gtk+" ,gtk+)
facdae04 389 ("gtk-vnc" ,gtk-vnc)
6144dff5
DC
390 ("libcap" ,libcap)
391 ("libxml2" ,libxml2)
f54510d2 392 ("spice-gtk" ,spice-gtk)))
6144dff5
DC
393 (native-inputs
394 `(("glib:bin" ,glib "bin")
395 ("intltool" ,intltool)
396 ("pkg-config" ,pkg-config)))
397 (arguments
398 `(#:configure-flags
399 '("--with-spice-gtk")
400 #:phases
401 (modify-phases %standard-phases
402 (add-after
403 'install 'wrap-remote-viewer
404 (lambda* (#:key inputs outputs #:allow-other-keys)
405 (let ((out (assoc-ref outputs "out"))
406 (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH")))
407 (wrap-program (string-append out "/bin/remote-viewer")
408 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
409 #t)))))
410 (synopsis "Graphical console client for virtual machines")
411 (description "Graphical console client for virtual machines using SPICE or
412VNC.")
413 (home-page "https://virt-manager.org")
414 (license license:gpl2+)))