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