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