projects/guix·blob python-team · refs

437 lines · 16.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 David Craven <[email protected]>
3;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2019 Rutger Helling <[email protected]>
5;;; Copyright © 2019, 2020, 2022 Marius Bakke <[email protected]>
6;;; Copyright © 2022, 2023 Maxim Cournoyer <[email protected]>
7;;; Copyright © 2023 Efraim Flashner <[email protected]>
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24(define-module (gnu packages spice)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages acl)
27 #:use-module (gnu packages admin)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages bash)
31 #:use-module (gnu packages build-tools)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages cyrus-sasl)
34 #:use-module (gnu packages gl)
35 #:use-module (gnu packages glib)
36 #:use-module (gnu packages gnome)
37 #:use-module (gnu packages gettext)
38 #:use-module (gnu packages gstreamer)
39 #:use-module (gnu packages gtk)
40 #:use-module (gnu packages image)
41 #:use-module (gnu packages libusb)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages nss)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages polkit)
47 #:use-module (gnu packages pulseaudio)
48 #:use-module (gnu packages python)
49 #:use-module (gnu packages python-build)
50 #:use-module (gnu packages python-xyz)
51 #:use-module (gnu packages security-token)
52 #:use-module (gnu packages tls)
53 #:use-module (gnu packages video)
54 #:use-module (gnu packages virtualization)
55 #:use-module (gnu packages vulkan)
56 #:use-module (gnu packages xorg)
57 #:use-module (gnu packages xdisorg)
58 #:use-module (gnu packages xiph)
59 #:use-module (gnu packages xml)
60 #:use-module (guix build-system gnu)
61 #:use-module (guix build-system meson)
62 #:use-module (guix download)
63 #:use-module (guix git-download)
64 #:use-module (guix packages)
65 #:use-module (guix gexp)
66 #:use-module ((guix licenses) #:prefix license:)
67 #:use-module (guix utils))
68
69(define-public usbredir
70 (package
71 (name "usbredir")
72 (home-page "https://spice-space.org")
73 (version "0.15.0")
74 (source (origin
75 (method url-fetch)
76 (uri (string-append home-page "/download/" name "/" name "-"
77 version ".tar.xz"))
78 (sha256
79 (base32
80 "0q890pzi0744isnw72lxk59aaqvhmg1dli8j35la123n4y0a7hkd"))))
81 (build-system meson-build-system)
82 (propagated-inputs (list libusb))
83 (inputs (list glib))
84 (native-inputs (list pkg-config))
85 (synopsis "Tools for sending USB device traffic over a network")
86 (description
87 "Usbredir is a network protocol for sending USB device traffic over a
88network connection. It can be used to redirect traffic from a USB device to a
89different (virtual) machine than the one to which the USB device is attached.")
90 (license (list license:gpl2+ license:lgpl2.0+ license:lgpl2.1+))))
91
92(define-public virglrenderer
93 (package
94 (name "virglrenderer")
95 (version "1.1.0")
96 (source (origin
97 (method git-fetch)
98 (uri (git-reference
99 (url "https://gitlab.freedesktop.org/virgl/virglrenderer.git")
100 (commit version)))
101 (file-name (git-file-name name version))
102 (sha256
103 (base32
104 "0cw3a0xkmlkc5a0yydbcyvr1hhxm0x6msn8d4pf1q4ck4q97ff3q"))))
105 (build-system meson-build-system)
106 (arguments
107 (list #:configure-flags
108 #~'("-Dvenus=true"
109 "-Dvideo=true"
110 "-Ddrm-renderers=amdgpu-experimental,msm")))
111 (inputs (list libepoxy mesa libdrm))
112 (propagated-inputs (list libva vulkan-loader))
113 (native-inputs (list pkg-config python vulkan-headers))
114 (synopsis "Virtual 3D GPU library")
115 (description "A virtual 3D GPU library that enables a virtualized operating
116system to use the host GPU to accelerate 3D rendering.")
117 (home-page "https://gitlab.freedesktop.org/virgl/virglrenderer")
118 (license (list license:expat license:bsd-3))))
119
120(define-public spice-protocol
121 (package
122 (name "spice-protocol")
123 (version "0.14.5")
124 (source (origin
125 (method url-fetch)
126 (uri (string-append
127 "https://www.spice-space.org/download/releases/"
128 "spice-protocol-" version ".tar.xz"))
129 (sha256
130 (base32
131 "1xygz5w2kkrr9qzj6lyc0dnc9zcnj7xxb6l9fps1k7g8yr4q9xds"))))
132 (build-system meson-build-system)
133 (arguments
134 (list #:phases
135 #~(modify-phases %standard-phases
136 (add-after 'unpack 'install-documentation
137 (lambda _
138 (install-file "COPYING"
139 (string-append #$output "/share/doc/"
140 #$name "-" #$version)))))))
141 (synopsis "Protocol headers for the SPICE protocol")
142 (description "SPICE (the Simple Protocol for Independent Computing
143Environments) is a remote-display system built for virtual environments
144which allows users to view a desktop computing environment.")
145 (home-page "https://www.spice-space.org")
146 (license (list license:bsd-3 license:lgpl2.1+))))
147
148(define-public spice-gtk
149 (package
150 (name "spice-gtk")
151 (version "0.42")
152 (source (origin
153 (method url-fetch)
154 (uri (string-append
155 "https://spice-space.org/download/gtk/"
156 "spice-gtk-" version ".tar.xz"))
157 (sha256
158 (base32
159 "0n3s1rn7yzs28hnl9k6ql3a90qlv8w16djqj32m1zb8i31zi304k"))))
160 (build-system meson-build-system)
161 (arguments
162 (list
163 #:phases
164 #~(modify-phases %standard-phases
165 (add-after 'unpack 'disable-problematic-tests
166 (lambda _
167 ;; XXX: Disable the session and cd-emu tests, because they
168 ;; require USB support, which is not available in the build
169 ;; container.
170 (substitute* "tests/meson.build"
171 ((".*'session.c',.*") "")
172 (("tests_sources \\+= 'cd-emu.c'" all)
173 (string-append "# " all)))))
174 (add-after 'unpack 'adjust-default-acl-helper-path
175 (lambda _
176 ;; The USB ACL helper used to allow USB redirection as a
177 ;; non-privileged user needs to be setuid, as configured by the
178 ;; gnome-desktop-service-type. A user can still change the
179 ;; location by specifying the SPICE_USB_ACL_BINARY environment
180 ;; variable.
181 (substitute* "src/usb-acl-helper.c"
182 (("ACL_HELPER_PATH\"/spice-client-glib-usb-acl-helper\"")
183 "\"/run/privileged/bin/spice-client-glib-usb-acl-helper\""))))
184 (add-before 'configure 'correct-polkit-dir
185 (lambda _
186 (substitute* "meson.build"
187 (("d.get_variable\\(pkgconfig: 'policydir')")
188 (string-append "'" #$output "/share/polkit-1/actions'")))))
189 (add-before 'install 'fake-pkexec
190 (lambda _ (setenv "PKEXEC_UID" "-1")))
191 (add-after 'install 'wrap-spicy
192 (lambda* (#:key outputs #:allow-other-keys)
193 (wrap-program (search-input-file outputs "bin/spicy")
194 `("GST_PLUGIN_SYSTEM_PATH" ":"
195 prefix (,(getenv "GST_PLUGIN_SYSTEM_PATH")))))))))
196 (native-inputs
197 (list `(,glib "bin")
198 intltool
199 pkg-config
200 python
201 python-pyparsing
202 python-six
203 vala))
204 (inputs
205 (list bash-minimal
206 glib-networking
207 gobject-introspection
208 json-glib
209 acl
210 libcap-ng
211 libepoxy
212 libxcb
213 mesa
214 polkit
215 pulseaudio
216 usbutils))
217 (propagated-inputs
218 (list gstreamer
219 gst-plugins-base
220 gst-plugins-good
221 spice-protocol
222 ;; These are required by the pkg-config files (needed for example
223 ;; when building GNOME Boxes).
224 cyrus-sasl
225 gtk+
226 openssl
227 opus
228 libcacard
229 libjpeg-turbo
230 lz4
231 phodav
232 pixman
233 usbredir))
234 (synopsis "Gtk client and libraries for SPICE remote desktop servers")
235 (description "Gtk client and libraries for SPICE remote desktop servers.")
236 (home-page "https://www.spice-space.org")
237 (license (list license:lgpl2.1+ license:lgpl2.0+))))
238
239(define-public spice
240 (package
241 (name "spice")
242 (version "0.16.0")
243 (source (origin
244 (method url-fetch)
245 (uri (string-append
246 "https://www.spice-space.org/download/releases/"
247 "spice-server/spice-" version ".tar.bz2"))
248 (sha256
249 (base32
250 "0zbiyh7z59cmmycmm5xvi7zlap3vbvrnzm5jpdhi4dq5ix9cjvha"))))
251 (build-system gnu-build-system)
252 (propagated-inputs
253 (list openssl pixman spice-protocol))
254 (inputs
255 (list cyrus-sasl
256 glib
257 libjpeg-turbo
258 libcacard ; smartcard support
259 lz4
260 opus
261 orc
262 zlib))
263 (native-inputs
264 (list pkg-config
265 python
266 spice-gtk
267 ;; These are needed for the server listen tests.
268 glib-networking
269 gsettings-desktop-schemas))
270 (arguments
271 `(#:configure-flags
272 '("--enable-lz4"
273 "--enable-automated-tests")
274
275 #:phases
276 (modify-phases %standard-phases
277 ;; XXX: Otherwise the server listen tests fails with
278 ;; Failed to create /homeless-shelter/.config/glib-2.0/settings
279 (add-before 'check 'set-XDG_CONFIG_HOME
280 (lambda _
281 (setenv "XDG_CONFIG_HOME" "/tmp"))))
282
283 ;; Several tests appear to be opening the same sockets concurrently.
284 #:parallel-tests? #f))
285 (synopsis "Server implementation of the SPICE protocol")
286 (description "SPICE is a remote display system built for virtual
287environments which allows you to view a computing @code{desktop} environment
288not only on the machine where it is running, but from anywhere on the
289Internet and from a wide variety of machine architectures.")
290 (home-page "https://www.spice-space.org")
291 (license (list license:lgpl2.1+ license:lgpl2.0+))))
292
293(define-public spice-vdagent
294 (package
295 (name "spice-vdagent")
296 (version "0.23.0")
297 (source (origin
298 (method url-fetch)
299 (uri (string-append
300 "http://www.spice-space.org/download/releases/"
301 "spice-vdagent-" version ".tar.bz2"))
302 (sha256
303 (base32
304 "0h3aw43wzjkh6921xczmknyrkxal4dx0vwfnry567i4panyzkq33"))))
305 (build-system gnu-build-system)
306 (arguments
307 (list
308 #:configure-flags #~(list "--localstatedir=/var")
309 ;; The test-session-info test fails for unknown reasons (see:
310 ;; https://gitlab.freedesktop.org/spice/linux/vd_agent/-/issues/24).
311 #:make-flags #~(list "XFAIL_TESTS=tests/test-session-info")
312 #:phases
313 #~(modify-phases %standard-phases
314 (add-after 'install 'patch-spice-vdagent.desktop
315 (lambda* (#:key outputs #:allow-other-keys)
316 (substitute* (string-append #$output "/etc/xdg/autostart/"
317 "spice-vdagent.desktop")
318 (("Exec=/usr/bin/spice-vdagent")
319 (string-append "Exec=" (search-input-file
320 outputs "bin/spice-vdagent")))))))))
321 (inputs
322 (list alsa-lib
323 dbus
324 glib
325 gtk+
326 libdrm
327 libpciaccess
328 libx11
329 libxext
330 libxfixes
331 libxinerama
332 libxrandr
333 spice-protocol))
334 (native-inputs
335 (list pkg-config procps)) ;tests use 'ps'
336 (synopsis "Spice agent for Linux")
337 (description "Spice-vdagent enables sharing the clipboard and guest display
338resolution scaling on graphical console window resize.")
339 (home-page "https://www.spice-space.org")
340 (license license:gpl3+)))
341
342(define-public libcacard
343 (package
344 (name "libcacard")
345 (version "2.8.1")
346 (source (origin
347 (method url-fetch)
348 (uri (string-append
349 "https://gitlab.freedesktop.org/spice/libcacard/uploads/"
350 "13b249e695a0d9aa7cb501b1a85ebab1"
351 "/libcacard-" version ".tar.xz"))
352 (sha256
353 (base32
354 "1rrjlclm6ad63gah1fa4yfwrz4z6vgq2yrybbvzvvdbxrgl4vgzv"))))
355 (build-system meson-build-system)
356 (arguments
357 (list #:configure-flags
358 ;; Otherwise, the validate-runpath phase fails.
359 #~(list (string-append "-Dc_link_args=-Wl,-rpath="
360 (search-input-directory %build-inputs
361 "lib/nss")))))
362 (propagated-inputs
363 ;; The following inputs are required in the pkg-config file.
364 (list glib
365 nss
366 pcsc-lite))
367 (native-inputs
368 (list openssl
369 `(,nss "bin")
370 opensc
371 gnutls
372 pkg-config
373 which))
374 (synopsis "Emulate and share smart cards with virtual machines")
375 (description
376 "The @acronym{CAC,Common Access Card} library can be used to emulate and
377share smart cards from client system to local or remote virtual machines.")
378 (home-page "https://gitlab.freedesktop.org/spice/libcacard")
379 (license license:lgpl2.1+)))
380
381(define-public virt-viewer
382 (package
383 (name "virt-viewer")
384 ;; XXX Remove the 'build-with-recent-meson phase when updating.
385 (version "11.0")
386 (source
387 (origin
388 (method url-fetch)
389 (uri (string-append
390 "https://virt-manager.org/download/sources/virt-viewer/"
391 "virt-viewer-" version ".tar.xz"))
392 (sha256
393 (base32 "1l5bv6x6j21l487mk3n93ai121gg62n6b069r2jpf72cbhra4gx4"))))
394 (build-system meson-build-system)
395 (arguments
396 (list
397 #:glib-or-gtk? #t
398 #:phases
399 #~(modify-phases %standard-phases
400 (add-after 'unpack 'build-with-recent-meson
401 ;; Fix ‘ERROR: Function does not take positional arguments.’
402 (lambda _
403 (substitute* "data/meson.build"
404 (("i18n\\.merge_file \\(.*" match)
405 (string-append match "#")))))
406 (add-after 'install 'wrap-program
407 (lambda* _
408 (for-each
409 (lambda (command)
410 (wrap-program (string-append #$output "/bin/" command)
411 ;; Wrap GDK_PIXBUF_MODULE_FILE to load icons in pure
412 ;; environments.
413 `("GDK_PIXBUF_MODULE_FILE" =
414 (,(getenv "GDK_PIXBUF_MODULE_FILE")))))
415 '("remote-viewer" "virt-viewer")))))))
416 (native-inputs
417 (list adwaita-icon-theme
418 `(,glib "bin")
419 gettext-minimal
420 perl ;for pod2man
421 pkg-config
422 python))
423 (inputs
424 (list bash-completion
425 gtk+
426 gtk-vnc
427 libcap
428 libgovirt
429 libvirt-glib
430 libxml2
431 spice-gtk
432 vte/gtk+-3))
433 (synopsis "Graphical console client for virtual machines")
434 (description "Graphical console client for virtual machines using SPICE or
435VNC.")
436 (home-page "https://virt-manager.org")
437 (license license:gpl2+)))