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 | 45 | #:use-module (guix build-system gnu) |
6d215516 | 46 | #:use-module (guix build-system meson) |
1d2c67c1 DC |
47 | #:use-module (guix download) |
48 | #:use-module (guix packages) | |
49 | #:use-module ((guix licenses) #:prefix license:) | |
50 | #:use-module (guix utils)) | |
51 | ||
52 | (define-public usbredir | |
41a659d2 MB |
53 | (package |
54 | (name "usbredir") | |
55 | (home-page "https://spice-space.org") | |
56 | (version "0.8.0") | |
57 | (source (origin | |
58 | (method url-fetch) | |
59 | (uri (string-append home-page "/download/" name "/" name "-" | |
60 | version ".tar.bz2")) | |
61 | (sha256 | |
62 | (base32 | |
63 | "002yik1x7kn0427xahvnhjby2np14a6xqw7c3dx530n9h5d9rg47")))) | |
64 | (build-system gnu-build-system) | |
65 | (propagated-inputs | |
66 | `(("libusb" ,libusb))) | |
67 | (native-inputs | |
68 | `(("pkg-config" ,pkg-config))) | |
69 | (synopsis "Tools for sending USB device traffic over a network") | |
70 | (description | |
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+)))) | |
2ef2654d DC |
75 | |
76 | (define-public virglrenderer | |
77 | (package | |
78 | (name "virglrenderer") | |
8b20a4d1 | 79 | (version "0.6.0") |
2ef2654d DC |
80 | (source (origin |
81 | (method url-fetch) | |
82 | (uri (string-append | |
83 | "https://www.freedesktop.org/software/virgl/" | |
84 | "virglrenderer-" version ".tar.bz2")) | |
1e5b8bee | 85 | (patches (search-patches "virglrenderer-CVE-2017-6386.patch")) |
2ef2654d DC |
86 | (sha256 |
87 | (base32 | |
8b20a4d1 | 88 | "06kf0q4l52gzx5p63l8850hff8pmhp7xv1hk8zgx2apbw18y6jd5")))) |
2ef2654d DC |
89 | (build-system gnu-build-system) |
90 | (inputs | |
91 | `(("libepoxy" ,libepoxy) | |
92 | ("mesa" ,mesa) | |
93 | ("udev" ,eudev))) | |
94 | (native-inputs | |
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)))) | |
289e472f DC |
101 | |
102 | (define-public spice-protocol | |
103 | (package | |
104 | (name "spice-protocol") | |
6d215516 | 105 | (version "0.14.2") |
289e472f DC |
106 | (source (origin |
107 | (method url-fetch) | |
108 | (uri (string-append | |
5e569d5c | 109 | "https://www.spice-space.org/download/releases/" |
6d215516 | 110 | "spice-protocol-" version ".tar.xz")) |
289e472f DC |
111 | (sha256 |
112 | (base32 | |
6d215516 TGR |
113 | "1sgi9ksb781qs47pdbw0bmnyg8dgayn5xrzj6vzdy043nv466flg")))) |
114 | (build-system meson-build-system) | |
115 | (arguments | |
116 | `(#:phases | |
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) | |
124 | #t)))))) | |
289e472f DC |
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.") | |
5e569d5c | 129 | (home-page "https://www.spice-space.org") |
289e472f | 130 | (license (list license:bsd-3 license:lgpl2.1+)))) |
bb28cf90 DC |
131 | |
132 | (define-public spice-gtk | |
133 | (package | |
134 | (name "spice-gtk") | |
4f20e0a2 | 135 | (version "0.37") |
bb28cf90 DC |
136 | (source (origin |
137 | (method url-fetch) | |
138 | (uri (string-append | |
f057755e | 139 | "https://spice-space.org/download/gtk/" |
bb28cf90 DC |
140 | "spice-gtk-" version ".tar.bz2")) |
141 | (sha256 | |
142 | (base32 | |
4f20e0a2 | 143 | "1drvj8y35gnxbnrxsipwi15yh0vs9ixzv4wslz6r3lra8w3bfa0z")))) |
bb28cf90 DC |
144 | (build-system gnu-build-system) |
145 | (propagated-inputs | |
146 | `(("gstreamer" ,gstreamer) | |
147 | ("gst-libav" ,gst-libav) | |
148 | ("gst-plugins-base" ,gst-plugins-base) | |
149 | ("gst-plugins-good" ,gst-plugins-good) | |
150 | ("gst-plugins-bad" ,gst-plugins-bad) | |
ba9e2ee6 | 151 | ("gst-plugins-ugly" ,gst-plugins-ugly) |
4f20e0a2 | 152 | ("spice-protocol" ,spice-protocol) |
a2d2c0bf MB |
153 | |
154 | ;; These are required by the pkg-config files. | |
155 | ("gtk+" ,gtk+) | |
156 | ("pixman" ,pixman) | |
157 | ("openssl" ,openssl))) | |
bb28cf90 DC |
158 | (inputs |
159 | `(("glib-networking" ,glib-networking) | |
c44dd0d6 | 160 | ("gobject-introspection" ,gobject-introspection) |
fbd2a245 | 161 | ("json-glib" ,json-glib) |
bb28cf90 | 162 | ("libepoxy" ,libepoxy) |
4bd428a7 | 163 | ("libjpeg" ,libjpeg-turbo) |
bb28cf90 DC |
164 | ("libxcb" ,libxcb) |
165 | ("lz4" ,lz4) | |
166 | ("mesa" ,mesa) | |
bb28cf90 DC |
167 | ("pulseaudio" ,pulseaudio) |
168 | ("python" ,python) | |
bb28cf90 | 169 | ("opus" ,opus) |
bb28cf90 DC |
170 | ("usbredir" ,usbredir))) |
171 | (native-inputs | |
172 | `(("glib:bin" ,glib "bin") | |
173 | ("intltool" ,intltool) | |
10e73bbc EF |
174 | ("pkg-config" ,pkg-config) |
175 | ("vala" ,vala))) | |
bb28cf90 DC |
176 | (arguments |
177 | `(#:configure-flags | |
178 | '("--enable-gstaudio" | |
179 | "--enable-gstvideo" | |
c44dd0d6 | 180 | "--enable-pulse" |
10e73bbc | 181 | "--enable-vala" |
c44dd0d6 | 182 | "--enable-introspection") |
bb28cf90 DC |
183 | #:phases |
184 | (modify-phases %standard-phases | |
fbd2a245 MB |
185 | (add-before 'check 'disable-session-test |
186 | (lambda _ | |
187 | ;; XXX: Disable session tests, because they require USB support, | |
188 | ;; which is not available in the build container. | |
189 | (substitute* "tests/Makefile" | |
190 | (("test-session\\$\\(EXEEXT\\) ") "")) | |
191 | #t)) | |
29c6fb0d MB |
192 | (add-after 'install 'patch-la-files |
193 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
194 | (let ((out (assoc-ref outputs "out")) | |
195 | (libjpeg (assoc-ref inputs "libjpeg"))) | |
196 | ;; Add an absolute reference for libjpeg in the .la files | |
197 | ;; so it does not have to be propagated. | |
198 | (substitute* (find-files (string-append out "/lib") "\\.la$") | |
199 | (("-ljpeg") | |
200 | (string-append "-L" libjpeg "/lib -ljpeg"))) | |
201 | #t))) | |
bb28cf90 DC |
202 | (add-after |
203 | 'install 'wrap-spicy | |
204 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
205 | (let ((out (assoc-ref outputs "out")) | |
206 | (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH"))) | |
207 | (wrap-program (string-append out "/bin/spicy") | |
208 | `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path)))) | |
209 | #t))))) | |
210 | (synopsis "Gtk client and libraries for SPICE remote desktop servers") | |
211 | (description "Gtk client and libraries for SPICE remote desktop servers.") | |
f057755e | 212 | (home-page "https://www.spice-space.org") |
bb28cf90 | 213 | (license (list license:lgpl2.1+ license:lgpl2.0+)))) |
3cbd37e4 DC |
214 | |
215 | (define-public spice | |
216 | (package | |
217 | (name "spice") | |
c0dc4179 | 218 | (version "0.14.3") |
3cbd37e4 DC |
219 | (source (origin |
220 | (method url-fetch) | |
221 | (uri (string-append | |
b142756d | 222 | "https://www.spice-space.org/download/releases/" |
f6b7ccc9 | 223 | "spice-server/spice-" version ".tar.bz2")) |
3cbd37e4 DC |
224 | (sha256 |
225 | (base32 | |
c0dc4179 | 226 | "05512vkfayw18ypg4acqbbpr72nsnsz9bj7k8c2wyrvnl3j4n7am")))) |
3cbd37e4 DC |
227 | (build-system gnu-build-system) |
228 | (propagated-inputs | |
229 | `(("openssl" ,openssl) | |
230 | ("pixman" ,pixman) | |
231 | ("spice-protocol" ,spice-protocol))) | |
232 | (inputs | |
5f2a7f4f DC |
233 | `(("cyrus-sasl" ,cyrus-sasl) |
234 | ("glib" ,glib) | |
9b81876f | 235 | ("libjpeg-turbo" ,libjpeg-turbo) |
17adb70f | 236 | ("libcacard" ,libcacard) ; smartcard support |
3cbd37e4 DC |
237 | ("lz4" ,lz4) |
238 | ("opus" ,opus) | |
b142756d | 239 | ("orc" ,orc) |
3cbd37e4 DC |
240 | ("zlib" ,zlib))) |
241 | (native-inputs | |
242 | `(("pkg-config" ,pkg-config) | |
243 | ("python" ,python) | |
f6b7ccc9 MB |
244 | ("spice-gtk" ,spice-gtk) |
245 | ||
246 | ;; These are needed for the server listen tests. | |
247 | ("glib-networking" ,glib-networking) | |
248 | ("gsettings-desktop-schemas" ,gsettings-desktop-schemas))) | |
3cbd37e4 DC |
249 | (arguments |
250 | `(#:configure-flags | |
f6b7ccc9 MB |
251 | '("--enable-lz4" |
252 | "--enable-automated-tests") | |
8504d192 LC |
253 | |
254 | ;; Several tests appear to be opening the same sockets concurrently. | |
65211552 | 255 | #:parallel-tests? #f)) |
3cbd37e4 DC |
256 | (synopsis "Server implementation of the SPICE protocol") |
257 | (description "SPICE is a remote display system built for virtual | |
36a4366d | 258 | environments which allows you to view a computing @code{desktop} environment |
3cbd37e4 DC |
259 | not only on the machine where it is running, but from anywhere on the |
260 | Internet and from a wide variety of machine architectures.") | |
d5ae997a | 261 | (home-page "https://www.spice-space.org") |
3cbd37e4 | 262 | (license (list license:lgpl2.1+ license:lgpl2.0+)))) |
33b0f4a4 DC |
263 | |
264 | (define-public spice-vdagent | |
265 | (package | |
266 | (name "spice-vdagent") | |
267 | (version "0.17.0") | |
268 | (source (origin | |
269 | (method url-fetch) | |
270 | (uri (string-append | |
271 | "http://www.spice-space.org/download/releases/" | |
272 | "spice-vdagent-" version ".tar.bz2")) | |
273 | (sha256 | |
274 | (base32 | |
275 | "0gdkyylyg1hksg0i0anvznqfli2q39335fnrmcd6847frpc8njpi")))) | |
276 | (build-system gnu-build-system) | |
277 | (arguments | |
278 | `(#:configure-flags | |
279 | '("--localstatedir=/var") | |
280 | #:phases | |
281 | (modify-phases %standard-phases | |
282 | (add-after 'unpack 'patch-makefile.in | |
283 | (lambda _ | |
284 | (substitute* "Makefile.in" | |
285 | (((string-append "\\$\\(mkdir_p\\) \\$\\(DESTDIR\\)" | |
286 | "\\$\\(localstatedir\\)/run/spice-vdagentd")) | |
287 | "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd")) | |
e02cd2b8 DC |
288 | #t)) |
289 | (add-after 'unpack 'patch-spice-vdagent.desktop | |
290 | (lambda* (#:key outputs #:allow-other-keys) | |
291 | (substitute* "data/spice-vdagent.desktop" | |
3f995aaf | 292 | (("Exec=/usr/bin/spice-vdagent") |
e02cd2b8 DC |
293 | (string-append "Exec=" (assoc-ref outputs "out") |
294 | "/bin/spice-vdagent"))) | |
33b0f4a4 DC |
295 | #t))))) |
296 | (inputs | |
297 | `(("alsa-lib" ,alsa-lib) | |
298 | ("dbus" ,dbus) | |
299 | ("glib" ,glib) | |
300 | ("libpciaccess" ,libpciaccess) | |
301 | ("libx11" ,libx11) | |
302 | ("libxext" ,libxext) | |
303 | ("libxfixes" ,libxfixes) | |
304 | ("libxinerama" ,libxinerama) | |
305 | ("libxrandr" ,libxrandr) | |
306 | ("spice-protocol" ,spice-protocol))) | |
307 | (native-inputs | |
308 | `(("pkg-config" ,pkg-config))) | |
309 | (synopsis "Spice agent for Linux") | |
310 | (description "Spice-vdagent enables sharing the clipboard and guest display | |
311 | resolution scaling on graphical console window resize.") | |
d5ae997a | 312 | (home-page "https://www.spice-space.org") |
33b0f4a4 | 313 | (license license:gpl3+))) |
6144dff5 | 314 | |
ee3d20b9 CB |
315 | (define-public libcacard |
316 | (package | |
317 | (name "libcacard") | |
318 | (version "2.7.0") | |
319 | (source (origin | |
320 | (method url-fetch) | |
321 | (uri (string-append | |
322 | "https://gitlab.freedesktop.org/spice/libcacard/uploads/" | |
323 | "56cb2499198e78e560a1d4c716cd8ab1" | |
324 | "/libcacard-" version ".tar.xz")) | |
325 | (sha256 | |
326 | (base32 | |
327 | "0vyvkk4b6xjwq1ccggql13c1x7g4y90clpkqw28257azgn2a1c8n")))) | |
328 | (build-system gnu-build-system) | |
329 | (arguments | |
330 | '(#:tests? #f ; TODO Tests require gnutls built with | |
331 | ; p11-kit | |
332 | #:phases | |
333 | (modify-phases %standard-phases | |
334 | (add-after 'unpack 'patch-tests | |
335 | (lambda* (#:key inputs #:allow-other-keys) | |
336 | (substitute* "tests/setup-softhsm2.sh" | |
337 | (("\\/usr\\/lib64\\/pkcs11\\/libsofthsm2\\.so") | |
338 | (string-append (assoc-ref inputs "softhsm") | |
339 | "/lib/softhsm/libsofthsm2.so"))) | |
340 | #t))))) | |
341 | (propagated-inputs | |
342 | `(("glib" ,glib) ; Requires: in the pkg-config file | |
343 | ("nss" ,nss))) ; Requires.private: in the pkg-config | |
344 | ; file | |
345 | (native-inputs | |
346 | `(("openssl" ,openssl) | |
347 | ("nss" ,nss "bin") | |
348 | ("opensc" ,opensc) | |
349 | ("softhsm" ,softhsm) | |
350 | ("gnutls" ,gnutls) | |
351 | ("pkg-config" ,pkg-config) | |
352 | ("which" ,which))) | |
353 | (synopsis "Emulate and share smart cards with virtual machines") | |
354 | (description | |
355 | "The @acronym{CAC,Common Access Card} library can be used to emulate and | |
356 | share smart cards from client system to local or remote virtual machines.") | |
357 | (home-page "https://gitlab.freedesktop.org/spice/libcacard") | |
358 | (license license:lgpl2.1+))) | |
359 | ||
6144dff5 DC |
360 | (define-public virt-viewer |
361 | (package | |
362 | (name "virt-viewer") | |
800248fe | 363 | (version "7.0") |
6144dff5 DC |
364 | (source (origin |
365 | (method url-fetch) | |
366 | (uri (string-append | |
367 | "https://virt-manager.org/download/sources/virt-viewer/" | |
368 | "virt-viewer-" version ".tar.gz")) | |
369 | (sha256 | |
370 | (base32 | |
800248fe | 371 | "00y9vi69sja4pkrfnvrkwsscm41bqrjzvp8aijb20pvg6ymczhj7")))) |
6144dff5 DC |
372 | (build-system gnu-build-system) |
373 | (inputs | |
374 | `(("gtk+" ,gtk+) | |
375 | ("libcap" ,libcap) | |
376 | ("libxml2" ,libxml2) | |
f54510d2 | 377 | ("spice-gtk" ,spice-gtk))) |
6144dff5 DC |
378 | (native-inputs |
379 | `(("glib:bin" ,glib "bin") | |
380 | ("intltool" ,intltool) | |
381 | ("pkg-config" ,pkg-config))) | |
382 | (arguments | |
383 | `(#:configure-flags | |
384 | '("--with-spice-gtk") | |
385 | #:phases | |
386 | (modify-phases %standard-phases | |
387 | (add-after | |
388 | 'install 'wrap-remote-viewer | |
389 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
390 | (let ((out (assoc-ref outputs "out")) | |
391 | (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH"))) | |
392 | (wrap-program (string-append out "/bin/remote-viewer") | |
393 | `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path)))) | |
394 | #t))))) | |
395 | (synopsis "Graphical console client for virtual machines") | |
396 | (description "Graphical console client for virtual machines using SPICE or | |
397 | VNC.") | |
398 | (home-page "https://virt-manager.org") | |
399 | (license license:gpl2+))) |