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>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
52 (define-public usbredir
55 (home-page "https://spice-space.org")
59 (uri (string-append home-page "/download/" name "/" name "-"
63 "002yik1x7kn0427xahvnhjby2np14a6xqw7c3dx530n9h5d9rg47"))))
64 (build-system gnu-build-system)
66 `(("libusb" ,libusb)))
68 `(("pkg-config" ,pkg-config)))
69 (synopsis "Tools for sending USB device traffic over a network")
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+))))
76 (define-public virglrenderer
78 (name "virglrenderer")
83 "https://www.freedesktop.org/software/virgl/"
84 "virglrenderer-" version ".tar.bz2"))
85 (patches (search-patches "virglrenderer-CVE-2017-6386.patch"))
88 "06kf0q4l52gzx5p63l8850hff8pmhp7xv1hk8zgx2apbw18y6jd5"))))
89 (build-system gnu-build-system)
91 `(("libepoxy" ,libepoxy)
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))))
102 (define-public spice-protocol
104 (name "spice-protocol")
109 "https://www.spice-space.org/download/releases/"
110 "spice-protocol-" version ".tar.xz"))
113 "1sgi9ksb781qs47pdbw0bmnyg8dgayn5xrzj6vzdy043nv466flg"))))
114 (build-system meson-build-system)
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)
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+))))
132 (define-public spice-gtk
139 "https://spice-space.org/download/gtk/"
140 "spice-gtk-" version ".tar.bz2"))
143 "1drvj8y35gnxbnrxsipwi15yh0vs9ixzv4wslz6r3lra8w3bfa0z"))))
144 (build-system gnu-build-system)
146 `(("gstreamer" ,gstreamer)
147 ("gst-libav" ,gst-libav)
148 ("gst-plugins-base" ,gst-plugins-base)
149 ("gst-plugins-good" ,gst-plugins-good)
150 ("gst-plugins-bad" ,gst-plugins-bad)
151 ("gst-plugins-ugly" ,gst-plugins-ugly)
152 ("spice-protocol" ,spice-protocol)
154 ;; These are required by the pkg-config files.
157 ("openssl" ,openssl)))
159 `(("glib-networking" ,glib-networking)
160 ("gobject-introspection" ,gobject-introspection)
161 ("json-glib" ,json-glib)
162 ("libepoxy" ,libepoxy)
163 ("libjpeg" ,libjpeg-turbo)
167 ("pulseaudio" ,pulseaudio)
170 ("usbredir" ,usbredir)))
172 `(("glib:bin" ,glib "bin")
173 ("intltool" ,intltool)
174 ("pkg-config" ,pkg-config)
178 '("--enable-gstaudio"
182 "--enable-introspection")
184 (modify-phases %standard-phases
185 (add-before 'check 'disable-session-test
187 ;; XXX: Disable session tests, because they require USB support,
188 ;; which is not available in the build container.
189 (substitute* "tests/Makefile"
190 (("test-session\\$\\(EXEEXT\\) ") ""))
192 (add-after 'install 'patch-la-files
193 (lambda* (#:key inputs outputs #:allow-other-keys)
194 (let ((out (assoc-ref outputs "out"))
195 (libjpeg (assoc-ref inputs "libjpeg")))
196 ;; Add an absolute reference for libjpeg in the .la files
197 ;; so it does not have to be propagated.
198 (substitute* (find-files (string-append out "/lib") "\\.la$")
200 (string-append "-L" libjpeg "/lib -ljpeg")))
204 (lambda* (#:key inputs outputs #:allow-other-keys)
205 (let ((out (assoc-ref outputs "out"))
206 (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH")))
207 (wrap-program (string-append out "/bin/spicy")
208 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
210 (synopsis "Gtk client and libraries for SPICE remote desktop servers")
211 (description "Gtk client and libraries for SPICE remote desktop servers.")
212 (home-page "https://www.spice-space.org")
213 (license (list license:lgpl2.1+ license:lgpl2.0+))))
222 "https://www.spice-space.org/download/releases/"
223 "spice-server/spice-" version ".tar.bz2"))
226 "05512vkfayw18ypg4acqbbpr72nsnsz9bj7k8c2wyrvnl3j4n7am"))))
227 (build-system gnu-build-system)
229 `(("openssl" ,openssl)
231 ("spice-protocol" ,spice-protocol)))
233 `(("cyrus-sasl" ,cyrus-sasl)
235 ("libjpeg-turbo" ,libjpeg-turbo)
236 ("libcacard" ,libcacard) ; smartcard support
242 `(("pkg-config" ,pkg-config)
244 ("spice-gtk" ,spice-gtk)
246 ;; These are needed for the server listen tests.
247 ("glib-networking" ,glib-networking)
248 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)))
252 "--enable-automated-tests")
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+))))
264 (define-public spice-vdagent
266 (name "spice-vdagent")
271 "http://www.spice-space.org/download/releases/"
272 "spice-vdagent-" version ".tar.bz2"))
275 "0gdkyylyg1hksg0i0anvznqfli2q39335fnrmcd6847frpc8njpi"))))
276 (build-system gnu-build-system)
279 '("--localstatedir=/var")
281 (modify-phases %standard-phases
282 (add-after 'unpack 'patch-makefile.in
284 (substitute* "Makefile.in"
285 (((string-append "\\$\\(mkdir_p\\) \\$\\(DESTDIR\\)"
286 "\\$\\(localstatedir\\)/run/spice-vdagentd"))
287 "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd"))
289 (add-after 'unpack 'patch-spice-vdagent.desktop
290 (lambda* (#:key outputs #:allow-other-keys)
291 (substitute* "data/spice-vdagent.desktop"
292 (("Exec=/usr/bin/spice-vdagent")
293 (string-append "Exec=" (assoc-ref outputs "out")
294 "/bin/spice-vdagent")))
297 `(("alsa-lib" ,alsa-lib)
300 ("libpciaccess" ,libpciaccess)
303 ("libxfixes" ,libxfixes)
304 ("libxinerama" ,libxinerama)
305 ("libxrandr" ,libxrandr)
306 ("spice-protocol" ,spice-protocol)))
308 `(("pkg-config" ,pkg-config)))
309 (synopsis "Spice agent for Linux")
310 (description "Spice-vdagent enables sharing the clipboard and guest display
311 resolution scaling on graphical console window resize.")
312 (home-page "https://www.spice-space.org")
313 (license license:gpl3+)))
315 (define-public libcacard
322 "https://gitlab.freedesktop.org/spice/libcacard/uploads/"
323 "56cb2499198e78e560a1d4c716cd8ab1"
324 "/libcacard-" version ".tar.xz"))
327 "0vyvkk4b6xjwq1ccggql13c1x7g4y90clpkqw28257azgn2a1c8n"))))
328 (build-system gnu-build-system)
330 '(#:tests? #f ; TODO Tests require gnutls built with
333 (modify-phases %standard-phases
334 (add-after 'unpack 'patch-tests
335 (lambda* (#:key inputs #:allow-other-keys)
336 (substitute* "tests/setup-softhsm2.sh"
337 (("\\/usr\\/lib64\\/pkcs11\\/libsofthsm2\\.so")
338 (string-append (assoc-ref inputs "softhsm")
339 "/lib/softhsm/libsofthsm2.so")))
342 `(("glib" ,glib) ; Requires: in the pkg-config file
343 ("nss" ,nss))) ; Requires.private: in the pkg-config
346 `(("openssl" ,openssl)
351 ("pkg-config" ,pkg-config)
353 (synopsis "Emulate and share smart cards with virtual machines")
355 "The @acronym{CAC,Common Access Card} library can be used to emulate and
356 share smart cards from client system to local or remote virtual machines.")
357 (home-page "https://gitlab.freedesktop.org/spice/libcacard")
358 (license license:lgpl2.1+)))
360 (define-public virt-viewer
367 "https://virt-manager.org/download/sources/virt-viewer/"
368 "virt-viewer-" version ".tar.gz"))
371 "00y9vi69sja4pkrfnvrkwsscm41bqrjzvp8aijb20pvg6ymczhj7"))))
372 (build-system gnu-build-system)
377 ("spice-gtk" ,spice-gtk)))
379 `(("glib:bin" ,glib "bin")
380 ("intltool" ,intltool)
381 ("pkg-config" ,pkg-config)))
384 '("--with-spice-gtk")
386 (modify-phases %standard-phases
388 'install 'wrap-remote-viewer
389 (lambda* (#:key inputs outputs #:allow-other-keys)
390 (let ((out (assoc-ref outputs "out"))
391 (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH")))
392 (wrap-program (string-append out "/bin/remote-viewer")
393 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
395 (synopsis "Graphical console client for virtual machines")
396 (description "Graphical console client for virtual machines using SPICE or
398 (home-page "https://virt-manager.org")
399 (license license:gpl2+)))