gnu: spice-gtk: Only use "good" GStreamer plugins out of the box.
[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>
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)
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 45 #:use-module (guix build-system gnu)
6d215516 46 #:use-module (guix build-system meson)
1d2c67c1
DC
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
41a659d2
MB
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
72network connection. It can be used to redirect traffic from a USB device to a
73different (virtual) machine than the one to which the USB device is attached.")
74 (license (list license:gpl2+ license:lgpl2.0+ license:lgpl2.1+))))
2ef2654d
DC
75
76(define-public virglrenderer
77 (package
78 (name "virglrenderer")
8b20a4d1 79 (version "0.6.0")
2ef2654d
DC
80 (source (origin
81 (method url-fetch)
82 (uri (string-append
83 "https://www.freedesktop.org/software/virgl/"
84 "virglrenderer-" version ".tar.bz2"))
1e5b8bee 85 (patches (search-patches "virglrenderer-CVE-2017-6386.patch"))
2ef2654d
DC
86 (sha256
87 (base32
8b20a4d1 88 "06kf0q4l52gzx5p63l8850hff8pmhp7xv1hk8zgx2apbw18y6jd5"))))
2ef2654d
DC
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
98system to use the host GPU to accelerate 3D rendering.")
99 (home-page "https://virgil3d.github.io")
100 (license (list license:expat license:bsd-3))))
289e472f
DC
101
102(define-public spice-protocol
103 (package
104 (name "spice-protocol")
6d215516 105 (version "0.14.2")
289e472f
DC
106 (source (origin
107 (method url-fetch)
108 (uri (string-append
5e569d5c 109 "https://www.spice-space.org/download/releases/"
6d215516 110 "spice-protocol-" version ".tar.xz"))
289e472f
DC
111 (sha256
112 (base32
6d215516
TGR
113 "1sgi9ksb781qs47pdbw0bmnyg8dgayn5xrzj6vzdy043nv466flg"))))
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))))))
289e472f
DC
125 (synopsis "Protocol headers for the SPICE protocol")
126 (description "SPICE (the Simple Protocol for Independent Computing
127Environments) is a remote-display system built for virtual environments
128which allows users to view a desktop computing environment.")
5e569d5c 129 (home-page "https://www.spice-space.org")
289e472f 130 (license (list license:bsd-3 license:lgpl2.1+))))
bb28cf90
DC
131
132(define-public spice-gtk
133 (package
134 (name "spice-gtk")
4f20e0a2 135 (version "0.37")
bb28cf90
DC
136 (source (origin
137 (method url-fetch)
138 (uri (string-append
f057755e 139 "https://spice-space.org/download/gtk/"
bb28cf90
DC
140 "spice-gtk-" version ".tar.bz2"))
141 (sha256
142 (base32
4f20e0a2 143 "1drvj8y35gnxbnrxsipwi15yh0vs9ixzv4wslz6r3lra8w3bfa0z"))))
bb28cf90
DC
144 (build-system gnu-build-system)
145 (propagated-inputs
146 `(("gstreamer" ,gstreamer)
bb28cf90
DC
147 ("gst-plugins-base" ,gst-plugins-base)
148 ("gst-plugins-good" ,gst-plugins-good)
4f20e0a2 149 ("spice-protocol" ,spice-protocol)
a2d2c0bf
MB
150
151 ;; These are required by the pkg-config files.
152 ("gtk+" ,gtk+)
153 ("pixman" ,pixman)
154 ("openssl" ,openssl)))
bb28cf90
DC
155 (inputs
156 `(("glib-networking" ,glib-networking)
c44dd0d6 157 ("gobject-introspection" ,gobject-introspection)
fbd2a245 158 ("json-glib" ,json-glib)
bb28cf90 159 ("libepoxy" ,libepoxy)
4bd428a7 160 ("libjpeg" ,libjpeg-turbo)
bb28cf90
DC
161 ("libxcb" ,libxcb)
162 ("lz4" ,lz4)
163 ("mesa" ,mesa)
bb28cf90
DC
164 ("pulseaudio" ,pulseaudio)
165 ("python" ,python)
bb28cf90 166 ("opus" ,opus)
bb28cf90
DC
167 ("usbredir" ,usbredir)))
168 (native-inputs
169 `(("glib:bin" ,glib "bin")
170 ("intltool" ,intltool)
10e73bbc
EF
171 ("pkg-config" ,pkg-config)
172 ("vala" ,vala)))
bb28cf90
DC
173 (arguments
174 `(#:configure-flags
175 '("--enable-gstaudio"
176 "--enable-gstvideo"
c44dd0d6 177 "--enable-pulse"
10e73bbc 178 "--enable-vala"
c44dd0d6 179 "--enable-introspection")
bb28cf90
DC
180 #:phases
181 (modify-phases %standard-phases
fbd2a245
MB
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))
29c6fb0d
MB
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)))
bb28cf90
DC
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.")
f057755e 209 (home-page "https://www.spice-space.org")
bb28cf90 210 (license (list license:lgpl2.1+ license:lgpl2.0+))))
3cbd37e4
DC
211
212(define-public spice
213 (package
214 (name "spice")
c0dc4179 215 (version "0.14.3")
3cbd37e4
DC
216 (source (origin
217 (method url-fetch)
218 (uri (string-append
b142756d 219 "https://www.spice-space.org/download/releases/"
f6b7ccc9 220 "spice-server/spice-" version ".tar.bz2"))
3cbd37e4
DC
221 (sha256
222 (base32
c0dc4179 223 "05512vkfayw18ypg4acqbbpr72nsnsz9bj7k8c2wyrvnl3j4n7am"))))
3cbd37e4
DC
224 (build-system gnu-build-system)
225 (propagated-inputs
226 `(("openssl" ,openssl)
227 ("pixman" ,pixman)
228 ("spice-protocol" ,spice-protocol)))
229 (inputs
5f2a7f4f
DC
230 `(("cyrus-sasl" ,cyrus-sasl)
231 ("glib" ,glib)
9b81876f 232 ("libjpeg-turbo" ,libjpeg-turbo)
17adb70f 233 ("libcacard" ,libcacard) ; smartcard support
3cbd37e4
DC
234 ("lz4" ,lz4)
235 ("opus" ,opus)
b142756d 236 ("orc" ,orc)
3cbd37e4
DC
237 ("zlib" ,zlib)))
238 (native-inputs
239 `(("pkg-config" ,pkg-config)
240 ("python" ,python)
f6b7ccc9
MB
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)))
3cbd37e4
DC
246 (arguments
247 `(#:configure-flags
f6b7ccc9
MB
248 '("--enable-lz4"
249 "--enable-automated-tests")
8504d192
LC
250
251 ;; Several tests appear to be opening the same sockets concurrently.
65211552 252 #:parallel-tests? #f))
3cbd37e4
DC
253 (synopsis "Server implementation of the SPICE protocol")
254 (description "SPICE is a remote display system built for virtual
36a4366d 255environments which allows you to view a computing @code{desktop} environment
3cbd37e4
DC
256not only on the machine where it is running, but from anywhere on the
257Internet and from a wide variety of machine architectures.")
d5ae997a 258 (home-page "https://www.spice-space.org")
3cbd37e4 259 (license (list license:lgpl2.1+ license:lgpl2.0+))))
33b0f4a4
DC
260
261(define-public spice-vdagent
262 (package
263 (name "spice-vdagent")
264 (version "0.17.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 "0gdkyylyg1hksg0i0anvznqfli2q39335fnrmcd6847frpc8njpi"))))
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"))
e02cd2b8
DC
285 #t))
286 (add-after 'unpack 'patch-spice-vdagent.desktop
287 (lambda* (#:key outputs #:allow-other-keys)
288 (substitute* "data/spice-vdagent.desktop"
3f995aaf 289 (("Exec=/usr/bin/spice-vdagent")
e02cd2b8
DC
290 (string-append "Exec=" (assoc-ref outputs "out")
291 "/bin/spice-vdagent")))
33b0f4a4
DC
292 #t)))))
293 (inputs
294 `(("alsa-lib" ,alsa-lib)
295 ("dbus" ,dbus)
296 ("glib" ,glib)
297 ("libpciaccess" ,libpciaccess)
298 ("libx11" ,libx11)
299 ("libxext" ,libxext)
300 ("libxfixes" ,libxfixes)
301 ("libxinerama" ,libxinerama)
302 ("libxrandr" ,libxrandr)
303 ("spice-protocol" ,spice-protocol)))
304 (native-inputs
305 `(("pkg-config" ,pkg-config)))
306 (synopsis "Spice agent for Linux")
307 (description "Spice-vdagent enables sharing the clipboard and guest display
308resolution scaling on graphical console window resize.")
d5ae997a 309 (home-page "https://www.spice-space.org")
33b0f4a4 310 (license license:gpl3+)))
6144dff5 311
ee3d20b9
CB
312(define-public libcacard
313 (package
314 (name "libcacard")
315 (version "2.7.0")
316 (source (origin
317 (method url-fetch)
318 (uri (string-append
319 "https://gitlab.freedesktop.org/spice/libcacard/uploads/"
320 "56cb2499198e78e560a1d4c716cd8ab1"
321 "/libcacard-" version ".tar.xz"))
322 (sha256
323 (base32
324 "0vyvkk4b6xjwq1ccggql13c1x7g4y90clpkqw28257azgn2a1c8n"))))
325 (build-system gnu-build-system)
326 (arguments
327 '(#:tests? #f ; TODO Tests require gnutls built with
328 ; p11-kit
329 #:phases
330 (modify-phases %standard-phases
331 (add-after 'unpack 'patch-tests
332 (lambda* (#:key inputs #:allow-other-keys)
333 (substitute* "tests/setup-softhsm2.sh"
334 (("\\/usr\\/lib64\\/pkcs11\\/libsofthsm2\\.so")
335 (string-append (assoc-ref inputs "softhsm")
336 "/lib/softhsm/libsofthsm2.so")))
337 #t)))))
338 (propagated-inputs
339 `(("glib" ,glib) ; Requires: in the pkg-config file
340 ("nss" ,nss))) ; Requires.private: in the pkg-config
341 ; file
342 (native-inputs
343 `(("openssl" ,openssl)
344 ("nss" ,nss "bin")
345 ("opensc" ,opensc)
346 ("softhsm" ,softhsm)
347 ("gnutls" ,gnutls)
348 ("pkg-config" ,pkg-config)
349 ("which" ,which)))
350 (synopsis "Emulate and share smart cards with virtual machines")
351 (description
352 "The @acronym{CAC,Common Access Card} library can be used to emulate and
353share smart cards from client system to local or remote virtual machines.")
354 (home-page "https://gitlab.freedesktop.org/spice/libcacard")
355 (license license:lgpl2.1+)))
356
6144dff5
DC
357(define-public virt-viewer
358 (package
359 (name "virt-viewer")
800248fe 360 (version "7.0")
6144dff5
DC
361 (source (origin
362 (method url-fetch)
363 (uri (string-append
364 "https://virt-manager.org/download/sources/virt-viewer/"
365 "virt-viewer-" version ".tar.gz"))
366 (sha256
367 (base32
800248fe 368 "00y9vi69sja4pkrfnvrkwsscm41bqrjzvp8aijb20pvg6ymczhj7"))))
6144dff5
DC
369 (build-system gnu-build-system)
370 (inputs
371 `(("gtk+" ,gtk+)
372 ("libcap" ,libcap)
373 ("libxml2" ,libxml2)
f54510d2 374 ("spice-gtk" ,spice-gtk)))
6144dff5
DC
375 (native-inputs
376 `(("glib:bin" ,glib "bin")
377 ("intltool" ,intltool)
378 ("pkg-config" ,pkg-config)))
379 (arguments
380 `(#:configure-flags
381 '("--with-spice-gtk")
382 #:phases
383 (modify-phases %standard-phases
384 (add-after
385 'install 'wrap-remote-viewer
386 (lambda* (#:key inputs outputs #:allow-other-keys)
387 (let ((out (assoc-ref outputs "out"))
388 (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH")))
389 (wrap-program (string-append out "/bin/remote-viewer")
390 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
391 #t)))))
392 (synopsis "Graphical console client for virtual machines")
393 (description "Graphical console client for virtual machines using SPICE or
394VNC.")
395 (home-page "https://virt-manager.org")
396 (license license:gpl2+)))