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