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