Commit | Line | Data |
---|---|---|
1d2c67c1 DC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2016 David Craven <david@craven.ch> | |
2aa18eeb | 3 | ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr> |
44ad1c16 | 4 | ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com> |
abf21ba5 | 5 | ;;; Copyright © 2019, 2020, 2022 Marius Bakke <marius@gnu.org> |
02c5ed4f | 6 | ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
1d2c67c1 DC |
7 | ;;; |
8 | ;;; This file is part of GNU Guix. | |
9 | ;;; | |
10 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
11 | ;;; under the terms of the GNU General Public License as published by | |
12 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
13 | ;;; your option) any later version. | |
14 | ;;; | |
15 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
16 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;;; GNU General Public License for more details. | |
19 | ;;; | |
20 | ;;; You should have received a copy of the GNU General Public License | |
21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
22 | ||
23 | (define-module (gnu packages spice) | |
24 | #:use-module (gnu packages) | |
2aa18eeb | 25 | #:use-module (gnu packages autotools) |
ee3d20b9 | 26 | #:use-module (gnu packages base) |
02c5ed4f | 27 | #:use-module (gnu packages bash) |
bb28cf90 | 28 | #:use-module (gnu packages compression) |
5f2a7f4f | 29 | #:use-module (gnu packages cyrus-sasl) |
2ef2654d | 30 | #:use-module (gnu packages gl) |
bb28cf90 DC |
31 | #:use-module (gnu packages glib) |
32 | #:use-module (gnu packages gnome) | |
02c5ed4f | 33 | #:use-module (gnu packages gettext) |
bb28cf90 DC |
34 | #:use-module (gnu packages gstreamer) |
35 | #:use-module (gnu packages gtk) | |
36 | #:use-module (gnu packages image) | |
1d2c67c1 | 37 | #:use-module (gnu packages libusb) |
2ef2654d | 38 | #:use-module (gnu packages linux) |
ee3d20b9 | 39 | #:use-module (gnu packages nss) |
02c5ed4f | 40 | #:use-module (gnu packages perl) |
1d2c67c1 | 41 | #:use-module (gnu packages pkg-config) |
bb28cf90 DC |
42 | #:use-module (gnu packages pulseaudio) |
43 | #:use-module (gnu packages python) | |
ee3d20b9 | 44 | #:use-module (gnu packages security-token) |
bb28cf90 | 45 | #:use-module (gnu packages tls) |
02c5ed4f | 46 | #:use-module (gnu packages virtualization) |
bb28cf90 DC |
47 | #:use-module (gnu packages xorg) |
48 | #:use-module (gnu packages xdisorg) | |
49 | #:use-module (gnu packages xiph) | |
6144dff5 | 50 | #:use-module (gnu packages xml) |
1d2c67c1 | 51 | #:use-module (guix build-system gnu) |
6d215516 | 52 | #:use-module (guix build-system meson) |
1d2c67c1 DC |
53 | #:use-module (guix download) |
54 | #:use-module (guix packages) | |
abf21ba5 | 55 | #:use-module (guix gexp) |
1d2c67c1 DC |
56 | #:use-module ((guix licenses) #:prefix license:) |
57 | #:use-module (guix utils)) | |
58 | ||
59 | (define-public usbredir | |
41a659d2 MB |
60 | (package |
61 | (name "usbredir") | |
62 | (home-page "https://spice-space.org") | |
2aa18eeb | 63 | (version "0.9.0") |
41a659d2 MB |
64 | (source (origin |
65 | (method url-fetch) | |
66 | (uri (string-append home-page "/download/" name "/" name "-" | |
2aa18eeb | 67 | version ".tar.xz")) |
41a659d2 MB |
68 | (sha256 |
69 | (base32 | |
2aa18eeb | 70 | "19jnpzlanq0a1m5lmlcsp50wxf7icxvpvclx7hnf0zxw8azngqd3")))) |
41a659d2 MB |
71 | (build-system gnu-build-system) |
72 | (propagated-inputs | |
8394619b | 73 | (list libusb)) |
41a659d2 | 74 | (native-inputs |
8394619b | 75 | (list autoconf automake libtool pkg-config)) |
41a659d2 MB |
76 | (synopsis "Tools for sending USB device traffic over a network") |
77 | (description | |
78 | "Usbredir is a network protocol for sending USB device traffic over a | |
79 | network connection. It can be used to redirect traffic from a USB device to a | |
80 | different (virtual) machine than the one to which the USB device is attached.") | |
81 | (license (list license:gpl2+ license:lgpl2.0+ license:lgpl2.1+)))) | |
2ef2654d DC |
82 | |
83 | (define-public virglrenderer | |
84 | (package | |
85 | (name "virglrenderer") | |
8b20a4d1 | 86 | (version "0.6.0") |
2ef2654d DC |
87 | (source (origin |
88 | (method url-fetch) | |
89 | (uri (string-append | |
90 | "https://www.freedesktop.org/software/virgl/" | |
91 | "virglrenderer-" version ".tar.bz2")) | |
1e5b8bee | 92 | (patches (search-patches "virglrenderer-CVE-2017-6386.patch")) |
2ef2654d DC |
93 | (sha256 |
94 | (base32 | |
8b20a4d1 | 95 | "06kf0q4l52gzx5p63l8850hff8pmhp7xv1hk8zgx2apbw18y6jd5")))) |
2ef2654d DC |
96 | (build-system gnu-build-system) |
97 | (inputs | |
e3196755 | 98 | (list libepoxy mesa eudev)) |
2ef2654d | 99 | (native-inputs |
8394619b | 100 | (list pkg-config)) |
2ef2654d DC |
101 | (synopsis "Virtual 3D GPU library") |
102 | (description "A virtual 3D GPU library that enables a virtualized operating | |
103 | system to use the host GPU to accelerate 3D rendering.") | |
104 | (home-page "https://virgil3d.github.io") | |
105 | (license (list license:expat license:bsd-3)))) | |
289e472f DC |
106 | |
107 | (define-public spice-protocol | |
108 | (package | |
109 | (name "spice-protocol") | |
05e9a463 | 110 | (version "0.14.3") |
289e472f DC |
111 | (source (origin |
112 | (method url-fetch) | |
113 | (uri (string-append | |
5e569d5c | 114 | "https://www.spice-space.org/download/releases/" |
6d215516 | 115 | "spice-protocol-" version ".tar.xz")) |
289e472f DC |
116 | (sha256 |
117 | (base32 | |
05e9a463 | 118 | "0yj8k7gcirrsf21w0q6146n5g4nzn2pqky4p90n5760m5ayfb1pr")))) |
6d215516 TGR |
119 | (build-system meson-build-system) |
120 | (arguments | |
121 | `(#:phases | |
122 | (modify-phases %standard-phases | |
123 | (add-after 'unpack 'install-documentation | |
124 | (lambda* (#:key outputs #:allow-other-keys) | |
125 | (let* ((out (assoc-ref outputs "out")) | |
126 | (doc (string-append out "/share/doc/" | |
127 | ,name "-" ,version))) | |
128 | (install-file "COPYING" doc) | |
129 | #t)))))) | |
289e472f DC |
130 | (synopsis "Protocol headers for the SPICE protocol") |
131 | (description "SPICE (the Simple Protocol for Independent Computing | |
132 | Environments) is a remote-display system built for virtual environments | |
133 | which allows users to view a desktop computing environment.") | |
5e569d5c | 134 | (home-page "https://www.spice-space.org") |
289e472f | 135 | (license (list license:bsd-3 license:lgpl2.1+)))) |
bb28cf90 DC |
136 | |
137 | (define-public spice-gtk | |
138 | (package | |
139 | (name "spice-gtk") | |
4f20e0a2 | 140 | (version "0.37") |
bb28cf90 DC |
141 | (source (origin |
142 | (method url-fetch) | |
143 | (uri (string-append | |
f057755e | 144 | "https://spice-space.org/download/gtk/" |
bb28cf90 DC |
145 | "spice-gtk-" version ".tar.bz2")) |
146 | (sha256 | |
147 | (base32 | |
4f20e0a2 | 148 | "1drvj8y35gnxbnrxsipwi15yh0vs9ixzv4wslz6r3lra8w3bfa0z")))) |
bb28cf90 DC |
149 | (build-system gnu-build-system) |
150 | (propagated-inputs | |
8394619b LC |
151 | (list gstreamer |
152 | gst-plugins-base | |
153 | gst-plugins-good | |
154 | spice-protocol | |
155 | ;; These are required by the pkg-config files. | |
156 | gtk+ | |
157 | pixman | |
50134a2b | 158 | openssl-1.1)) |
bb28cf90 DC |
159 | (inputs |
160 | `(("glib-networking" ,glib-networking) | |
c44dd0d6 | 161 | ("gobject-introspection" ,gobject-introspection) |
fbd2a245 | 162 | ("json-glib" ,json-glib) |
bb28cf90 | 163 | ("libepoxy" ,libepoxy) |
4bd428a7 | 164 | ("libjpeg" ,libjpeg-turbo) |
bb28cf90 DC |
165 | ("libxcb" ,libxcb) |
166 | ("lz4" ,lz4) | |
167 | ("mesa" ,mesa) | |
bb28cf90 DC |
168 | ("pulseaudio" ,pulseaudio) |
169 | ("python" ,python) | |
bb28cf90 | 170 | ("opus" ,opus) |
bb28cf90 DC |
171 | ("usbredir" ,usbredir))) |
172 | (native-inputs | |
173 | `(("glib:bin" ,glib "bin") | |
174 | ("intltool" ,intltool) | |
10e73bbc EF |
175 | ("pkg-config" ,pkg-config) |
176 | ("vala" ,vala))) | |
bb28cf90 DC |
177 | (arguments |
178 | `(#:configure-flags | |
179 | '("--enable-gstaudio" | |
180 | "--enable-gstvideo" | |
c44dd0d6 | 181 | "--enable-pulse" |
10e73bbc | 182 | "--enable-vala" |
c44dd0d6 | 183 | "--enable-introspection") |
bb28cf90 DC |
184 | #:phases |
185 | (modify-phases %standard-phases | |
fbd2a245 MB |
186 | (add-before 'check 'disable-session-test |
187 | (lambda _ | |
188 | ;; XXX: Disable session tests, because they require USB support, | |
189 | ;; which is not available in the build container. | |
190 | (substitute* "tests/Makefile" | |
191 | (("test-session\\$\\(EXEEXT\\) ") "")) | |
192 | #t)) | |
29c6fb0d MB |
193 | (add-after 'install 'patch-la-files |
194 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
195 | (let ((out (assoc-ref outputs "out")) | |
196 | (libjpeg (assoc-ref inputs "libjpeg"))) | |
197 | ;; Add an absolute reference for libjpeg in the .la files | |
198 | ;; so it does not have to be propagated. | |
199 | (substitute* (find-files (string-append out "/lib") "\\.la$") | |
200 | (("-ljpeg") | |
201 | (string-append "-L" libjpeg "/lib -ljpeg"))) | |
202 | #t))) | |
bb28cf90 DC |
203 | (add-after |
204 | 'install 'wrap-spicy | |
205 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
206 | (let ((out (assoc-ref outputs "out")) | |
207 | (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH"))) | |
208 | (wrap-program (string-append out "/bin/spicy") | |
209 | `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path)))) | |
210 | #t))))) | |
211 | (synopsis "Gtk client and libraries for SPICE remote desktop servers") | |
212 | (description "Gtk client and libraries for SPICE remote desktop servers.") | |
f057755e | 213 | (home-page "https://www.spice-space.org") |
bb28cf90 | 214 | (license (list license:lgpl2.1+ license:lgpl2.0+)))) |
3cbd37e4 DC |
215 | |
216 | (define-public spice | |
217 | (package | |
218 | (name "spice") | |
0368d470 | 219 | (version "0.15.0") |
3cbd37e4 DC |
220 | (source (origin |
221 | (method url-fetch) | |
222 | (uri (string-append | |
b142756d | 223 | "https://www.spice-space.org/download/releases/" |
f6b7ccc9 | 224 | "spice-server/spice-" version ".tar.bz2")) |
3cbd37e4 DC |
225 | (sha256 |
226 | (base32 | |
0368d470 | 227 | "1xd0xffw0g5vvwbq4ksmm3jjfq45f9dw20xpmi82g1fj9f7wy85k")))) |
3cbd37e4 DC |
228 | (build-system gnu-build-system) |
229 | (propagated-inputs | |
50134a2b | 230 | (list openssl-1.1 pixman spice-protocol)) |
3cbd37e4 | 231 | (inputs |
8394619b LC |
232 | (list cyrus-sasl |
233 | glib | |
234 | libjpeg-turbo | |
235 | libcacard ; smartcard support | |
236 | lz4 | |
237 | opus | |
238 | orc | |
239 | zlib)) | |
3cbd37e4 | 240 | (native-inputs |
8394619b LC |
241 | (list pkg-config |
242 | python | |
243 | spice-gtk | |
244 | ;; These are needed for the server listen tests. | |
245 | glib-networking | |
246 | gsettings-desktop-schemas)) | |
3cbd37e4 DC |
247 | (arguments |
248 | `(#:configure-flags | |
f6b7ccc9 MB |
249 | '("--enable-lz4" |
250 | "--enable-automated-tests") | |
8504d192 | 251 | |
02bf9bab MB |
252 | #:phases |
253 | (modify-phases %standard-phases | |
254 | ;; XXX: Otherwise the server listen tests fails with | |
255 | ;; Failed to create /homeless-shelter/.config/glib-2.0/settings | |
256 | (add-before 'check 'set-XDG_CONFIG_HOME | |
257 | (lambda _ | |
258 | (setenv "XDG_CONFIG_HOME" "/tmp")))) | |
259 | ||
8504d192 | 260 | ;; Several tests appear to be opening the same sockets concurrently. |
65211552 | 261 | #:parallel-tests? #f)) |
3cbd37e4 DC |
262 | (synopsis "Server implementation of the SPICE protocol") |
263 | (description "SPICE is a remote display system built for virtual | |
36a4366d | 264 | environments which allows you to view a computing @code{desktop} environment |
3cbd37e4 DC |
265 | not only on the machine where it is running, but from anywhere on the |
266 | Internet and from a wide variety of machine architectures.") | |
d5ae997a | 267 | (home-page "https://www.spice-space.org") |
3cbd37e4 | 268 | (license (list license:lgpl2.1+ license:lgpl2.0+)))) |
33b0f4a4 DC |
269 | |
270 | (define-public spice-vdagent | |
271 | (package | |
272 | (name "spice-vdagent") | |
a33afba4 | 273 | (version "0.21.0") |
33b0f4a4 DC |
274 | (source (origin |
275 | (method url-fetch) | |
276 | (uri (string-append | |
277 | "http://www.spice-space.org/download/releases/" | |
278 | "spice-vdagent-" version ".tar.bz2")) | |
279 | (sha256 | |
280 | (base32 | |
7166417e TGR |
281 | "0n8jlc1pv6mkry161y656b1nk9hhhminjq6nymzmmyjl7k95ymzx")) |
282 | (patches | |
283 | (search-patches "spice-vdagent-glib-2.68.patch")))) | |
33b0f4a4 DC |
284 | (build-system gnu-build-system) |
285 | (arguments | |
286 | `(#:configure-flags | |
287 | '("--localstatedir=/var") | |
a33afba4 MC |
288 | ;; The test-session-info test fails for unknown reasons (see: |
289 | ;; https://gitlab.freedesktop.org/spice/linux/vd_agent/-/issues/24). | |
290 | #:make-flags '("XFAIL_TESTS=tests/test-session-info") | |
33b0f4a4 DC |
291 | #:phases |
292 | (modify-phases %standard-phases | |
293 | (add-after 'unpack 'patch-makefile.in | |
294 | (lambda _ | |
295 | (substitute* "Makefile.in" | |
296 | (((string-append "\\$\\(mkdir_p\\) \\$\\(DESTDIR\\)" | |
297 | "\\$\\(localstatedir\\)/run/spice-vdagentd")) | |
a33afba4 | 298 | "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd")))) |
e02cd2b8 DC |
299 | (add-after 'unpack 'patch-spice-vdagent.desktop |
300 | (lambda* (#:key outputs #:allow-other-keys) | |
301 | (substitute* "data/spice-vdagent.desktop" | |
3f995aaf | 302 | (("Exec=/usr/bin/spice-vdagent") |
e02cd2b8 | 303 | (string-append "Exec=" (assoc-ref outputs "out") |
a33afba4 MC |
304 | "/bin/spice-vdagent"))))) |
305 | (add-after 'unpack 'fix-test-termination | |
306 | (lambda _ | |
307 | ;; The termination tests depend on finding the socket file name | |
308 | ;; in the spice-vdagent command line it launched, but by default | |
309 | ;; ps truncates its output, which causes the test to fail (see: | |
310 | ;; https://gitlab.freedesktop.org/spice/linux/vd_agent/-/merge_requests/36). | |
311 | (substitute* "tests/test-termination.c" | |
312 | (("ps -ef") | |
313 | "ps -efww"))))))) | |
33b0f4a4 | 314 | (inputs |
8394619b LC |
315 | (list alsa-lib |
316 | dbus | |
317 | glib | |
318 | gtk+ | |
319 | libdrm | |
320 | libpciaccess | |
321 | libx11 | |
322 | libxext | |
323 | libxfixes | |
324 | libxinerama | |
325 | libxrandr | |
326 | spice-protocol)) | |
33b0f4a4 | 327 | (native-inputs |
8394619b | 328 | (list pkg-config procps)) ;tests use 'ps' |
33b0f4a4 DC |
329 | (synopsis "Spice agent for Linux") |
330 | (description "Spice-vdagent enables sharing the clipboard and guest display | |
331 | resolution scaling on graphical console window resize.") | |
d5ae997a | 332 | (home-page "https://www.spice-space.org") |
33b0f4a4 | 333 | (license license:gpl3+))) |
6144dff5 | 334 | |
ee3d20b9 CB |
335 | (define-public libcacard |
336 | (package | |
337 | (name "libcacard") | |
4d5f7986 | 338 | (version "2.8.1") |
ee3d20b9 CB |
339 | (source (origin |
340 | (method url-fetch) | |
341 | (uri (string-append | |
342 | "https://gitlab.freedesktop.org/spice/libcacard/uploads/" | |
4d5f7986 | 343 | "13b249e695a0d9aa7cb501b1a85ebab1" |
ee3d20b9 CB |
344 | "/libcacard-" version ".tar.xz")) |
345 | (sha256 | |
346 | (base32 | |
4d5f7986 | 347 | "1rrjlclm6ad63gah1fa4yfwrz4z6vgq2yrybbvzvvdbxrgl4vgzv")))) |
84b238c8 | 348 | (build-system meson-build-system) |
abf21ba5 MB |
349 | (arguments |
350 | (list #:configure-flags | |
351 | ;; XXX: For some reason NSS is not automatically added on RUNPATH | |
352 | ;; with newer versions of Meson (after 0.60). | |
353 | #~(list (string-append "-Dc_link_args=-Wl,-rpath=" | |
354 | (search-input-directory | |
355 | %build-inputs "lib/nss"))))) | |
ee3d20b9 | 356 | (propagated-inputs |
8394619b LC |
357 | (list glib ; Requires: in the pkg-config file |
358 | nss ; Requires.private: in the pkg-config | |
359 | pcsc-lite)) ; file | |
ee3d20b9 | 360 | (native-inputs |
8394619b LC |
361 | (list openssl |
362 | `(,nss "bin") | |
363 | opensc | |
364 | gnutls | |
365 | pkg-config | |
366 | which)) | |
ee3d20b9 CB |
367 | (synopsis "Emulate and share smart cards with virtual machines") |
368 | (description | |
369 | "The @acronym{CAC,Common Access Card} library can be used to emulate and | |
370 | share smart cards from client system to local or remote virtual machines.") | |
371 | (home-page "https://gitlab.freedesktop.org/spice/libcacard") | |
372 | (license license:lgpl2.1+))) | |
373 | ||
6144dff5 DC |
374 | (define-public virt-viewer |
375 | (package | |
376 | (name "virt-viewer") | |
02c5ed4f | 377 | (version "11.0") |
6144dff5 DC |
378 | (source (origin |
379 | (method url-fetch) | |
380 | (uri (string-append | |
02c5ed4f MC |
381 | "https://virt-manager.org/download/sources/virt-viewer/" |
382 | "virt-viewer-" version ".tar.xz")) | |
6144dff5 DC |
383 | (sha256 |
384 | (base32 | |
02c5ed4f MC |
385 | "1l5bv6x6j21l487mk3n93ai121gg62n6b069r2jpf72cbhra4gx4")))) |
386 | (build-system meson-build-system) | |
6144dff5 | 387 | (native-inputs |
02c5ed4f MC |
388 | (list `(,glib "bin") |
389 | gettext-minimal | |
390 | perl ;for pod2man | |
391 | pkg-config | |
392 | python)) | |
393 | (inputs | |
394 | (list bash-completion | |
395 | gtk+ | |
396 | gtk-vnc | |
397 | libcap | |
398 | libgovirt | |
399 | libvirt-glib | |
400 | libxml2 | |
401 | spice-gtk | |
402 | vte)) | |
6144dff5 DC |
403 | (synopsis "Graphical console client for virtual machines") |
404 | (description "Graphical console client for virtual machines using SPICE or | |
405 | VNC.") | |
406 | (home-page "https://virt-manager.org") | |
407 | (license license:gpl2+))) |