Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / spice.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 David Craven <david@craven.ch>
3 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
5 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
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)
24 #:use-module (gnu packages base)
25 #:use-module (gnu packages compression)
26 #:use-module (gnu packages cyrus-sasl)
27 #:use-module (gnu packages gl)
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)
33 #:use-module (gnu packages libusb)
34 #:use-module (gnu packages linux)
35 #:use-module (gnu packages nss)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages pulseaudio)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages security-token)
40 #:use-module (gnu packages tls)
41 #:use-module (gnu packages xorg)
42 #:use-module (gnu packages xdisorg)
43 #:use-module (gnu packages xiph)
44 #:use-module (gnu packages xml)
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
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
71 network connection. It can be used to redirect traffic from a USB device to a
72 different (virtual) machine than the one to which the USB device is attached.")
73 (license (list license:gpl2+ license:lgpl2.0+ license:lgpl2.1+))))
74
75 (define-public virglrenderer
76 (package
77 (name "virglrenderer")
78 (version "0.6.0")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append
82 "https://www.freedesktop.org/software/virgl/"
83 "virglrenderer-" version ".tar.bz2"))
84 (patches (search-patches "virglrenderer-CVE-2017-6386.patch"))
85 (sha256
86 (base32
87 "06kf0q4l52gzx5p63l8850hff8pmhp7xv1hk8zgx2apbw18y6jd5"))))
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
97 system to use the host GPU to accelerate 3D rendering.")
98 (home-page "https://virgil3d.github.io")
99 (license (list license:expat license:bsd-3))))
100
101 (define-public spice-protocol
102 (package
103 (name "spice-protocol")
104 (version "0.14.1")
105 (source (origin
106 (method url-fetch)
107 (uri (string-append
108 "https://www.spice-space.org/download/releases/"
109 "spice-protocol-" version ".tar.bz2"))
110 (sha256
111 (base32
112 "0ahk5hlanwhbc64r80xmchdav3ls156cvh9l68a0l22bhdhxmrkr"))))
113 (build-system gnu-build-system)
114 (synopsis "Protocol headers for the SPICE protocol")
115 (description "SPICE (the Simple Protocol for Independent Computing
116 Environments) is a remote-display system built for virtual environments
117 which allows users to view a desktop computing environment.")
118 (home-page "https://www.spice-space.org")
119 (license (list license:bsd-3 license:lgpl2.1+))))
120
121 (define-public spice-gtk
122 (package
123 (name "spice-gtk")
124 (version "0.37")
125 (source (origin
126 (method url-fetch)
127 (uri (string-append
128 "https://spice-space.org/download/gtk/"
129 "spice-gtk-" version ".tar.bz2"))
130 (sha256
131 (base32
132 "1drvj8y35gnxbnrxsipwi15yh0vs9ixzv4wslz6r3lra8w3bfa0z"))))
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)
140 ("gst-plugins-ugly" ,gst-plugins-ugly)
141 ("spice-protocol" ,spice-protocol)
142
143 ;; These are required by the pkg-config files.
144 ("gtk+" ,gtk+)
145 ("pixman" ,pixman)
146 ("openssl" ,openssl)))
147 (inputs
148 `(("glib-networking" ,glib-networking)
149 ("gobject-introspection" ,gobject-introspection)
150 ("json-glib" ,json-glib)
151 ("libepoxy" ,libepoxy)
152 ("libjpeg" ,libjpeg-turbo)
153 ("libxcb" ,libxcb)
154 ("lz4" ,lz4)
155 ("mesa" ,mesa)
156 ("pulseaudio" ,pulseaudio)
157 ("python" ,python)
158 ("opus" ,opus)
159 ("usbredir" ,usbredir)))
160 (native-inputs
161 `(("glib:bin" ,glib "bin")
162 ("intltool" ,intltool)
163 ("pkg-config" ,pkg-config)
164 ("vala" ,vala)))
165 (arguments
166 `(#:configure-flags
167 '("--enable-gstaudio"
168 "--enable-gstvideo"
169 "--enable-pulse"
170 "--enable-vala"
171 "--enable-introspection")
172 #:phases
173 (modify-phases %standard-phases
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))
181 (add-after 'install 'patch-la-files
182 (lambda* (#:key inputs outputs #:allow-other-keys)
183 (let ((out (assoc-ref outputs "out"))
184 (libjpeg (assoc-ref inputs "libjpeg")))
185 ;; Add an absolute reference for libjpeg in the .la files
186 ;; so it does not have to be propagated.
187 (substitute* (find-files (string-append out "/lib") "\\.la$")
188 (("-ljpeg")
189 (string-append "-L" libjpeg "/lib -ljpeg")))
190 #t)))
191 (add-after
192 'install 'wrap-spicy
193 (lambda* (#:key inputs outputs #:allow-other-keys)
194 (let ((out (assoc-ref outputs "out"))
195 (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH")))
196 (wrap-program (string-append out "/bin/spicy")
197 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
198 #t)))))
199 (synopsis "Gtk client and libraries for SPICE remote desktop servers")
200 (description "Gtk client and libraries for SPICE remote desktop servers.")
201 (home-page "https://www.spice-space.org")
202 (license (list license:lgpl2.1+ license:lgpl2.0+))))
203
204 (define-public spice
205 (package
206 (name "spice")
207 (version "0.14.3")
208 (source (origin
209 (method url-fetch)
210 (uri (string-append
211 "https://www.spice-space.org/download/releases/"
212 "spice-server/spice-" version ".tar.bz2"))
213 (sha256
214 (base32
215 "05512vkfayw18ypg4acqbbpr72nsnsz9bj7k8c2wyrvnl3j4n7am"))))
216 (build-system gnu-build-system)
217 (propagated-inputs
218 `(("openssl" ,openssl)
219 ("pixman" ,pixman)
220 ("spice-protocol" ,spice-protocol)))
221 (inputs
222 `(("cyrus-sasl" ,cyrus-sasl)
223 ("glib" ,glib)
224 ("libjpeg-turbo" ,libjpeg-turbo)
225 ("libcacard" ,libcacard) ; smartcard support
226 ("lz4" ,lz4)
227 ("opus" ,opus)
228 ("orc" ,orc)
229 ("zlib" ,zlib)))
230 (native-inputs
231 `(("pkg-config" ,pkg-config)
232 ("python" ,python)
233 ("spice-gtk" ,spice-gtk)
234
235 ;; These are needed for the server listen tests.
236 ("glib-networking" ,glib-networking)
237 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)))
238 (arguments
239 `(#:configure-flags
240 '("--enable-lz4"
241 "--enable-automated-tests")
242
243 ;; Several tests appear to be opening the same sockets concurrently.
244 #:parallel-tests? #f))
245 (synopsis "Server implementation of the SPICE protocol")
246 (description "SPICE is a remote display system built for virtual
247 environments which allows you to view a computing @code{desktop} environment
248 not only on the machine where it is running, but from anywhere on the
249 Internet and from a wide variety of machine architectures.")
250 (home-page "https://www.spice-space.org")
251 (license (list license:lgpl2.1+ license:lgpl2.0+))))
252
253 (define-public spice-vdagent
254 (package
255 (name "spice-vdagent")
256 (version "0.17.0")
257 (source (origin
258 (method url-fetch)
259 (uri (string-append
260 "http://www.spice-space.org/download/releases/"
261 "spice-vdagent-" version ".tar.bz2"))
262 (sha256
263 (base32
264 "0gdkyylyg1hksg0i0anvznqfli2q39335fnrmcd6847frpc8njpi"))))
265 (build-system gnu-build-system)
266 (arguments
267 `(#:configure-flags
268 '("--localstatedir=/var")
269 #:phases
270 (modify-phases %standard-phases
271 (add-after 'unpack 'patch-makefile.in
272 (lambda _
273 (substitute* "Makefile.in"
274 (((string-append "\\$\\(mkdir_p\\) \\$\\(DESTDIR\\)"
275 "\\$\\(localstatedir\\)/run/spice-vdagentd"))
276 "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd"))
277 #t))
278 (add-after 'unpack 'patch-spice-vdagent.desktop
279 (lambda* (#:key outputs #:allow-other-keys)
280 (substitute* "data/spice-vdagent.desktop"
281 (("Exec=/usr/bin/spice-vdagent")
282 (string-append "Exec=" (assoc-ref outputs "out")
283 "/bin/spice-vdagent")))
284 #t)))))
285 (inputs
286 `(("alsa-lib" ,alsa-lib)
287 ("dbus" ,dbus)
288 ("glib" ,glib)
289 ("libpciaccess" ,libpciaccess)
290 ("libx11" ,libx11)
291 ("libxext" ,libxext)
292 ("libxfixes" ,libxfixes)
293 ("libxinerama" ,libxinerama)
294 ("libxrandr" ,libxrandr)
295 ("spice-protocol" ,spice-protocol)))
296 (native-inputs
297 `(("pkg-config" ,pkg-config)))
298 (synopsis "Spice agent for Linux")
299 (description "Spice-vdagent enables sharing the clipboard and guest display
300 resolution scaling on graphical console window resize.")
301 (home-page "https://www.spice-space.org")
302 (license license:gpl3+)))
303
304 (define-public libcacard
305 (package
306 (name "libcacard")
307 (version "2.7.0")
308 (source (origin
309 (method url-fetch)
310 (uri (string-append
311 "https://gitlab.freedesktop.org/spice/libcacard/uploads/"
312 "56cb2499198e78e560a1d4c716cd8ab1"
313 "/libcacard-" version ".tar.xz"))
314 (sha256
315 (base32
316 "0vyvkk4b6xjwq1ccggql13c1x7g4y90clpkqw28257azgn2a1c8n"))))
317 (build-system gnu-build-system)
318 (arguments
319 '(#:tests? #f ; TODO Tests require gnutls built with
320 ; p11-kit
321 #:phases
322 (modify-phases %standard-phases
323 (add-after 'unpack 'patch-tests
324 (lambda* (#:key inputs #:allow-other-keys)
325 (substitute* "tests/setup-softhsm2.sh"
326 (("\\/usr\\/lib64\\/pkcs11\\/libsofthsm2\\.so")
327 (string-append (assoc-ref inputs "softhsm")
328 "/lib/softhsm/libsofthsm2.so")))
329 #t)))))
330 (propagated-inputs
331 `(("glib" ,glib) ; Requires: in the pkg-config file
332 ("nss" ,nss))) ; Requires.private: in the pkg-config
333 ; file
334 (native-inputs
335 `(("openssl" ,openssl)
336 ("nss" ,nss "bin")
337 ("opensc" ,opensc)
338 ("softhsm" ,softhsm)
339 ("gnutls" ,gnutls)
340 ("pkg-config" ,pkg-config)
341 ("which" ,which)))
342 (synopsis "Emulate and share smart cards with virtual machines")
343 (description
344 "The @acronym{CAC,Common Access Card} library can be used to emulate and
345 share smart cards from client system to local or remote virtual machines.")
346 (home-page "https://gitlab.freedesktop.org/spice/libcacard")
347 (license license:lgpl2.1+)))
348
349 (define-public virt-viewer
350 (package
351 (name "virt-viewer")
352 (version "7.0")
353 (source (origin
354 (method url-fetch)
355 (uri (string-append
356 "https://virt-manager.org/download/sources/virt-viewer/"
357 "virt-viewer-" version ".tar.gz"))
358 (sha256
359 (base32
360 "00y9vi69sja4pkrfnvrkwsscm41bqrjzvp8aijb20pvg6ymczhj7"))))
361 (build-system gnu-build-system)
362 (inputs
363 `(("gtk+" ,gtk+)
364 ("libcap" ,libcap)
365 ("libxml2" ,libxml2)
366 ("spice-gtk" ,spice-gtk)))
367 (native-inputs
368 `(("glib:bin" ,glib "bin")
369 ("intltool" ,intltool)
370 ("pkg-config" ,pkg-config)))
371 (arguments
372 `(#:configure-flags
373 '("--with-spice-gtk")
374 #:phases
375 (modify-phases %standard-phases
376 (add-after
377 'install 'wrap-remote-viewer
378 (lambda* (#:key inputs outputs #:allow-other-keys)
379 (let ((out (assoc-ref outputs "out"))
380 (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH")))
381 (wrap-program (string-append out "/bin/remote-viewer")
382 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
383 #t)))))
384 (synopsis "Graphical console client for virtual machines")
385 (description "Graphical console client for virtual machines using SPICE or
386 VNC.")
387 (home-page "https://virt-manager.org")
388 (license license:gpl2+)))