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