Merge branch 'master' into staging
[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 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages spice)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages compression)
24 #:use-module (gnu packages cyrus-sasl)
25 #:use-module (gnu packages gl)
26 #:use-module (gnu packages glib)
27 #:use-module (gnu packages gnome)
28 #:use-module (gnu packages gstreamer)
29 #:use-module (gnu packages gtk)
30 #:use-module (gnu packages image)
31 #:use-module (gnu packages libusb)
32 #:use-module (gnu packages linux)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages pulseaudio)
35 #:use-module (gnu packages python)
36 #:use-module (gnu packages tls)
37 #:use-module (gnu packages xorg)
38 #:use-module (gnu packages xdisorg)
39 #:use-module (gnu packages xiph)
40 #:use-module (gnu packages xml)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix download)
43 #:use-module (guix packages)
44 #:use-module ((guix licenses) #:prefix license:)
45 #:use-module (guix utils))
46
47 (define-public usbredir
48 (package
49 (name "usbredir")
50 (home-page "https://spice-space.org")
51 (version "0.8.0")
52 (source (origin
53 (method url-fetch)
54 (uri (string-append home-page "/download/" name "/" name "-"
55 version ".tar.bz2"))
56 (sha256
57 (base32
58 "002yik1x7kn0427xahvnhjby2np14a6xqw7c3dx530n9h5d9rg47"))))
59 (build-system gnu-build-system)
60 (propagated-inputs
61 `(("libusb" ,libusb)))
62 (native-inputs
63 `(("pkg-config" ,pkg-config)))
64 (synopsis "Tools for sending USB device traffic over a network")
65 (description
66 "Usbredir is a network protocol for sending USB device traffic over a
67 network connection. It can be used to redirect traffic from a USB device to a
68 different (virtual) machine than the one to which the USB device is attached.")
69 (license (list license:gpl2+ license:lgpl2.0+ license:lgpl2.1+))))
70
71 (define-public virglrenderer
72 (package
73 (name "virglrenderer")
74 (version "0.6.0")
75 (source (origin
76 (method url-fetch)
77 (uri (string-append
78 "https://www.freedesktop.org/software/virgl/"
79 "virglrenderer-" version ".tar.bz2"))
80 (patches (search-patches "virglrenderer-CVE-2017-6386.patch"))
81 (sha256
82 (base32
83 "06kf0q4l52gzx5p63l8850hff8pmhp7xv1hk8zgx2apbw18y6jd5"))))
84 (build-system gnu-build-system)
85 (inputs
86 `(("libepoxy" ,libepoxy)
87 ("mesa" ,mesa)
88 ("udev" ,eudev)))
89 (native-inputs
90 `(("pkg-config" ,pkg-config)))
91 (synopsis "Virtual 3D GPU library")
92 (description "A virtual 3D GPU library that enables a virtualized operating
93 system to use the host GPU to accelerate 3D rendering.")
94 (home-page "https://virgil3d.github.io")
95 (license (list license:expat license:bsd-3))))
96
97 (define-public spice-protocol
98 (package
99 (name "spice-protocol")
100 (version "0.12.15")
101 (source (origin
102 (method url-fetch)
103 (uri (string-append
104 "https://www.spice-space.org/download/releases/"
105 "spice-protocol-" version ".tar.bz2"))
106 (sha256
107 (base32
108 "06b461i4jv741in8617jjpfk28wk7zs9p7841njkf4sbm8xv4kcb"))))
109 (build-system gnu-build-system)
110 (synopsis "Protocol headers for the SPICE protocol")
111 (description "SPICE (the Simple Protocol for Independent Computing
112 Environments) is a remote-display system built for virtual environments
113 which allows users to view a desktop computing environment.")
114 (home-page "https://www.spice-space.org")
115 (license (list license:bsd-3 license:lgpl2.1+))))
116
117 (define-public spice-gtk
118 (package
119 (name "spice-gtk")
120 (version "0.36")
121 (source (origin
122 (method url-fetch)
123 (uri (string-append
124 "https://spice-space.org/download/gtk/"
125 "spice-gtk-" version ".tar.bz2"))
126 (sha256
127 (base32
128 "1kfpixfdmxs9wn3id48gc9bvfrgxz935y3wpykf40bgi9mcc69ki"))))
129 (build-system gnu-build-system)
130 (propagated-inputs
131 `(("gstreamer" ,gstreamer)
132 ("gst-libav" ,gst-libav)
133 ("gst-plugins-base" ,gst-plugins-base)
134 ("gst-plugins-good" ,gst-plugins-good)
135 ("gst-plugins-bad" ,gst-plugins-bad)
136 ("gst-plugins-ugly" ,gst-plugins-ugly)
137 ("spice-protocol" ,spice-protocol)
138
139 ;; These are required by the pkg-config files.
140 ("gtk+" ,gtk+)
141 ("pixman" ,pixman)
142 ("openssl" ,openssl)))
143 (inputs
144 `(("glib-networking" ,glib-networking)
145 ("gobject-introspection" ,gobject-introspection)
146 ("json-glib" ,json-glib)
147 ("libepoxy" ,libepoxy)
148 ("libjpeg" ,libjpeg)
149 ("libxcb" ,libxcb)
150 ("lz4" ,lz4)
151 ("mesa" ,mesa)
152 ("pulseaudio" ,pulseaudio)
153 ("python" ,python)
154 ("opus" ,opus)
155 ("usbredir" ,usbredir)))
156 (native-inputs
157 `(("glib:bin" ,glib "bin")
158 ("intltool" ,intltool)
159 ("pkg-config" ,pkg-config)))
160 (arguments
161 `(#:configure-flags
162 '("--enable-gstaudio"
163 "--enable-gstvideo"
164 "--enable-pulse"
165 "--enable-introspection")
166 #:phases
167 (modify-phases %standard-phases
168 (add-before 'check 'disable-session-test
169 (lambda _
170 ;; XXX: Disable session tests, because they require USB support,
171 ;; which is not available in the build container.
172 (substitute* "tests/Makefile"
173 (("test-session\\$\\(EXEEXT\\) ") ""))
174 #t))
175 (add-after
176 'install 'wrap-spicy
177 (lambda* (#:key inputs outputs #:allow-other-keys)
178 (let ((out (assoc-ref outputs "out"))
179 (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH")))
180 (wrap-program (string-append out "/bin/spicy")
181 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
182 #t)))))
183 (synopsis "Gtk client and libraries for SPICE remote desktop servers")
184 (description "Gtk client and libraries for SPICE remote desktop servers.")
185 (home-page "https://www.spice-space.org")
186 (license (list license:lgpl2.1+ license:lgpl2.0+))))
187
188 (define-public spice
189 (package
190 (name "spice")
191 (version "0.14.1")
192 (source (origin
193 (method url-fetch)
194 (uri (string-append
195 "https://www.spice-space.org/download/releases/"
196 "spice-server/spice-" version ".tar.bz2"))
197 (sha256
198 (base32
199 "068mb9l7wzk4k4c65bzvpw5fyyzh81rb6z81skgdxvh67pk5vb8y"))))
200 (build-system gnu-build-system)
201 (propagated-inputs
202 `(("openssl" ,openssl)
203 ("pixman" ,pixman)
204 ("spice-protocol" ,spice-protocol)))
205 (inputs
206 `(("cyrus-sasl" ,cyrus-sasl)
207 ("glib" ,glib)
208 ("libjpeg-turbo" ,libjpeg-turbo)
209 ("lz4" ,lz4)
210 ("opus" ,opus)
211 ("orc" ,orc)
212 ("zlib" ,zlib)))
213 (native-inputs
214 `(("pkg-config" ,pkg-config)
215 ("python" ,python)
216 ("spice-gtk" ,spice-gtk)
217
218 ;; These are needed for the server listen tests.
219 ("glib-networking" ,glib-networking)
220 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)))
221 (arguments
222 `(#:configure-flags
223 '("--enable-lz4"
224 "--enable-automated-tests")
225
226 ;; Several tests appear to be opening the same sockets concurrently.
227 #:parallel-tests? #f))
228 (synopsis "Server implementation of the SPICE protocol")
229 (description "SPICE is a remote display system built for virtual
230 environments which allows you to view a computing @code{desktop} environment
231 not only on the machine where it is running, but from anywhere on the
232 Internet and from a wide variety of machine architectures.")
233 (home-page "https://www.spice-space.org")
234 (license (list license:lgpl2.1+ license:lgpl2.0+))))
235
236 (define-public spice-vdagent
237 (package
238 (name "spice-vdagent")
239 (version "0.17.0")
240 (source (origin
241 (method url-fetch)
242 (uri (string-append
243 "http://www.spice-space.org/download/releases/"
244 "spice-vdagent-" version ".tar.bz2"))
245 (sha256
246 (base32
247 "0gdkyylyg1hksg0i0anvznqfli2q39335fnrmcd6847frpc8njpi"))))
248 (build-system gnu-build-system)
249 (arguments
250 `(#:configure-flags
251 '("--localstatedir=/var")
252 #:phases
253 (modify-phases %standard-phases
254 (add-after 'unpack 'patch-makefile.in
255 (lambda _
256 (substitute* "Makefile.in"
257 (((string-append "\\$\\(mkdir_p\\) \\$\\(DESTDIR\\)"
258 "\\$\\(localstatedir\\)/run/spice-vdagentd"))
259 "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd"))
260 #t))
261 (add-after 'unpack 'patch-spice-vdagent.desktop
262 (lambda* (#:key outputs #:allow-other-keys)
263 (substitute* "data/spice-vdagent.desktop"
264 (("Exec=/usr/bin/spice-vdagent")
265 (string-append "Exec=" (assoc-ref outputs "out")
266 "/bin/spice-vdagent")))
267 #t)))))
268 (inputs
269 `(("alsa-lib" ,alsa-lib)
270 ("dbus" ,dbus)
271 ("glib" ,glib)
272 ("libpciaccess" ,libpciaccess)
273 ("libx11" ,libx11)
274 ("libxext" ,libxext)
275 ("libxfixes" ,libxfixes)
276 ("libxinerama" ,libxinerama)
277 ("libxrandr" ,libxrandr)
278 ("spice-protocol" ,spice-protocol)))
279 (native-inputs
280 `(("pkg-config" ,pkg-config)))
281 (synopsis "Spice agent for Linux")
282 (description "Spice-vdagent enables sharing the clipboard and guest display
283 resolution scaling on graphical console window resize.")
284 (home-page "https://www.spice-space.org")
285 (license license:gpl3+)))
286
287 (define-public virt-viewer
288 (package
289 (name "virt-viewer")
290 (version "7.0")
291 (source (origin
292 (method url-fetch)
293 (uri (string-append
294 "https://virt-manager.org/download/sources/virt-viewer/"
295 "virt-viewer-" version ".tar.gz"))
296 (sha256
297 (base32
298 "00y9vi69sja4pkrfnvrkwsscm41bqrjzvp8aijb20pvg6ymczhj7"))))
299 (build-system gnu-build-system)
300 (inputs
301 `(("gtk+" ,gtk+)
302 ("libcap" ,libcap)
303 ("libxml2" ,libxml2)
304 ("spice-gtk" ,spice-gtk)))
305 (native-inputs
306 `(("glib:bin" ,glib "bin")
307 ("intltool" ,intltool)
308 ("pkg-config" ,pkg-config)))
309 (arguments
310 `(#:configure-flags
311 '("--with-spice-gtk")
312 #:phases
313 (modify-phases %standard-phases
314 (add-after
315 'install 'wrap-remote-viewer
316 (lambda* (#:key inputs outputs #:allow-other-keys)
317 (let ((out (assoc-ref outputs "out"))
318 (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH")))
319 (wrap-program (string-append out "/bin/remote-viewer")
320 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
321 #t)))))
322 (synopsis "Graphical console client for virtual machines")
323 (description "Graphical console client for virtual machines using SPICE or
324 VNC.")
325 (home-page "https://virt-manager.org")
326 (license license:gpl2+)))