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 download)
47 #:use-module (guix packages)
48 #:use-module ((guix licenses) #:prefix license:)
49 #:use-module (guix utils))
51 (define-public usbredir
54 (home-page "https://spice-space.org")
58 (uri (string-append home-page "/download/" name "/" name "-"
62 "002yik1x7kn0427xahvnhjby2np14a6xqw7c3dx530n9h5d9rg47"))))
63 (build-system gnu-build-system)
65 `(("libusb" ,libusb)))
67 `(("pkg-config" ,pkg-config)))
68 (synopsis "Tools for sending USB device traffic over a network")
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+))))
75 (define-public virglrenderer
77 (name "virglrenderer")
82 "https://www.freedesktop.org/software/virgl/"
83 "virglrenderer-" version ".tar.bz2"))
84 (patches (search-patches "virglrenderer-CVE-2017-6386.patch"))
87 "06kf0q4l52gzx5p63l8850hff8pmhp7xv1hk8zgx2apbw18y6jd5"))))
88 (build-system gnu-build-system)
90 `(("libepoxy" ,libepoxy)
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))))
101 (define-public spice-protocol
103 (name "spice-protocol")
108 "https://www.spice-space.org/download/releases/"
109 "spice-protocol-" version ".tar.bz2"))
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+))))
121 (define-public spice-gtk
128 "https://spice-space.org/download/gtk/"
129 "spice-gtk-" version ".tar.bz2"))
132 "1drvj8y35gnxbnrxsipwi15yh0vs9ixzv4wslz6r3lra8w3bfa0z"))))
133 (build-system gnu-build-system)
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)
143 ;; These are required by the pkg-config files.
146 ("openssl" ,openssl)))
148 `(("glib-networking" ,glib-networking)
149 ("gobject-introspection" ,gobject-introspection)
150 ("json-glib" ,json-glib)
151 ("libepoxy" ,libepoxy)
152 ("libjpeg" ,libjpeg-turbo)
156 ("pulseaudio" ,pulseaudio)
159 ("usbredir" ,usbredir)))
161 `(("glib:bin" ,glib "bin")
162 ("intltool" ,intltool)
163 ("pkg-config" ,pkg-config)
167 '("--enable-gstaudio"
171 "--enable-introspection")
173 (modify-phases %standard-phases
174 (add-before 'check 'disable-session-test
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\\) ") ""))
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$")
189 (string-append "-L" libjpeg "/lib -ljpeg")))
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))))
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+))))
211 "https://www.spice-space.org/download/releases/"
212 "spice-server/spice-" version ".tar.bz2"))
215 "05512vkfayw18ypg4acqbbpr72nsnsz9bj7k8c2wyrvnl3j4n7am"))))
216 (build-system gnu-build-system)
218 `(("openssl" ,openssl)
220 ("spice-protocol" ,spice-protocol)))
222 `(("cyrus-sasl" ,cyrus-sasl)
224 ("libjpeg-turbo" ,libjpeg-turbo)
225 ("libcacard" ,libcacard) ; smartcard support
231 `(("pkg-config" ,pkg-config)
233 ("spice-gtk" ,spice-gtk)
235 ;; These are needed for the server listen tests.
236 ("glib-networking" ,glib-networking)
237 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)))
241 "--enable-automated-tests")
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+))))
253 (define-public spice-vdagent
255 (name "spice-vdagent")
260 "http://www.spice-space.org/download/releases/"
261 "spice-vdagent-" version ".tar.bz2"))
264 "0gdkyylyg1hksg0i0anvznqfli2q39335fnrmcd6847frpc8njpi"))))
265 (build-system gnu-build-system)
268 '("--localstatedir=/var")
270 (modify-phases %standard-phases
271 (add-after 'unpack 'patch-makefile.in
273 (substitute* "Makefile.in"
274 (((string-append "\\$\\(mkdir_p\\) \\$\\(DESTDIR\\)"
275 "\\$\\(localstatedir\\)/run/spice-vdagentd"))
276 "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd"))
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")))
286 `(("alsa-lib" ,alsa-lib)
289 ("libpciaccess" ,libpciaccess)
292 ("libxfixes" ,libxfixes)
293 ("libxinerama" ,libxinerama)
294 ("libxrandr" ,libxrandr)
295 ("spice-protocol" ,spice-protocol)))
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+)))
304 (define-public libcacard
311 "https://gitlab.freedesktop.org/spice/libcacard/uploads/"
312 "56cb2499198e78e560a1d4c716cd8ab1"
313 "/libcacard-" version ".tar.xz"))
316 "0vyvkk4b6xjwq1ccggql13c1x7g4y90clpkqw28257azgn2a1c8n"))))
317 (build-system gnu-build-system)
319 '(#:tests? #f ; TODO Tests require gnutls built with
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")))
331 `(("glib" ,glib) ; Requires: in the pkg-config file
332 ("nss" ,nss))) ; Requires.private: in the pkg-config
335 `(("openssl" ,openssl)
340 ("pkg-config" ,pkg-config)
342 (synopsis "Emulate and share smart cards with virtual machines")
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+)))
349 (define-public virt-viewer
356 "https://virt-manager.org/download/sources/virt-viewer/"
357 "virt-viewer-" version ".tar.gz"))
360 "00y9vi69sja4pkrfnvrkwsscm41bqrjzvp8aijb20pvg6ymczhj7"))))
361 (build-system gnu-build-system)
366 ("spice-gtk" ,spice-gtk)))
368 `(("glib:bin" ,glib "bin")
369 ("intltool" ,intltool)
370 ("pkg-config" ,pkg-config)))
373 '("--with-spice-gtk")
375 (modify-phases %standard-phases
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))))
384 (synopsis "Graphical console client for virtual machines")
385 (description "Graphical console client for virtual machines using SPICE or
387 (home-page "https://virt-manager.org")
388 (license license:gpl2+)))