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 "0yj8k7gcirrsf21w0q6146n5g4nzn2pqky4p90n5760m5ayfb1pr"))))
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-plugins-base" ,gst-plugins-base)
148 ("gst-plugins-good" ,gst-plugins-good)
149 ("spice-protocol" ,spice-protocol)
151 ;; These are required by the pkg-config files.
154 ("openssl" ,openssl)))
156 `(("glib-networking" ,glib-networking)
157 ("gobject-introspection" ,gobject-introspection)
158 ("json-glib" ,json-glib)
159 ("libepoxy" ,libepoxy)
160 ("libjpeg" ,libjpeg-turbo)
164 ("pulseaudio" ,pulseaudio)
167 ("usbredir" ,usbredir)))
169 `(("glib:bin" ,glib "bin")
170 ("intltool" ,intltool)
171 ("pkg-config" ,pkg-config)
175 '("--enable-gstaudio"
179 "--enable-introspection")
181 (modify-phases %standard-phases
182 (add-before 'check 'disable-session-test
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\\) ") ""))
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$")
197 (string-append "-L" libjpeg "/lib -ljpeg")))
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))))
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+))))
219 "https://www.spice-space.org/download/releases/"
220 "spice-server/spice-" version ".tar.bz2"))
223 "05512vkfayw18ypg4acqbbpr72nsnsz9bj7k8c2wyrvnl3j4n7am"))))
224 (build-system gnu-build-system)
226 `(("openssl" ,openssl)
228 ("spice-protocol" ,spice-protocol)))
230 `(("cyrus-sasl" ,cyrus-sasl)
232 ("libjpeg-turbo" ,libjpeg-turbo)
233 ("libcacard" ,libcacard) ; smartcard support
239 `(("pkg-config" ,pkg-config)
241 ("spice-gtk" ,spice-gtk)
243 ;; These are needed for the server listen tests.
244 ("glib-networking" ,glib-networking)
245 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)))
249 "--enable-automated-tests")
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+))))
261 (define-public spice-vdagent
263 (name "spice-vdagent")
268 "http://www.spice-space.org/download/releases/"
269 "spice-vdagent-" version ".tar.bz2"))
272 "0n9k2kna2gd1zi6jv45zsp2jlv439nz5l5jjijirxqaycwi74srf"))))
273 (build-system gnu-build-system)
276 '("--localstatedir=/var")
278 (modify-phases %standard-phases
279 (add-after 'unpack 'patch-makefile.in
281 (substitute* "Makefile.in"
282 (((string-append "\\$\\(mkdir_p\\) \\$\\(DESTDIR\\)"
283 "\\$\\(localstatedir\\)/run/spice-vdagentd"))
284 "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd"))
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")))
294 `(("alsa-lib" ,alsa-lib)
298 ("libpciaccess" ,libpciaccess)
301 ("libxfixes" ,libxfixes)
302 ("libxinerama" ,libxinerama)
303 ("libxrandr" ,libxrandr)
304 ("spice-protocol" ,spice-protocol)))
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+)))
313 (define-public libcacard
320 "https://gitlab.freedesktop.org/spice/libcacard/uploads/"
321 "56cb2499198e78e560a1d4c716cd8ab1"
322 "/libcacard-" version ".tar.xz"))
325 "0vyvkk4b6xjwq1ccggql13c1x7g4y90clpkqw28257azgn2a1c8n"))))
326 (build-system gnu-build-system)
328 '(#:tests? #f ; TODO Tests require gnutls built with
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")))
340 `(("glib" ,glib) ; Requires: in the pkg-config file
341 ("nss" ,nss))) ; Requires.private: in the pkg-config
344 `(("openssl" ,openssl)
349 ("pkg-config" ,pkg-config)
351 (synopsis "Emulate and share smart cards with virtual machines")
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+)))
358 (define-public virt-viewer
365 "https://virt-manager.org/download/sources/virt-viewer/"
366 "virt-viewer-" version ".tar.gz"))
369 "00y9vi69sja4pkrfnvrkwsscm41bqrjzvp8aijb20pvg6ymczhj7"))))
370 (build-system gnu-build-system)
376 ("spice-gtk" ,spice-gtk)))
378 `(("glib:bin" ,glib "bin")
379 ("intltool" ,intltool)
380 ("pkg-config" ,pkg-config)))
383 '("--with-spice-gtk")
385 (modify-phases %standard-phases
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))))
394 (synopsis "Graphical console client for virtual machines")
395 (description "Graphical console client for virtual machines using SPICE or
397 (home-page "https://virt-manager.org")
398 (license license:gpl2+)))