Commit | Line | Data |
---|---|---|
1d2c67c1 DC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2016 David Craven <david@craven.ch> | |
c0dc4179 | 3 | ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
44ad1c16 | 4 | ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com> |
29c6fb0d | 5 | ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com> |
1d2c67c1 DC |
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) | |
ee3d20b9 | 24 | #:use-module (gnu packages base) |
bb28cf90 | 25 | #:use-module (gnu packages compression) |
5f2a7f4f | 26 | #:use-module (gnu packages cyrus-sasl) |
2ef2654d | 27 | #:use-module (gnu packages gl) |
bb28cf90 DC |
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) | |
1d2c67c1 | 33 | #:use-module (gnu packages libusb) |
2ef2654d | 34 | #:use-module (gnu packages linux) |
ee3d20b9 | 35 | #:use-module (gnu packages nss) |
1d2c67c1 | 36 | #:use-module (gnu packages pkg-config) |
bb28cf90 DC |
37 | #:use-module (gnu packages pulseaudio) |
38 | #:use-module (gnu packages python) | |
ee3d20b9 | 39 | #:use-module (gnu packages security-token) |
bb28cf90 DC |
40 | #:use-module (gnu packages tls) |
41 | #:use-module (gnu packages xorg) | |
42 | #:use-module (gnu packages xdisorg) | |
43 | #:use-module (gnu packages xiph) | |
6144dff5 | 44 | #:use-module (gnu packages xml) |
1d2c67c1 DC |
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)) | |
50 | ||
51 | (define-public usbredir | |
41a659d2 MB |
52 | (package |
53 | (name "usbredir") | |
54 | (home-page "https://spice-space.org") | |
55 | (version "0.8.0") | |
56 | (source (origin | |
57 | (method url-fetch) | |
58 | (uri (string-append home-page "/download/" name "/" name "-" | |
59 | version ".tar.bz2")) | |
60 | (sha256 | |
61 | (base32 | |
62 | "002yik1x7kn0427xahvnhjby2np14a6xqw7c3dx530n9h5d9rg47")))) | |
63 | (build-system gnu-build-system) | |
64 | (propagated-inputs | |
65 | `(("libusb" ,libusb))) | |
66 | (native-inputs | |
67 | `(("pkg-config" ,pkg-config))) | |
68 | (synopsis "Tools for sending USB device traffic over a network") | |
69 | (description | |
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+)))) | |
2ef2654d DC |
74 | |
75 | (define-public virglrenderer | |
76 | (package | |
77 | (name "virglrenderer") | |
8b20a4d1 | 78 | (version "0.6.0") |
2ef2654d DC |
79 | (source (origin |
80 | (method url-fetch) | |
81 | (uri (string-append | |
82 | "https://www.freedesktop.org/software/virgl/" | |
83 | "virglrenderer-" version ".tar.bz2")) | |
1e5b8bee | 84 | (patches (search-patches "virglrenderer-CVE-2017-6386.patch")) |
2ef2654d DC |
85 | (sha256 |
86 | (base32 | |
8b20a4d1 | 87 | "06kf0q4l52gzx5p63l8850hff8pmhp7xv1hk8zgx2apbw18y6jd5")))) |
2ef2654d DC |
88 | (build-system gnu-build-system) |
89 | (inputs | |
90 | `(("libepoxy" ,libepoxy) | |
91 | ("mesa" ,mesa) | |
92 | ("udev" ,eudev))) | |
93 | (native-inputs | |
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)))) | |
289e472f DC |
100 | |
101 | (define-public spice-protocol | |
102 | (package | |
103 | (name "spice-protocol") | |
99e8ce52 | 104 | (version "0.14.1") |
289e472f DC |
105 | (source (origin |
106 | (method url-fetch) | |
107 | (uri (string-append | |
5e569d5c | 108 | "https://www.spice-space.org/download/releases/" |
289e472f DC |
109 | "spice-protocol-" version ".tar.bz2")) |
110 | (sha256 | |
111 | (base32 | |
99e8ce52 | 112 | "0ahk5hlanwhbc64r80xmchdav3ls156cvh9l68a0l22bhdhxmrkr")))) |
289e472f DC |
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.") | |
5e569d5c | 118 | (home-page "https://www.spice-space.org") |
289e472f | 119 | (license (list license:bsd-3 license:lgpl2.1+)))) |
bb28cf90 DC |
120 | |
121 | (define-public spice-gtk | |
122 | (package | |
123 | (name "spice-gtk") | |
4f20e0a2 | 124 | (version "0.37") |
bb28cf90 DC |
125 | (source (origin |
126 | (method url-fetch) | |
127 | (uri (string-append | |
f057755e | 128 | "https://spice-space.org/download/gtk/" |
bb28cf90 DC |
129 | "spice-gtk-" version ".tar.bz2")) |
130 | (sha256 | |
131 | (base32 | |
4f20e0a2 | 132 | "1drvj8y35gnxbnrxsipwi15yh0vs9ixzv4wslz6r3lra8w3bfa0z")))) |
bb28cf90 DC |
133 | (build-system gnu-build-system) |
134 | (propagated-inputs | |
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) | |
ba9e2ee6 | 140 | ("gst-plugins-ugly" ,gst-plugins-ugly) |
4f20e0a2 | 141 | ("spice-protocol" ,spice-protocol) |
a2d2c0bf MB |
142 | |
143 | ;; These are required by the pkg-config files. | |
144 | ("gtk+" ,gtk+) | |
145 | ("pixman" ,pixman) | |
146 | ("openssl" ,openssl))) | |
bb28cf90 DC |
147 | (inputs |
148 | `(("glib-networking" ,glib-networking) | |
c44dd0d6 | 149 | ("gobject-introspection" ,gobject-introspection) |
fbd2a245 | 150 | ("json-glib" ,json-glib) |
bb28cf90 | 151 | ("libepoxy" ,libepoxy) |
4bd428a7 | 152 | ("libjpeg" ,libjpeg-turbo) |
bb28cf90 DC |
153 | ("libxcb" ,libxcb) |
154 | ("lz4" ,lz4) | |
155 | ("mesa" ,mesa) | |
bb28cf90 DC |
156 | ("pulseaudio" ,pulseaudio) |
157 | ("python" ,python) | |
bb28cf90 | 158 | ("opus" ,opus) |
bb28cf90 DC |
159 | ("usbredir" ,usbredir))) |
160 | (native-inputs | |
161 | `(("glib:bin" ,glib "bin") | |
162 | ("intltool" ,intltool) | |
10e73bbc EF |
163 | ("pkg-config" ,pkg-config) |
164 | ("vala" ,vala))) | |
bb28cf90 DC |
165 | (arguments |
166 | `(#:configure-flags | |
167 | '("--enable-gstaudio" | |
168 | "--enable-gstvideo" | |
c44dd0d6 | 169 | "--enable-pulse" |
10e73bbc | 170 | "--enable-vala" |
c44dd0d6 | 171 | "--enable-introspection") |
bb28cf90 DC |
172 | #:phases |
173 | (modify-phases %standard-phases | |
fbd2a245 MB |
174 | (add-before 'check 'disable-session-test |
175 | (lambda _ | |
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\\) ") "")) | |
180 | #t)) | |
29c6fb0d MB |
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$") | |
188 | (("-ljpeg") | |
189 | (string-append "-L" libjpeg "/lib -ljpeg"))) | |
190 | #t))) | |
bb28cf90 DC |
191 | (add-after |
192 | 'install 'wrap-spicy | |
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)))) | |
198 | #t))))) | |
199 | (synopsis "Gtk client and libraries for SPICE remote desktop servers") | |
200 | (description "Gtk client and libraries for SPICE remote desktop servers.") | |
f057755e | 201 | (home-page "https://www.spice-space.org") |
bb28cf90 | 202 | (license (list license:lgpl2.1+ license:lgpl2.0+)))) |
3cbd37e4 DC |
203 | |
204 | (define-public spice | |
205 | (package | |
206 | (name "spice") | |
c0dc4179 | 207 | (version "0.14.3") |
3cbd37e4 DC |
208 | (source (origin |
209 | (method url-fetch) | |
210 | (uri (string-append | |
b142756d | 211 | "https://www.spice-space.org/download/releases/" |
f6b7ccc9 | 212 | "spice-server/spice-" version ".tar.bz2")) |
3cbd37e4 DC |
213 | (sha256 |
214 | (base32 | |
c0dc4179 | 215 | "05512vkfayw18ypg4acqbbpr72nsnsz9bj7k8c2wyrvnl3j4n7am")))) |
3cbd37e4 DC |
216 | (build-system gnu-build-system) |
217 | (propagated-inputs | |
218 | `(("openssl" ,openssl) | |
219 | ("pixman" ,pixman) | |
220 | ("spice-protocol" ,spice-protocol))) | |
221 | (inputs | |
5f2a7f4f DC |
222 | `(("cyrus-sasl" ,cyrus-sasl) |
223 | ("glib" ,glib) | |
9b81876f | 224 | ("libjpeg-turbo" ,libjpeg-turbo) |
17adb70f | 225 | ("libcacard" ,libcacard) ; smartcard support |
3cbd37e4 DC |
226 | ("lz4" ,lz4) |
227 | ("opus" ,opus) | |
b142756d | 228 | ("orc" ,orc) |
3cbd37e4 DC |
229 | ("zlib" ,zlib))) |
230 | (native-inputs | |
231 | `(("pkg-config" ,pkg-config) | |
232 | ("python" ,python) | |
f6b7ccc9 MB |
233 | ("spice-gtk" ,spice-gtk) |
234 | ||
235 | ;; These are needed for the server listen tests. | |
236 | ("glib-networking" ,glib-networking) | |
237 | ("gsettings-desktop-schemas" ,gsettings-desktop-schemas))) | |
3cbd37e4 DC |
238 | (arguments |
239 | `(#:configure-flags | |
f6b7ccc9 MB |
240 | '("--enable-lz4" |
241 | "--enable-automated-tests") | |
8504d192 LC |
242 | |
243 | ;; Several tests appear to be opening the same sockets concurrently. | |
65211552 | 244 | #:parallel-tests? #f)) |
3cbd37e4 DC |
245 | (synopsis "Server implementation of the SPICE protocol") |
246 | (description "SPICE is a remote display system built for virtual | |
36a4366d | 247 | environments which allows you to view a computing @code{desktop} environment |
3cbd37e4 DC |
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.") | |
d5ae997a | 250 | (home-page "https://www.spice-space.org") |
3cbd37e4 | 251 | (license (list license:lgpl2.1+ license:lgpl2.0+)))) |
33b0f4a4 DC |
252 | |
253 | (define-public spice-vdagent | |
254 | (package | |
255 | (name "spice-vdagent") | |
256 | (version "0.17.0") | |
257 | (source (origin | |
258 | (method url-fetch) | |
259 | (uri (string-append | |
260 | "http://www.spice-space.org/download/releases/" | |
261 | "spice-vdagent-" version ".tar.bz2")) | |
262 | (sha256 | |
263 | (base32 | |
264 | "0gdkyylyg1hksg0i0anvznqfli2q39335fnrmcd6847frpc8njpi")))) | |
265 | (build-system gnu-build-system) | |
266 | (arguments | |
267 | `(#:configure-flags | |
268 | '("--localstatedir=/var") | |
269 | #:phases | |
270 | (modify-phases %standard-phases | |
271 | (add-after 'unpack 'patch-makefile.in | |
272 | (lambda _ | |
273 | (substitute* "Makefile.in" | |
274 | (((string-append "\\$\\(mkdir_p\\) \\$\\(DESTDIR\\)" | |
275 | "\\$\\(localstatedir\\)/run/spice-vdagentd")) | |
276 | "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd")) | |
e02cd2b8 DC |
277 | #t)) |
278 | (add-after 'unpack 'patch-spice-vdagent.desktop | |
279 | (lambda* (#:key outputs #:allow-other-keys) | |
280 | (substitute* "data/spice-vdagent.desktop" | |
3f995aaf | 281 | (("Exec=/usr/bin/spice-vdagent") |
e02cd2b8 DC |
282 | (string-append "Exec=" (assoc-ref outputs "out") |
283 | "/bin/spice-vdagent"))) | |
33b0f4a4 DC |
284 | #t))))) |
285 | (inputs | |
286 | `(("alsa-lib" ,alsa-lib) | |
287 | ("dbus" ,dbus) | |
288 | ("glib" ,glib) | |
289 | ("libpciaccess" ,libpciaccess) | |
290 | ("libx11" ,libx11) | |
291 | ("libxext" ,libxext) | |
292 | ("libxfixes" ,libxfixes) | |
293 | ("libxinerama" ,libxinerama) | |
294 | ("libxrandr" ,libxrandr) | |
295 | ("spice-protocol" ,spice-protocol))) | |
296 | (native-inputs | |
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.") | |
d5ae997a | 301 | (home-page "https://www.spice-space.org") |
33b0f4a4 | 302 | (license license:gpl3+))) |
6144dff5 | 303 | |
ee3d20b9 CB |
304 | (define-public libcacard |
305 | (package | |
306 | (name "libcacard") | |
307 | (version "2.7.0") | |
308 | (source (origin | |
309 | (method url-fetch) | |
310 | (uri (string-append | |
311 | "https://gitlab.freedesktop.org/spice/libcacard/uploads/" | |
312 | "56cb2499198e78e560a1d4c716cd8ab1" | |
313 | "/libcacard-" version ".tar.xz")) | |
314 | (sha256 | |
315 | (base32 | |
316 | "0vyvkk4b6xjwq1ccggql13c1x7g4y90clpkqw28257azgn2a1c8n")))) | |
317 | (build-system gnu-build-system) | |
318 | (arguments | |
319 | '(#:tests? #f ; TODO Tests require gnutls built with | |
320 | ; p11-kit | |
321 | #:phases | |
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"))) | |
329 | #t))))) | |
330 | (propagated-inputs | |
331 | `(("glib" ,glib) ; Requires: in the pkg-config file | |
332 | ("nss" ,nss))) ; Requires.private: in the pkg-config | |
333 | ; file | |
334 | (native-inputs | |
335 | `(("openssl" ,openssl) | |
336 | ("nss" ,nss "bin") | |
337 | ("opensc" ,opensc) | |
338 | ("softhsm" ,softhsm) | |
339 | ("gnutls" ,gnutls) | |
340 | ("pkg-config" ,pkg-config) | |
341 | ("which" ,which))) | |
342 | (synopsis "Emulate and share smart cards with virtual machines") | |
343 | (description | |
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+))) | |
348 | ||
6144dff5 DC |
349 | (define-public virt-viewer |
350 | (package | |
351 | (name "virt-viewer") | |
800248fe | 352 | (version "7.0") |
6144dff5 DC |
353 | (source (origin |
354 | (method url-fetch) | |
355 | (uri (string-append | |
356 | "https://virt-manager.org/download/sources/virt-viewer/" | |
357 | "virt-viewer-" version ".tar.gz")) | |
358 | (sha256 | |
359 | (base32 | |
800248fe | 360 | "00y9vi69sja4pkrfnvrkwsscm41bqrjzvp8aijb20pvg6ymczhj7")))) |
6144dff5 DC |
361 | (build-system gnu-build-system) |
362 | (inputs | |
363 | `(("gtk+" ,gtk+) | |
364 | ("libcap" ,libcap) | |
365 | ("libxml2" ,libxml2) | |
f54510d2 | 366 | ("spice-gtk" ,spice-gtk))) |
6144dff5 DC |
367 | (native-inputs |
368 | `(("glib:bin" ,glib "bin") | |
369 | ("intltool" ,intltool) | |
370 | ("pkg-config" ,pkg-config))) | |
371 | (arguments | |
372 | `(#:configure-flags | |
373 | '("--with-spice-gtk") | |
374 | #:phases | |
375 | (modify-phases %standard-phases | |
376 | (add-after | |
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)))) | |
383 | #t))))) | |
384 | (synopsis "Graphical console client for virtual machines") | |
385 | (description "Graphical console client for virtual machines using SPICE or | |
386 | VNC.") | |
387 | (home-page "https://virt-manager.org") | |
388 | (license license:gpl2+))) |