1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2016, 2017, 2018. 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
7 ;;; Copyright © 2017 Andy Patterson <ajpatter@uwaterloo.ca>
8 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
9 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
11 ;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
12 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
13 ;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com>
14 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
15 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
16 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
17 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
18 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
19 ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
21 ;;; This file is part of GNU Guix.
23 ;;; GNU Guix is free software; you can redistribute it and/or modify it
24 ;;; under the terms of the GNU General Public License as published by
25 ;;; the Free Software Foundation; either version 3 of the License, or (at
26 ;;; your option) any later version.
28 ;;; GNU Guix is distributed in the hope that it will be useful, but
29 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;;; GNU General Public License for more details.
33 ;;; You should have received a copy of the GNU General Public License
34 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36 (define-module (gnu packages virtualization)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages admin)
39 #:use-module (gnu packages assembly)
40 #:use-module (gnu packages attr)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages backup)
43 #:use-module (gnu packages base)
44 #:use-module (gnu packages bison)
45 #:use-module (gnu packages check)
46 #:use-module (gnu packages cmake)
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages cross-base)
49 #:use-module (gnu packages curl)
50 #:use-module (gnu packages cyrus-sasl)
51 #:use-module (gnu packages debian)
52 #:use-module (gnu packages disk)
53 #:use-module (gnu packages dns)
54 #:use-module (gnu packages docbook)
55 #:use-module (gnu packages documentation)
56 #:use-module (gnu packages figlet)
57 #:use-module (gnu packages firmware)
58 #:use-module (gnu packages flex)
59 #:use-module (gnu packages fontutils)
60 #:use-module (gnu packages freedesktop)
61 #:use-module (gnu packages gettext)
62 #:use-module (gnu packages gl)
63 #:use-module (gnu packages glib)
64 #:use-module (gnu packages gnome)
65 #:use-module (gnu packages gnupg)
66 #:use-module (gnu packages golang)
67 #:use-module (gnu packages graphviz)
68 #:use-module (gnu packages gtk)
69 #:use-module (gnu packages haskell)
70 #:use-module (gnu packages haskell-apps)
71 #:use-module (gnu packages haskell-check)
72 #:use-module (gnu packages haskell-crypto)
73 #:use-module (gnu packages haskell-web)
74 #:use-module (gnu packages haskell-xyz)
75 #:use-module (gnu packages image)
76 #:use-module (gnu packages libbsd)
77 #:use-module (gnu packages libusb)
78 #:use-module (gnu packages linux)
79 #:use-module (gnu packages m4)
80 #:use-module (gnu packages ncurses)
81 #:use-module (gnu packages nettle)
82 #:use-module (gnu packages networking)
83 #:use-module (gnu packages onc-rpc)
84 #:use-module (gnu packages package-management)
85 #:use-module (gnu packages perl)
86 #:use-module (gnu packages pkg-config)
87 #:use-module (gnu packages polkit)
88 #:use-module (gnu packages protobuf)
89 #:use-module (gnu packages python)
90 #:use-module (gnu packages python-build)
91 #:use-module (gnu packages python-check)
92 #:use-module (gnu packages python-crypto)
93 #:use-module (gnu packages python-web)
94 #:use-module (gnu packages python-xyz)
95 #:use-module (gnu packages pulseaudio)
96 #:use-module (gnu packages selinux)
97 #:use-module (gnu packages sdl)
98 #:use-module (gnu packages sphinx)
99 #:use-module (gnu packages spice)
100 #:use-module (gnu packages ssh)
101 #:use-module (gnu packages texinfo)
102 #:use-module (gnu packages textutils)
103 #:use-module (gnu packages tls)
104 #:use-module (gnu packages web)
105 #:use-module (gnu packages wget)
106 #:use-module (gnu packages xdisorg)
107 #:use-module (gnu packages xml)
108 #:use-module (gnu packages xorg)
109 #:use-module (guix build-system cmake)
110 #:use-module (guix build-system gnu)
111 #:use-module (guix build-system go)
112 #:use-module (guix build-system meson)
113 #:use-module (guix build-system python)
114 #:use-module (guix build-system trivial)
115 #:use-module (guix download)
116 #:use-module (guix git-download)
117 #:use-module ((guix licenses) #:prefix license:)
118 #:use-module (guix packages)
119 #:use-module (guix utils)
120 #:use-module (srfi srfi-1)
121 #:use-module (ice-9 match))
123 (define (qemu-patch commit file-name sha256-bv)
124 "Return an origin for COMMIT."
128 "http://git.qemu.org/?p=qemu.git;a=commitdiff_plain;h="
130 (hash (content-hash sha256-bv sha256))
131 (file-name file-name)))
139 (uri (string-append "https://download.qemu.org/qemu-"
143 "1rd41wwlvp0vpialjp2czs6i3lsc338xc72l3zkbb7ixjfslw5y9"))
144 (patches (search-patches "qemu-build-info-manual.patch"
145 "qemu-CVE-2021-20203.patch"))
146 (modules '((guix build utils)))
149 ;; Fix a bug in the do_ioctl_ifconf() function of qemu to
150 ;; make ioctl(…, SIOCGIFCONF, …) work for emulated 64 bit
151 ;; architectures. The size of struct ifreq is handled
153 ;; https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg01545.html
154 (substitute* '("linux-user/syscall.c")
155 (("^([[:blank:]]*)const argtype ifreq_arg_type.*$" line indent)
156 (string-append line indent
157 "const argtype ifreq_max_type[] = { MK_STRUCT(STRUCT_ifmap_ifreq) };\n"))
158 (("^([[:blank:]]*)target_ifreq_size[[:blank:]]=.*$" _ indent)
159 (string-append indent "target_ifreq_size = thunk_type_size(ifreq_max_type, 0);")))
161 (outputs '("out" "doc")) ;4.7 MiB of HTML docs
162 (build-system gnu-build-system)
164 `(;; FIXME: Disable tests on i686 to work around
165 ;; <https://bugs.gnu.org/40527>.
166 #:tests? ,(or (%current-target-system)
167 (not (string=? "i686-linux" (%current-system))))
169 #:configure-flags (list "--enable-usb-redir" "--enable-opengl"
171 (string-append "--smbd="
172 (assoc-ref %outputs "out")
173 "/libexec/samba-wrapper")
174 "--audio-drv-list=alsa,pa,sdl")
175 ;; Make build and test output verbose to facilitate investigation upon failure.
176 #:make-flags '("V=1")
177 #:modules ((srfi srfi-1)
179 ,@%gnu-build-system-modules)
181 (modify-phases %standard-phases
182 (add-after 'set-paths 'hide-glibc
183 (lambda* (#:key inputs #:allow-other-keys)
184 ;; Work around https://issues.guix.info/issue/36882. We need to
185 ;; remove glibc from C_INCLUDE_PATH so that the one hardcoded in GCC,
186 ;; at the bottom of GCC include search-path is used.
187 (let* ((filters '("libc"))
189 (filter-map (lambda (input)
192 (and (not (member name filters))
195 (set-path-environment-variable "C_INCLUDE_PATH"
199 (add-after 'unpack 'extend-test-time-outs
201 ;; These tests can time out on heavily-loaded and/or slow storage.
202 (substitute* (cons* "tests/qemu-iotests/common.qemu"
203 (find-files "tests/qemu-iotests" "^[0-9]+$"))
204 (("QEMU_COMM_TIMEOUT=[0-9]+" match)
205 (string-append match "9")))))
206 (add-after 'unpack 'disable-unusable-tests
208 (substitute* "tests/Makefile.include"
209 ;; Comment out the test-qga test, which needs /sys and
210 ;; fails within the build environment.
211 (("check-unit-.* tests/test-qga" all)
212 (string-append "# " all))
213 ;; Comment out the test-char test, which needs networking and
214 ;; fails within the build environment.
215 (("check-unit-.* tests/test-char" all)
216 (string-append "# " all)))
217 (substitute* "tests/qtest/Makefile.include"
218 ;; Disable the following test, which triggers a crash on some
219 ;; x86 CPUs (see https://issues.guix.info/43048 and
220 ;; https://bugs.launchpad.net/qemu/+bug/1896263).
221 (("check-qtest-i386-y \\+= bios-tables-test" all)
222 (string-append "# " all)))
224 (add-after 'patch-source-shebangs 'patch-/bin/sh-references
226 ;; Ensure the executables created by these source files reference
227 ;; /bin/sh from the store so they work inside the build container.
228 (substitute* '("block/cloop.c" "migration/exec.c"
229 "net/tap.c" "tests/qtest/libqtest.c")
230 (("/bin/sh") (which "sh")))
233 (lambda* (#:key inputs outputs (configure-flags '())
235 ;; The `configure' script doesn't understand some of the
236 ;; GNU options. Thus, add a new phase that's compatible.
237 (let ((out (assoc-ref outputs "out")))
238 (setenv "SHELL" (which "bash"))
240 ;; While we're at it, patch for tests.
241 (substitute* "tests/qemu-iotests/check"
242 (("#!/usr/bin/env python3")
243 (string-append "#!" (which "python3"))))
245 ;; Ensure config.status gets the correct shebang off the bat.
246 ;; The build system gets confused if we change it later and
247 ;; attempts to re-run the whole configury, and fails.
248 (substitute* "configure"
250 (string-append "#!" (which "sh"))))
252 ;; The binaries need to be linked against -lrt.
253 (setenv "LDFLAGS" "-lrt")
256 ,(string-append "--cc=" (which "gcc"))
257 ;; Some architectures insist on using HOST_CC
258 ,(string-append "--host-cc=" (which "gcc"))
259 "--disable-debug-info" ; save build space
260 "--enable-virtfs" ; just to be sure
261 ,(string-append "--prefix=" out)
262 ,(string-append "--sysconfdir=/etc")
263 ,@configure-flags)))))
264 ;; Create a wrapper for Samba. This allows QEMU to use Samba without
265 ;; pulling it in as an input. Note that you need to explicitly install
266 ;; Samba in your Guix profile for Samba support.
267 (add-after 'install 'create-samba-wrapper
268 (lambda* (#:key inputs outputs #:allow-other-keys)
269 (let* ((out (assoc-ref outputs "out"))
270 (libexec (string-append out "/libexec")))
271 (call-with-output-file "samba-wrapper"
273 (format port "#!/bin/sh
275 (chmod "samba-wrapper" #o755)
276 (install-file "samba-wrapper" libexec))
278 (add-after 'install 'move-html-doc
279 (lambda* (#:key inputs outputs #:allow-other-keys)
280 (let* ((out (assoc-ref outputs "out"))
281 (doc (assoc-ref outputs "doc"))
282 (qemu-doc (string-append doc "/share/doc/qemu-" ,version)))
284 (rename-file (string-append out "/share/doc/qemu")
285 (string-append qemu-doc "/html")))
287 (inputs ; TODO: Add optional inputs.
288 `(("alsa-lib" ,alsa-lib)
294 ("libcacard" ,libcacard) ; smartcard support
295 ("libcap-ng" ,libcap-ng) ; virtfs support requires libcap-ng & libattr
297 ("libepoxy" ,libepoxy)
298 ("libjpeg" ,libjpeg-turbo)
300 ("libseccomp" ,libseccomp)
301 ("libusb" ,libusb) ;USB pass-through support
304 ;; ("pciutils" ,pciutils)
306 ("pulseaudio" ,pulseaudio)
309 ("usbredir" ,usbredir)
310 ("util-linux" ,util-linux)
312 ("virglrenderer" ,virglrenderer)
314 (native-inputs `(("gettext" ,gettext-minimal)
315 ("glib:bin" ,glib "bin") ; gtester, etc.
319 ("pkg-config" ,pkg-config)
320 ("python-wrapper" ,python-wrapper)
321 ("python-sphinx" ,python-sphinx)
322 ("texinfo" ,texinfo)))
323 (home-page "https://www.qemu.org")
324 (synopsis "Machine emulator and virtualizer")
326 "QEMU is a generic machine emulator and virtualizer.
328 When used as a machine emulator, QEMU can run OSes and programs made for one
329 machine (e.g. an ARM board) on a different machine---e.g., your own PC. By
330 using dynamic translation, it achieves very good performance.
332 When used as a virtualizer, QEMU achieves near native performances by
333 executing the guest code directly on the host CPU. QEMU supports
334 virtualization when executing under the Xen hypervisor or using
335 the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86,
336 server and embedded PowerPC, and S390 guests.")
338 ;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'.
339 (license license:gpl2)
341 ;; Several tests fail on MIPS; see <http://hydra.gnu.org/build/117914>.
342 (supported-systems (fold delete %supported-systems
343 '("mips64el-linux" "i586-gnu")))))
345 (define-public qemu-minimal
346 ;; QEMU without GUI support, only supporting the host's architecture
347 (package (inherit qemu)
348 (name "qemu-minimal")
350 "Machine emulator and virtualizer (without GUI) for the host architecture")
352 (substitute-keyword-arguments (package-arguments qemu)
353 ((#:configure-flags _ '(list))
354 ;; Restrict to the host's architecture.
355 (let ((system (or (%current-target-system)
358 ((string-prefix? "i686" system)
359 '(list "--target-list=i386-softmmu"))
360 ((string-prefix? "xasdf86_64" system)
361 '(list "--target-list=i386-softmmu,x86_64-softmmu"))
362 ((string-prefix? "mips64" system)
363 '(list (string-append "--target-list=mips-softmmu,mipsel-softmmu,"
364 "mips64-softmmu,mips64el-softmmu")))
365 ((string-prefix? "mips" system)
366 '(list "--target-list=mips-softmmu,mipsel-softmmu"))
367 ((string-prefix? "aarch64" system)
368 '(list "--target-list=arm-softmmu,aarch64-softmmu"))
369 ((string-prefix? "arm" system)
370 '(list "--target-list=arm-softmmu"))
371 ((string-prefix? "alpha" system)
372 '(list "--target-list=alpha-softmmu"))
373 ((string-prefix? "powerpc64" system)
374 '(list "--target-list=ppc-softmmu,ppc64-softmmu"))
375 ((string-prefix? "powerpc" system)
376 '(list "--target-list=ppc-softmmu"))
377 ((string-prefix? "s390" system)
378 '(list "--target-list=s390x-softmmu"))
379 ((string-prefix? "riscv" system)
380 '(list "--target-list=riscv32-softmmu,riscv64-softmmu"))
381 (else ; An empty list actually builds all the targets.
384 ;; Remove dependencies on optional libraries, notably GUI libraries.
385 (native-inputs (fold alist-delete (package-native-inputs qemu)
387 (inputs (fold alist-delete (package-inputs qemu)
388 '("libusb" "mesa" "sdl2" "spice" "virglrenderer" "gtk+"
389 "usbredir" "libdrm" "libepoxy" "pulseaudio" "vde2"
392 (define (system->qemu-target system)
394 ((string-prefix? "i686" system)
396 ((string-prefix? "arm" system)
399 (string-append "qemu-system-" (match (string-split system #\-)
403 (define-public ganeti
406 ;; Note: we use a pre-release for Python 3 compatibility as well as many
408 (version "3.0.0beta1-24-g024cc9fa2")
412 (url "https://github.com/ganeti/ganeti")
413 (commit (string-append "v" version))))
415 (base32 "1ll34qd2mifni3bhg7cnir3xfnkafig8ch33qndqwrsby0y5ssia"))
416 (file-name (git-file-name name version))
417 (patches (search-patches "ganeti-shepherd-support.patch"
418 "ganeti-shepherd-master-failover.patch"
419 "ganeti-deterministic-manual.patch"
420 "ganeti-drbd-compat.patch"
421 "ganeti-os-disk-size.patch"
422 "ganeti-haskell-pythondir.patch"
423 "ganeti-disable-version-symlinks.patch"
424 "ganeti-preserve-PYTHONPATH.patch"))))
425 (build-system gnu-build-system)
427 `(#:imported-modules (,@%gnu-build-system-modules
428 (guix build haskell-build-system)
429 (guix build python-build-system))
430 #:modules (,@%gnu-build-system-modules
431 ((guix build haskell-build-system) #:prefix haskell:)
432 ((guix build python-build-system) #:select (python-version))
435 ;; The default test target includes a lot of checks that are only really
436 ;; relevant for developers such as NEWS file checking, line lengths, etc.
437 ;; We are only interested in the "py-tests" and "hs-tests" targets: this
438 ;; is the closest we've got even though it includes a little more.
439 #:test-target "check-TESTS"
442 (list "--localstatedir=/var"
443 "--sharedstatedir=/var"
445 "--enable-haskell-tests"
447 ;; By default, the build system installs everything to versioned
448 ;; directories such as $libdir/3.0 and relies on a $libdir/default
449 ;; symlink pointed from /etc/ganeti/{lib,share} to actually function.
450 ;; This is done to accommodate installing multiple versions in
451 ;; parallel, but is of little use to us as Guix users can just
452 ;; roll back and forth. Thus, disable it for simplicity.
453 "--disable-version-links"
455 ;; Ganeti can optionally take control over SSH host keys and
456 ;; distribute them to nodes as they are added, and also rotate keys
457 ;; with 'gnt-cluster renew-crypto --new-ssh-keys'. Thus it needs to
458 ;; know how to restart the SSH daemon.
459 "--with-sshd-restart-command='herd restart ssh-daemon'"
461 ;; Look for OS definitions in this directory by default. It can
462 ;; be changed in the cluster configuration.
463 "--with-os-search-path=/run/current-system/profile/share/ganeti/os"
465 ;; The default QEMU executable to use. We don't use the package
466 ;; here because this entry is stored in the cluster configuration.
467 (string-append "--with-kvm-path=/run/current-system/profile/bin/"
468 ,(system->qemu-target (%current-system))))
470 (modify-phases %standard-phases
471 (add-after 'unpack 'create-vcs-version
473 ;; If we are building from a git checkout, we need to create a
474 ;; 'vcs-version' file manually because the build system does
475 ;; not have access to the git repository information.
476 (unless (file-exists? "vcs-version")
477 (call-with-output-file "vcs-version"
479 (format port "v~a~%" ,version))))
481 (add-after 'unpack 'patch-absolute-file-names
483 (substitute* '("lib/utils/process.py"
485 "src/Ganeti/Constants.hs"
486 "src/Ganeti/HTools/CLI.hs"
487 "test/py/ganeti.config_unittest.py"
488 "test/py/ganeti.hooks_unittest.py"
489 "test/py/ganeti.utils.process_unittest.py"
490 "test/py/ganeti.utils.text_unittest.py"
491 "test/py/ganeti.utils.wrapper_unittest.py")
492 (("/bin/sh") (which "sh"))
493 (("/bin/bash") (which "bash"))
494 (("/usr/bin/env") (which "env"))
495 (("/bin/true") (which "true")))
497 ;; This script is called by the node daemon at startup to perform
498 ;; sanity checks on the cluster IP addresses, and it is also used
499 ;; in a master-failover scenario. Add absolute references to
500 ;; avoid propagating these executables.
501 (substitute* "tools/master-ip-setup"
502 (("arping") (which "arping"))
503 (("ndisc6") (which "ndisc6"))
504 (("fping") (which "fping"))
505 (("grep") (which "grep"))
506 (("ip addr") (string-append (which "ip") " addr")))
508 (add-after 'unpack 'override-builtin-PATH
510 ;; Ganeti runs OS install scripts and similar with a built-in
511 ;; hard coded PATH. Patch so it works on Guix System.
512 (substitute* "src/Ganeti/Constants.hs"
513 (("/sbin:/bin:/usr/sbin:/usr/bin")
514 "/run/setuid-programs:/run/current-system/profile/sbin:\
515 /run/current-system/profile/bin"))
517 (add-after 'bootstrap 'patch-sphinx-version-detection
519 ;; The build system runs 'sphinx-build --version' to verify that
520 ;; the Sphinx is recent enough, but does not expect the
521 ;; .sphinx-build-real executable name created by the Sphinx wrapper.
522 (substitute* "configure"
523 (("\\$SPHINX --version 2>&1")
524 "$SPHINX --version 2>&1 | sed 's/.sphinx-build-real/sphinx-build/g'"))
527 ;; The build system invokes Cabal and GHC, which do not work with
528 ;; GHC_PACKAGE_PATH: <https://github.com/haskell/cabal/issues/3728>.
529 ;; Tweak the build system to do roughly what haskell-build-system does.
530 (add-before 'configure 'configure-haskell
531 (assoc-ref haskell:%standard-phases 'setup-compiler))
532 (add-after 'configure 'do-not-use-GHC_PACKAGE_PATH
534 (unsetenv "GHC_PACKAGE_PATH")
535 (substitute* "Makefile"
537 "$(CABAL) --package-db=../package.conf.d")
539 "$(GHC) -package-db=../package.conf.d"))
541 (add-after 'configure 'make-ghc-use-shared-libraries
543 (substitute* "Makefile"
544 (("HFLAGS =") "HFLAGS = -dynamic -fPIC"))
546 (add-after 'configure 'fix-installation-directories
548 (substitute* "Makefile"
549 ;; Do not attempt to create /var during install.
550 (("\\$\\(DESTDIR\\)\\$\\{localstatedir\\}")
551 "$(DESTDIR)${prefix}${localstatedir}")
552 ;; Similarly, do not attempt to install the sample ifup scripts
554 (("\\$\\(DESTDIR\\)\\$\\(ifupdir\\)")
555 "$(DESTDIR)${prefix}$(ifupdir)"))
557 (add-before 'build 'adjust-tests
559 ;; Disable tests that can not run. Do it early to prevent
560 ;; touching the Makefile later and triggering a needless rebuild.
561 (substitute* "Makefile"
562 ;; These tests expect the presence of a 'root' user (via
563 ;; ganeti/runtime.py), which fails in the build environment.
564 (("test/py/ganeti\\.asyncnotifier_unittest\\.py") "")
565 (("test/py/ganeti\\.backend_unittest\\.py") "")
566 (("test/py/ganeti\\.daemon_unittest\\.py") "")
567 (("test/py/ganeti\\.tools\\.ensure_dirs_unittest\\.py") "")
568 (("test/py/ganeti\\.utils\\.io_unittest-runasroot\\.py") "")
569 ;; Disable the bash_completion test, as it requires the full
570 ;; bash instead of bash-minimal.
571 (("test/py/bash_completion\\.bash")
573 ;; This test requires networking.
574 (("test/py/import-export_unittest\\.bash")
577 ;; Many of the Makefile targets reset PYTHONPATH before running
578 ;; the Python interpreter, which does not work very well for us.
579 (substitute* "Makefile"
581 (string-append "PYTHONPATH=" (getenv "PYTHONPATH") ":")))
583 (add-after 'build 'build-bash-completions
585 (let ((orig-pythonpath (getenv "PYTHONPATH")))
586 (setenv "PYTHONPATH" (string-append ".:" orig-pythonpath))
587 (invoke "./autotools/build-bash-completion")
588 (setenv "PYTHONPATH" orig-pythonpath)
590 (add-before 'check 'pre-check
591 (lambda* (#:key inputs #:allow-other-keys)
592 ;; Set TZDIR so that time zones are found.
593 (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
596 ;; This test checks whether PYTHONPATH is untouched, and extends
597 ;; it to include test directories if so. Add an else branch for
598 ;; our modified PYTHONPATH, in order to prevent a confusing test
599 ;; failure where expired certificates are not cleaned because
600 ;; check-cert-expired is silently crashing.
601 (substitute* "test/py/ganeti-cleaner_unittest.bash"
602 (("then export PYTHONPATH=(.*)" all testpath)
603 (string-append all "else export PYTHONPATH="
604 (getenv "PYTHONPATH") ":" testpath "\n")))
606 (substitute* "test/py/ganeti.utils.process_unittest.py"
607 ;; This test attempts to run an executable with
608 ;; RunCmd(..., reset_env=True), which fails because the default
609 ;; PATH from Constants.hs does not exist in the build container.
610 ((".*def testResetEnv.*" all)
611 (string-append " @unittest.skipIf(True, "
612 "\"cannot reset env in the build container\")\n"
615 ;; XXX: Somehow this test fails in the build container, but
616 ;; works in 'guix environment -C', even without /bin/sh?
617 ((".*def testPidFile.*" all)
618 (string-append " @unittest.skipIf(True, "
619 "\"testPidFile fails in the build container\")\n"
622 ;; XXX: Why are these links not added automatically.
623 (with-directory-excursion "test/hs"
624 (for-each (lambda (file)
625 (symlink "../../src/htools" file))
626 '("hspace" "hscan" "hinfo" "hbal" "hroller"
627 "hcheck" "hail" "hsqueeze")))
629 (add-after 'install 'install-bash-completions
630 (lambda* (#:key outputs #:allow-other-keys)
631 (let* ((out (assoc-ref outputs "out"))
632 (compdir (string-append out "/etc/bash_completion.d")))
634 (copy-file "doc/examples/bash_completion"
635 (string-append compdir "/ganeti"))
636 ;; The one file contains completions for many different
637 ;; executables. Create symlinks for found completions.
638 (with-directory-excursion compdir
640 (lambda (prog) (symlink "ganeti" prog))
641 (call-with-input-file "ganeti"
643 (let loop ((line (read-line port))
645 (if (eof-object? line)
647 (if (string-prefix? "complete" line)
648 (loop (read-line port)
649 ;; Extract "prog" from lines of the form:
650 ;; "complete -F _prog -o filenames prog".
651 ;; Note that 'burnin' is listed with the
652 ;; absolute file name, which is why we
653 ;; run everything through 'basename'.
654 (cons (basename (car (reverse (string-split
657 (loop (read-line port) progs))))))))
659 ;; Wrap all executables with PYTHONPATH. We can't borrow the phase
660 ;; from python-build-system because we also need to wrap the scripts
661 ;; in $out/lib/ganeti such as "node-daemon-setup".
662 (add-after 'install 'wrap
663 (lambda* (#:key inputs outputs #:allow-other-keys)
664 (let* ((out (assoc-ref outputs "out"))
665 (sbin (string-append out "/sbin"))
666 (lib (string-append out "/lib"))
667 (python (assoc-ref inputs "python"))
668 (major+minor (python-version python))
669 (PYTHONPATH (string-append lib "/python" major+minor
671 (getenv "PYTHONPATH"))))
672 (define (shell-script? file)
673 (call-with-ascii-input-file file
675 (let ((shebang (false-if-exception (read-line port))))
677 (string-prefix? "#!" shebang)
678 (or (string-contains shebang "/bin/bash")
679 (string-contains shebang "/bin/sh")))))))
682 ;; Do not wrap shell scripts because some are meant to be
683 ;; sourced, which breaks if they are wrapped. We do wrap
684 ;; the Haskell executables because some call out to Python
686 (and (executable-file? file)
687 (not (symbolic-link? file))
688 (not (shell-script? file))))
690 (for-each (lambda (file)
692 `("PYTHONPATH" ":" prefix (,PYTHONPATH))))
694 (append (find-files (string-append lib "/ganeti"))
699 ("cabal" ,cabal-install)
702 ;; These inputs are necessary to bootstrap the package, because we
703 ;; have patched the build system.
704 ("autoconf" ,autoconf)
705 ("automake" ,automake)
707 ;; For the documentation.
708 ("python-docutils" ,python-docutils)
709 ("sphinx" ,python-sphinx)
713 ;; Test dependencies.
714 ("fakeroot" ,fakeroot)
715 ("ghc-temporary" ,ghc-temporary)
716 ("ghc-test-framework" ,ghc-test-framework)
717 ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
718 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
719 ("python-mock" ,python-mock)
720 ("python-pyyaml" ,python-pyyaml)
723 ("shelltestrunner" ,shelltestrunner)
724 ("tzdata" ,tzdata-for-tests)))
726 `(("arping" ,iputils) ;must be the iputils version
729 ("iproute2" ,iproute)
732 ("qemu" ,qemu-minimal) ;for qemu-img
733 ("ghc-attoparsec" ,ghc-attoparsec)
734 ("ghc-base64-bytestring" ,ghc-base64-bytestring)
735 ("ghc-cryptonite" ,ghc-cryptonite)
736 ("ghc-curl" ,ghc-curl)
737 ("ghc-hinotify" ,ghc-hinotify)
738 ("ghc-hslogger" ,ghc-hslogger)
739 ("ghc-json" ,ghc-json)
740 ("ghc-lens" ,ghc-lens)
741 ("ghc-lifted-base" ,ghc-lifted-base)
742 ("ghc-network" ,ghc-network)
743 ("ghc-old-time" ,ghc-old-time)
744 ("ghc-psqueue" ,ghc-psqueue)
745 ("ghc-regex-pcre" ,ghc-regex-pcre)
746 ("ghc-utf8-string" ,ghc-utf8-string)
747 ("ghc-zlib" ,ghc-zlib)
749 ;; For the optional metadata daemon.
750 ("ghc-snap-core" ,ghc-snap-core)
751 ("ghc-snap-server" ,ghc-snap-server)
754 ("python-pyopenssl" ,python-pyopenssl)
755 ("python-simplejson" ,python-simplejson)
756 ("python-pyparsing" ,python-pyparsing)
757 ("python-pyinotify" ,python-pyinotify)
758 ("python-pycurl" ,python-pycurl)
759 ("python-bitarray" ,python-bitarray)
760 ("python-paramiko" ,python-paramiko)
761 ("python-psutil" ,python-psutil)))
762 (home-page "http://www.ganeti.org/")
763 (synopsis "Cluster-based virtual machine management system")
765 "Ganeti is a virtual machine management tool built on top of existing
766 virtualization technologies such as Xen or KVM. Ganeti controls:
769 @item Disk creation management;
770 @item Operating system installation for instances (in co-operation with
771 OS-specific install scripts); and
772 @item Startup, shutdown, and failover between physical systems.
775 Ganeti is designed to facilitate cluster management of virtual servers and
776 to provide fast and simple recovery after physical failures, using
777 commodity hardware.")
778 (license license:bsd-2)))
780 (define-public ganeti-instance-guix
782 (name "ganeti-instance-guix")
784 (home-page "https://github.com/mbakke/ganeti-instance-guix")
787 (uri (git-reference (url home-page) (commit version)))
788 (file-name (git-file-name name version))
791 "0aa08irpcpns6mhjgsplc5f0p8ab1qcr9ah1gj5z66kxgqyflzrp"))))
792 (build-system gnu-build-system)
794 '(#:configure-flags '("--sysconfdir=/etc" "--localstatedir=/var")))
796 `(("autoconf" ,autoconf)
797 ("automake" ,automake)))
799 `(("util-linux" ,util-linux)
800 ("qemu-img" ,qemu-minimal)))
801 (synopsis "Guix OS integration for Ganeti")
803 "This package provides a guest OS definition for Ganeti that uses
804 Guix to build virtual machines.")
805 (license license:gpl3+)))
807 (define-public ganeti-instance-debootstrap
809 (name "ganeti-instance-debootstrap")
810 ;; We need two commits on top of the latest release for compatibility
811 ;; with newer sfdisk, as well as gnt-network integration.
812 (version "0.16-2-ge145396")
813 (home-page "https://github.com/ganeti/instance-debootstrap")
816 (uri (git-reference (url home-page) (commit version)))
817 (file-name (git-file-name name version))
820 "0f2isw9d8lawzj21rrq1q9xhq8xfa65rqbhqmrn59z201x9q1336"))))
821 (build-system gnu-build-system)
823 '(#:configure-flags '("--sysconfdir=/etc" "--localstatedir=/var")
824 #:phases (modify-phases %standard-phases
825 (add-after 'unpack 'add-absolute-references
827 (substitute* "common.sh.in"
828 (("/sbin/blkid") (which "blkid"))
830 (string-append (which "kpartx") " -")))
831 (substitute* "import"
833 (string-append (which "restore") " -r")))
834 (substitute* "export"
836 (string-append (which "dump") " -0")))
837 (substitute* "create"
838 (("debootstrap") (which "debootstrap"))
839 (("`which run-parts`") (which "run-parts"))
840 ;; Here we actually need to hard code /bin/passwd
841 ;; because it's called via chroot, which fails if
842 ;; "/bin" is not in PATH.
843 (("passwd") "/bin/passwd"))
845 (add-after 'unpack 'set-dpkg-arch
846 (lambda* (#:key system #:allow-other-keys)
847 ;; The create script passes --arch to debootstrap,
848 ;; and defaults to `dpkg --print-architecture` when
849 ;; ARCH is not set in variant.conf. Hard code the
850 ;; build-time architecture to avoid the dpkg dependency.
852 (cond ((string-prefix? "x86_64" system)
854 ((string-prefix? "i686" system)
856 ((string-prefix? "aarch64" system)
858 (else (car (string-split system #\-))))))
859 (substitute* "create"
860 (("`dpkg --print-architecture`")
863 (add-after 'configure 'adjust-Makefile
865 ;; Do not attempt to create /etc/ganeti/instance-debootstrap
866 ;; and /etc/default/ganeti-instance-debootstrap during install.
867 ;; They are created by the Ganeti service.
868 (substitute* "Makefile"
869 (("\\$\\(variantsdir\\)")
870 "$(prefix)/etc/ganeti/instance-debootstrap/variants")
871 (("\\$\\(defaultsdir\\)")
872 "$(prefix)/etc/default/ganeti-instance-debootstrap"))
874 (add-after 'install 'make-variants.list-symlink
875 (lambda* (#:key outputs #:allow-other-keys)
876 ;; The Ganeti OS API mandates a variants.list file that
877 ;; describes all supported "variants" of this OS.
878 ;; Guix generates this file, so make the original file
880 (with-directory-excursion (string-append
881 (assoc-ref outputs "out")
882 "/share/ganeti/os/debootstrap")
883 (delete-file "variants.list")
884 (symlink "/etc/ganeti/instance-debootstrap/variants/variants.list"
888 `(("autoconf" ,autoconf)
889 ("automake" ,automake)))
891 `(("debianutils" ,debianutils)
892 ("debootstrap" ,debootstrap)
894 ("kpartx" ,multipath-tools)
895 ("util-linux" ,util-linux)))
896 (synopsis "Debian OS integration for Ganeti")
898 "This package provides a guest OS definition for Ganeti. It installs
899 Debian or a derivative using @command{debootstrap}.")
900 (license license:gpl2+)))
902 (define-public libosinfo
909 (uri (string-append "https://releases.pagure.org/libosinfo/libosinfo-"
913 "1s97sv24bybggjx6hgqba2qdqz3ivfpd4cmkh4zm5y59sim109mv"))))
914 (build-system meson-build-system)
917 (list (string-append "-Dwith-usb-ids-path="
918 (assoc-ref %build-inputs "usb.ids"))
919 (string-append "-Dwith-pci-ids-path="
920 (assoc-ref %build-inputs "pci.ids")))
922 (modify-phases %standard-phases
923 (add-after 'unpack 'patch-osinfo-path
924 (lambda* (#:key inputs #:allow-other-keys)
925 (substitute* "osinfo/osinfo_loader.c"
926 (("path = DATA_DIR.*")
927 (string-append "path = \"" (assoc-ref inputs "osinfo-db")
928 "/share/osinfo\";")))
931 `(("libsoup" ,libsoup)
934 ("osinfo-db" ,osinfo-db)))
936 `(("glib" ,glib "bin") ; glib-mkenums, etc.
937 ("gobject-introspection" ,gobject-introspection)
940 ("intltool" ,intltool)
941 ("pkg-config" ,pkg-config)
945 (uri "https://github.com/pciutils/pciids/raw/ad02084f0bc143e3c15e31a6152a3dfb1d7a3156/pci.ids")
948 "0kfhpj5rnh24hz2714qhfmxk281vwc2w50sm73ggw5d15af7zfsw"))))
952 (uri "https://svn.code.sf.net/p/linux-usb/repo/trunk/htdocs/usb.ids?r=2681")
953 (file-name "usb.ids")
956 "1m6yhvz5k8aqzxgk7xj3jkk8frl1hbv0h3vgj4wbnvnx79qnvz3r"))))))
957 (home-page "https://libosinfo.org/")
958 (synopsis "Operating system information database")
959 (description "libosinfo is a GObject based library API for managing
960 information about operating systems, hypervisors and the (virtual) hardware
961 devices they can support. It includes a database containing device metadata
962 and provides APIs to match/identify optimal devices for deploying an operating
963 system on a hypervisor. Via GObject Introspection, the API is available in
964 all common programming languages. Vala bindings are also provided.")
965 ;; The library files are released under LGPLv2.1 or later; the source
966 ;; files in the "tools" directory are released under GPLv2+.
967 (license (list license:lgpl2.1+ license:gpl2+))))
976 "https://linuxcontainers.org/downloads/lxc/lxc-"
980 "0qz4l7mlhq7hx53q606qgvkyzyr01glsw290v8ppzvxn1fydlrci"))))
981 (build-system gnu-build-system)
983 `(("pkg-config" ,pkg-config)))
987 ("libseccomp" ,libseccomp)
988 ("libselinux" ,libselinux)))
991 (list (string-append "--docdir=" (assoc-ref %outputs "out")
992 "/share/doc/" ,name "-" ,version)
994 "--localstatedir=/var")
996 (modify-phases %standard-phases
998 (lambda* (#:key outputs #:allow-other-keys)
999 (let* ((out (assoc-ref outputs "out"))
1000 (bashcompdir (string-append out "/etc/bash_completion.d")))
1001 (invoke "make" "install"
1002 (string-append "bashcompdir=" bashcompdir)
1003 ;; Don't install files into /var and /etc.
1004 "LXCPATH=/tmp/var/lib/lxc"
1005 "localstatedir=/tmp/var"
1006 "sysconfdir=/tmp/etc"
1007 "sysconfigdir=/tmp/etc/default")))))))
1008 (synopsis "Linux container tools")
1009 (home-page "https://linuxcontainers.org/")
1011 "LXC is a userspace interface for the Linux kernel containment features.
1012 Through a powerful API and simple tools, it lets Linux users easily create and
1013 manage system or application containers.")
1014 (license license:lgpl2.1+)))
1016 (define-public libvirt
1023 (uri (string-append "https://libvirt.org/sources/libvirt-"
1026 (base32 "0m8cqaqflvys5kaqpvb0qr4k365j09jc5xk6x70yvg8qkcl2hcz2"))
1028 (search-patches "libvirt-create-machine-cgroup.patch"))))
1029 (build-system gnu-build-system)
1033 "--with-qemu-user=nobody"
1034 "--with-qemu-group=kvm"
1036 (string-append "--docdir=" (assoc-ref %outputs "out") "/share/doc/"
1039 "--localstatedir=/var")
1041 (modify-phases %standard-phases
1042 (add-before 'configure 'fix-BOURNE_SHELL-definition
1043 ;; BOURNE_SHELL is hard-#defined to ‘/bin/sh’, causing test failures.
1045 (substitute* "config.h.in"
1046 (("/bin/sh") (which "sh")))
1048 (add-before 'configure 'patch-libtirpc-file-names
1049 (lambda* (#:key inputs #:allow-other-keys)
1050 ;; libvirt uses an m4 macro instead of pkg-config to determine where
1051 ;; the RPC headers are located. Tell it to look in the right place.
1052 (substitute* "configure"
1053 (("/usr/include/tirpc") ;defined in m4/virt-xdr.m4
1054 (string-append (assoc-ref inputs "libtirpc")
1057 (add-before 'configure 'disable-broken-tests
1059 (let ((tests (list "commandtest" ; hangs idly
1060 "qemuxml2argvtest" ; fails
1061 "qemuhotplugtest" ; fails
1062 "virnetsockettest" ; tries to network
1063 "virshtest"))) ; fails
1064 (substitute* "tests/Makefile.in"
1065 (((format #f "(~a)\\$\\(EXEEXT\\)" (string-join tests "|")))
1069 ;; Since the sysconfdir and localstatedir should be /etc and /var
1070 ;; at runtime, we must prevent writing to them at installation
1072 (lambda* (#:key make-flags #:allow-other-keys)
1073 (apply invoke "make" "install"
1074 "sysconfdir=/tmp/etc"
1075 "localstatedir=/tmp/var"
1078 `(("libxml2" ,libxml2)
1080 ("libpciaccess" ,libpciaccess)
1083 ("libpcap" ,libpcap)
1085 ("libtirpc" ,libtirpc) ;for <rpc/rpc.h>
1086 ("libuuid" ,util-linux "lib")
1087 ("lvm2" ,lvm2) ;for libdevmapper
1089 ("openssl" ,openssl)
1090 ("cyrus-sasl" ,cyrus-sasl)
1091 ("libyajl" ,libyajl)
1093 ("dmidecode" ,dmidecode)
1094 ("dnsmasq" ,dnsmasq)
1095 ("ebtables" ,ebtables)
1096 ("iproute" ,iproute)
1097 ("iptables" ,iptables)))
1099 `(("xsltproc" ,libxslt)
1101 ("pkg-config" ,pkg-config)
1103 ("python" ,python-wrapper)))
1104 (home-page "https://libvirt.org")
1105 (synopsis "Simple API for virtualization")
1106 (description "Libvirt is a C toolkit to interact with the virtualization
1107 capabilities of recent versions of Linux. The library aims at providing long
1108 term stable C API initially for the Xen paravirtualization but should be able
1109 to integrate other virtualization mechanisms if needed.")
1110 (license license:lgpl2.1+)))
1112 (define-public libvirt-glib
1114 (name "libvirt-glib")
1118 (uri (string-append "ftp://libvirt.org/libvirt/glib/"
1119 "libvirt-glib-" version ".tar.gz"))
1122 "1zpbv4ninc57c9rw4zmmkvvqn7154iv1qfr20kyxn8xplalqrzvz"))))
1123 (build-system gnu-build-system)
1125 `(("openssl" ,openssl)
1126 ("cyrus-sasl" ,cyrus-sasl)
1127 ("lvm2" ,lvm2) ; for libdevmapper
1128 ("libyajl" ,libyajl)))
1130 `(("pkg-config" ,pkg-config)
1131 ("intltool" ,intltool)
1132 ("glib" ,glib "bin")
1135 ;; ‘Required:’ by the installed .pc files.
1137 ("libvirt" ,libvirt)
1138 ("libxml2" ,libxml2)
1139 ("gobject-introspection" ,gobject-introspection)))
1140 (home-page "https://libvirt.org")
1141 (synopsis "GLib wrapper around libvirt")
1142 (description "libvirt-glib wraps the libvirt library to provide a
1143 high-level object-oriented API better suited for glib-based applications, via
1147 @item libvirt-glib - GLib main loop integration & misc helper APIs
1148 @item libvirt-gconfig - GObjects for manipulating libvirt XML documents
1149 @item libvirt-gobject - GObjects for managing libvirt objects
1152 (license license:lgpl2.1+)))
1154 (define-public python-libvirt
1156 (name "python-libvirt")
1161 (uri (string-append "https://libvirt.org/sources/python/libvirt-python-"
1164 (base32 "0kyz3lx49d8p75mvbzinxc1zgs8g7adn77y9bm15b8b4ad9zl5s6"))))
1165 (build-system python-build-system)
1168 (modify-phases %standard-phases
1169 (add-after 'unpack 'patch-nosetests-path
1170 (lambda* (#:key inputs #:allow-other-keys)
1171 (substitute* "setup.py"
1172 (("\"/usr/bin/nosetests\"")
1173 (string-append "\"" (which "nosetests") "\""))
1174 (("self\\.spawn\\(\\[sys\\.executable, nose\\]\\)")
1175 (format #f "self.spawn([\"~a\", nose])" (which "bash"))))
1178 `(("libvirt" ,libvirt)))
1180 `(("python-lxml" ,python-lxml)))
1182 `(("pkg-config" ,pkg-config)
1183 ("python-nose" ,python-nose)))
1184 (home-page "https://libvirt.org")
1185 (synopsis "Python bindings to libvirt")
1186 (description "This package provides Python bindings to the libvirt
1187 virtualization library.")
1188 (license license:lgpl2.1+)))
1190 (define-public python2-libvirt
1191 (package-with-python2 python-libvirt))
1193 (define-public virt-manager
1195 (name "virt-manager")
1199 (uri (string-append "https://virt-manager.org/download/sources"
1200 "/virt-manager/virt-manager-"
1204 "06ws0agxlip6p6n3n43knsnjyd91gqhh2dadgc33wl9lx1k8vn6g"))))
1205 (build-system python-build-system)
1207 `(#:use-setuptools? #f ; uses custom distutils 'install' command
1208 #:test-target "test_ui"
1209 #:tests? #f ; TODO The tests currently fail
1210 ; RuntimeError: Loop condition wasn't
1212 #:imported-modules ((guix build glib-or-gtk-build-system)
1213 ,@%python-build-system-modules)
1214 #:modules ((ice-9 match)
1216 (guix build python-build-system)
1217 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
1220 (modify-phases %standard-phases
1221 (add-after 'unpack 'fix-setup
1222 (lambda* (#:key outputs #:allow-other-keys)
1223 (substitute* "virtinst/buildconfig.py"
1224 (("/usr") (assoc-ref outputs "out")))
1226 (add-after 'unpack 'fix-qemu-img-reference
1227 (lambda* (#:key inputs #:allow-other-keys)
1228 (substitute* "virtconv/formats.py"
1229 (("/usr(/bin/qemu-img)" _ suffix)
1230 (string-append (assoc-ref inputs "qemu") suffix)))
1232 (add-after 'unpack 'fix-default-uri
1233 (lambda* (#:key inputs #:allow-other-keys)
1234 ;; Xen is not available for now - so only patch qemu.
1235 (substitute* "virtManager/createconn.py"
1236 (("/usr(/bin/qemu-system)" _ suffix)
1237 (string-append (assoc-ref inputs "qemu") suffix)))
1239 (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH
1240 (lambda* (#:key inputs outputs #:allow-other-keys)
1241 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
1242 (bin-files (find-files bin ".*"))
1243 (paths (map (match-lambda
1244 ((output . directory)
1245 (let* ((girepodir (string-append
1247 "/lib/girepository-1.0")))
1248 (if (file-exists? girepodir)
1251 (for-each (lambda (file)
1252 (format #t "wrapping ~a\n" file)
1254 `("GI_TYPELIB_PATH" ":" prefix
1255 ,(filter identity paths))))
1259 (lambda* (#:key tests? #:allow-other-keys)
1261 (setenv "HOME" "/tmp")
1262 (system "Xvfb :1 &")
1263 (setenv "DISPLAY" ":1")
1264 ;; Dogtail requires that Assistive Technology support be enabled
1265 (setenv "GTK_MODULES" "gail:atk-bridge")
1266 (invoke "dbus-run-session" "--" "python" "setup.py" "test_ui"))
1268 (add-after 'install 'glib-or-gtk-compile-schemas
1269 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
1270 (add-after 'install 'glib-or-gtk-wrap
1271 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
1275 ("gtk-vnc" ,gtk-vnc)
1276 ("gtksourceview" ,gtksourceview)
1277 ("libvirt" ,libvirt)
1278 ("libvirt-glib" ,libvirt-glib)
1279 ("libosinfo" ,libosinfo)
1281 ("python-libvirt" ,python-libvirt)
1282 ("python-requests" ,python-requests)
1283 ("python-pycairo" ,python-pycairo)
1284 ("python-pygobject" ,python-pygobject)
1285 ("python-libxml2" ,python-libxml2)
1286 ("spice-gtk" ,spice-gtk)))
1287 ;; virt-manager searches for qemu-img or kvm-img in the PATH.
1291 `(("glib" ,glib "bin") ; glib-compile-schemas
1292 ("gobject-introspection" ,gobject-introspection)
1293 ("gtk+" ,gtk+ "bin") ; gtk-update-icon-cache
1294 ("perl" ,perl) ; pod2man
1295 ("intltool" ,intltool)
1296 ;; The following are required for running the tests
1297 ;; ("python-dogtail" ,python-dogtail)
1298 ;; ("xvfb" ,xorg-server-for-tests)
1300 ;; ("at-spi2-core" ,at-spi2-core)
1301 ;; ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
1303 (home-page "https://virt-manager.org/")
1304 (synopsis "Manage virtual machines")
1306 "The virt-manager application is a desktop user interface for managing
1307 virtual machines through libvirt. It primarily targets KVM VMs, but also
1308 manages Xen and LXC (Linux containers). It presents a summary view of running
1309 domains, their live performance and resource utilization statistics.")
1310 (license license:gpl2+)))
1318 (uri (string-append "https://download.openvz.org/criu/criu-"
1319 version ".tar.bz2"))
1322 "09d0j24x0cyc7wkgi7cnxqgfjk7kbdlm79zxpj8d356sa3rw2z24"))))
1323 (build-system gnu-build-system)
1325 `(#:test-target "test"
1326 #:tests? #f ; tests require mounting as root
1328 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1329 (string-append "LIBDIR=" (assoc-ref %outputs "out")
1331 (string-append "ASCIIDOC=" (assoc-ref %build-inputs "asciidoc")
1333 (string-append "XMLTO=" (assoc-ref %build-inputs "xmlto")
1336 (modify-phases %standard-phases
1338 (lambda* (#:key inputs #:allow-other-keys)
1339 ;; The includes for libnl are located in a sub-directory.
1340 (setenv "C_INCLUDE_PATH"
1341 (string-append (assoc-ref inputs "libnl")
1343 (or (getenv "C_INCLUDE_PATH") "")))
1345 (add-after 'configure 'fix-documentation
1346 (lambda* (#:key inputs outputs #:allow-other-keys)
1347 (substitute* "Documentation/Makefile"
1350 "-m custom.xsl --skip-validation -x "
1351 (assoc-ref inputs "docbook-xsl") "/xml/xsl/"
1352 ,(package-name docbook-xsl) "-"
1353 ,(package-version docbook-xsl)
1354 "/manpages/docbook.xsl")))
1356 (add-after 'unpack 'hardcode-variables
1357 (lambda* (#:key inputs #:allow-other-keys)
1358 ;; Hardcode arm version detection
1359 (substitute* "Makefile"
1360 (("ARMV.*:=.*") "ARMV := 7\n"))
1361 ;; We are currently using python-2
1362 (substitute* "crit/Makefile"
1363 (("\\$\\(PYTHON\\)") "python2"))
1364 (substitute* "lib/Makefile"
1365 (("\\$\\(PYTHON\\)")
1366 (string-append (assoc-ref inputs "python")
1369 (add-before 'build 'fix-symlink
1370 (lambda* (#:key inputs #:allow-other-keys)
1371 ;; The file 'images/google/protobuf/descriptor.proto' points to
1372 ;; /usr/include/..., which obviously does not exist.
1373 (let* ((file "google/protobuf/descriptor.proto")
1374 (target (string-append "images/" file))
1375 (source (string-append (assoc-ref inputs "protobuf")
1377 (delete-file target)
1378 (symlink source target)
1380 (add-after 'install 'wrap
1381 (lambda* (#:key inputs outputs #:allow-other-keys)
1382 ;; Make sure 'crit' runs with the correct PYTHONPATH.
1383 (let* ((out (assoc-ref outputs "out"))
1384 (path (string-append out
1386 (string-take (string-take-right
1387 (assoc-ref inputs "python") 5) 3)
1389 (getenv "PYTHONPATH"))))
1390 (wrap-program (string-append out "/bin/crit")
1391 `("PYTHONPATH" ":" prefix (,path))))
1394 `(("protobuf" ,protobuf)
1395 ("python" ,python-2)
1396 ("python2-protobuf" ,python2-protobuf)
1397 ("python2-ipaddr" ,python2-ipaddr)
1398 ("iproute" ,iproute)
1404 ("nftables" ,nftables)))
1406 `(("pkg-config" ,pkg-config)
1408 ("protobuf-c" ,protobuf-c)
1409 ("asciidoc" ,asciidoc)
1411 ("docbook-xml" ,docbook-xml)
1412 ("docbook-xsl" ,docbook-xsl)))
1413 (home-page "https://criu.org")
1414 (synopsis "Checkpoint and restore in user space")
1415 (description "Using this tool, you can freeze a running application (or
1416 part of it) and checkpoint it to a hard drive as a collection of files. You
1417 can then use the files to restore and run the application from the point it
1418 was frozen at. The distinctive feature of the CRIU project is that it is
1419 mainly implemented in user space.")
1420 ;; The project is licensed under GPLv2; files in the lib/ directory are
1422 (license (list license:gpl2 license:lgpl2.1))))
1424 (define-public qmpbackup
1431 (url "https://github.com/abbbi/qmpbackup")
1433 (file-name (git-file-name name version))
1436 "0swhp5byz44brhyis1a39p11fyn9q84xz5q6v2fah29r7d71kmmx"))))
1437 (build-system python-build-system)
1439 `(#:python ,python-2))
1440 (home-page "https://github.com/abbbi/qmpbackup")
1441 (synopsis "Backup and restore QEMU machines")
1442 (description "qmpbackup is designed to create and restore full and
1443 incremental backups of running QEMU virtual machines via QMP, the QEMU
1445 (license license:gpl3+)))
1447 (define-public looking-glass-client
1448 (let ((commit "182c4752d57690da7f99d5e788de9b8baea33895"))
1450 (name "looking-glass-client")
1451 (version (string-append "a12-" (string-take commit 7)))
1455 (uri (git-reference (url "https://github.com/gnif/LookingGlass")
1457 (file-name (git-file-name name version))
1460 "02bq46ndmzq9cihazzn7xq1x7q5nzm7iw4l9lqzihxcxp9famkhw"))
1461 (modules '((guix build utils)))
1464 ;; Do not create binaries optimized for the CPU of the build machine,
1465 ;; for reproducibility and compatibility. TODO: in the next version
1466 ;; of looking glass, this is exposed as a CMake configure option.
1467 (substitute* "client/CMakeLists.txt"
1471 (build-system cmake-build-system)
1472 (inputs `(("fontconfig" ,fontconfig)
1475 ("openssl" ,openssl)
1477 ("sdl2-ttf" ,sdl2-ttf)
1478 ("spice-protocol" ,spice-protocol)
1479 ("wayland" ,wayland)))
1480 (native-inputs `(("libconfig" ,libconfig)
1482 ("pkg-config" ,pkg-config)))
1484 `(#:tests? #f ;; No tests are available.
1485 #:make-flags '("CC=gcc")
1486 #:phases (modify-phases %standard-phases
1487 (add-before 'configure 'chdir-to-client
1488 (lambda* (#:key outputs #:allow-other-keys)
1491 (add-after 'chdir-to-client 'add-missing-include
1493 ;; Mimic upstream commit b9797529893, required since the
1494 ;; update to Mesa 19.2.
1495 (substitute* "renderers/egl/shader.h"
1496 (("#include <stdbool\\.h>")
1497 "#include <stdbool.h>\n#include <stddef.h>"))
1500 (lambda* (#:key outputs #:allow-other-keys)
1501 (install-file "looking-glass-client"
1502 (string-append (assoc-ref outputs "out")
1505 (home-page "https://looking-glass.hostfission.com")
1506 (synopsis "KVM Frame Relay (KVMFR) implementation")
1507 (description "Looking Glass allows the use of a KVM (Kernel-based Virtual
1508 Machine) configured for VGA PCI Pass-through without an attached physical
1509 monitor, keyboard or mouse. It displays the VM's rendered contents on your main
1511 ;; This package requires SSE instructions.
1512 (supported-systems '("i686-linux" "x86_64-linux"))
1513 (license license:gpl2+))))
1518 (version "1.0.0-rc6")
1522 "https://github.com/opencontainers/runc/releases/"
1523 "download/v" version "/runc.tar.xz"))
1524 (file-name (string-append name "-" version ".tar.xz"))
1525 (patches (search-patches "runc-CVE-2019-5736.patch"))
1528 "1c7832dq70slkjh8qp2civ1wxhhdd2hrx84pq7db1mmqc9fdr3cc"))))
1529 (build-system go-build-system)
1531 '(#:import-path "github.com/opencontainers/runc"
1532 #:install-source? #f
1533 ;; XXX: 20/139 tests fail due to missing /var, cgroups and apparmor in
1534 ;; the build environment.
1537 (modify-phases %standard-phases
1539 (lambda* (#:key source import-path #:allow-other-keys)
1540 ;; Unpack the tarball into 'runc' instead of 'runc-1.0.0-rc5'.
1541 (let ((dest (string-append "src/" import-path)))
1543 (invoke "tar" "-C" (string-append "src/" import-path)
1544 "--strip-components=1"
1547 (lambda* (#:key import-path #:allow-other-keys)
1548 (with-directory-excursion (string-append "src/" import-path)
1549 ;; XXX: requires 'go-md2man'.
1550 ;; (invoke "make" "man")
1554 ;; (invoke "make" "localunittest")))
1556 (lambda* (#:key import-path outputs #:allow-other-keys)
1557 (with-directory-excursion (string-append "src/" import-path)
1558 (let ((out (assoc-ref outputs "out")))
1559 (invoke "make" "install" "install-bash"
1560 (string-append "PREFIX=" out)))))))))
1562 `(("pkg-config" ,pkg-config)))
1564 `(("libseccomp" ,libseccomp)))
1565 (synopsis "Open container initiative runtime")
1566 (home-page "https://www.opencontainers.org/")
1568 "@command{runc} is a command line client for running applications
1569 packaged according to the
1570 @uref{https://github.com/opencontainers/runtime-spec/blob/master/spec.md, Open
1571 Container Initiative (OCI) format} and is a compliant implementation of the
1572 Open Container Initiative specification.")
1573 (license license:asl2.0)))
1575 (define-public umoci
1583 "https://github.com/opencontainers/umoci/releases/download/v"
1584 version "/umoci.tar.xz"))
1585 (file-name (string-append "umoci-" version ".tar.xz"))
1587 (base32 "06q7xfwnqysc013hapx31jhlzmyg8qb467qfkynj673qc7p9bd6h"))))
1588 (build-system go-build-system)
1590 '(#:import-path "github.com/opencontainers/umoci"
1591 #:install-source? #f
1593 (modify-phases %standard-phases
1595 (lambda* (#:key source import-path #:allow-other-keys)
1596 ;; Unpack the tarball into 'umoci' instead of "runc-${version}".
1597 (let ((dest (string-append "src/" import-path)))
1599 (invoke "tar" "-C" (string-append "src/" import-path)
1600 "--strip-components=1"
1603 (lambda* (#:key import-path #:allow-other-keys)
1604 (with-directory-excursion (string-append "src/" import-path)
1605 ;; TODO: build manpages with 'go-md2man'.
1606 (invoke "make" "SHELL=bash"))))
1608 (lambda* (#:key import-path outputs #:allow-other-keys)
1609 (let* ((out (assoc-ref outputs "out"))
1610 (bindir (string-append out "/bin")))
1611 (install-file (string-append "src/" import-path "/umoci")
1614 (home-page "https://umo.ci/")
1615 (synopsis "Tool for modifying Open Container images")
1617 "@command{umoci} is a tool that allows for high-level modification of an
1618 Open Container Initiative (OCI) image layout and its tagged images.")
1619 (license license:asl2.0)))
1621 (define-public skopeo
1628 (url "https://github.com/containers/skopeo")
1629 (commit (string-append "v" version))))
1630 (file-name (git-file-name name version))
1633 "1y9pmijazbgxzriymrm7zrifmkd1x1wad9b3zjcj7zwr6c999dhg"))))
1634 (build-system go-build-system)
1636 `(("pkg-config" ,pkg-config)
1637 ("go-github-com-go-md2man" ,go-github-com-go-md2man)))
1639 `(("btrfs-progs" ,btrfs-progs)
1641 ("libassuan" ,libassuan)
1642 ("libselinux" ,libselinux)
1643 ("libostree" ,libostree)
1648 '(#:import-path "github.com/containers/skopeo"
1649 #:install-source? #f
1650 #:tests? #f ; The tests require Docker
1652 (modify-phases %standard-phases
1654 (lambda* (#:key import-path #:allow-other-keys)
1655 (with-directory-excursion (string-append "src/" import-path)
1656 (invoke "make" "bin/skopeo"))))
1657 (add-after 'build 'build-docs
1658 (lambda* (#:key import-path #:allow-other-keys)
1659 (with-directory-excursion (string-append "src/" import-path)
1660 (invoke "make" "docs"))))
1662 (lambda* (#:key import-path outputs #:allow-other-keys)
1663 (with-directory-excursion (string-append "src/" import-path)
1664 (let ((out (assoc-ref outputs "out")))
1665 (install-file "default-policy.json"
1666 (string-append out "/etc/containers"))
1667 (invoke "make" "install-binary" "install-completions" "install-docs"
1668 (string-append "PREFIX=" out)))))))))
1669 (home-page "https://github.com/containers/skopeo")
1670 (synopsis "Interact with container images and container image registries")
1672 "@command{skopeo} is a command line utility providing various operations
1673 with container images and container image registries. It can:
1676 @item Copy container images between various containers image stores,
1677 converting them as necessary.
1679 @item Convert a Docker schema 2 or schema 1 container image to an OCI image.
1681 @item Inspect a repository on a container registry without needlessly pulling
1684 @item Sign and verify container images.
1686 @item Delete container images from a remote container registry.
1689 (license license:asl2.0)))
1691 (define-public python-vagrant
1693 (name "python-vagrant")
1698 (uri (pypi-uri "python-vagrant" version))
1701 "1ikrh6canhcxg5y7pzmkcnnydikppv7s6sm9prfx90nk0ac8m6mg"))))
1702 (build-system python-build-system)
1704 '(#:tests? #f)) ; tests involve running vagrant.
1705 (home-page "https://github.com/todddeluca/python-vagrant")
1706 (synopsis "Python bindings for Vagrant")
1708 "Python-vagrant is a Python module that provides a thin wrapper around the
1709 @code{vagrant} command line executable, allowing programmatic control of Vagrant
1711 (license license:expat)))
1713 (define-public bubblewrap
1719 (uri (string-append "https://github.com/containers/bubblewrap/"
1720 "releases/download/v" version "/bubblewrap-"
1724 "00ycgi6q2yngh06bnz50wkvar6r2jnjf3j158grhi9k13jdrpimr"))))
1725 (build-system gnu-build-system)
1728 (modify-phases %standard-phases
1729 (add-after 'unpack 'fix-test
1730 (lambda* (#:key outputs #:allow-other-keys)
1731 ;; Tests try to access /var/tmp, which is not possible in our build
1732 ;; environment. Let's give them another directory.
1733 ;; /tmp gets overriden in some tests, so we need another directory.
1734 ;; the only possibility is the output directory.
1735 (let ((tmp-dir (string-append (assoc-ref outputs "out") "/tmp")))
1737 (substitute* "tests/test-run.sh"
1738 (("/var/tmp") tmp-dir)
1739 ;; Tests create a temporary python script, so fix its shebang.
1740 (("/usr/bin/env python") (which "python"))
1741 ;; Some tests try to access /usr, but that doesn't exist.
1742 ;; Give them /gnu instead.
1744 (("--ro-bind /bin /bin") "--ro-bind /gnu /bin")
1745 (("--ro-bind /sbin /sbin") "--ro-bind /gnu /sbin")
1746 (("--ro-bind /lib /lib") "--ro-bind /gnu /lib")
1747 ((" */bin/bash") (which "bash"))
1748 (("/bin/sh") (which "sh"))
1749 (("findmnt") (which "findmnt"))))
1751 ;; Remove the directory we gave to tests to have a clean package.
1752 (add-after 'check 'remove-tmp-dir
1753 (lambda* (#:key outputs #:allow-other-keys)
1754 (delete-file-recursively (string-append (assoc-ref outputs "out") "/tmp"))
1757 `(("libcap" ,libcap)))
1759 `(("python" ,python-wrapper)
1760 ("util-linux" ,util-linux)))
1761 (home-page "https://github.com/containers/bubblewrap")
1762 (synopsis "Unprivileged sandboxing tool")
1763 (description "Bubblewrap is aimed at running applications in a sandbox,
1764 restricting their access to parts of the operating system or user data such as
1765 the home directory. Bubblewrap always creates a new mount namespace, and the
1766 user can specify exactly what parts of the file system should be made visible
1767 in the sandbox. These directories are mounted with the @code{nodev} option
1768 by default and can be made read-only.")
1769 (license license:lgpl2.0+)))
1771 (define-public bochs
1778 (uri (string-append "https://sourceforge.net/projects/bochs/files/bochs/"
1779 version "/bochs-" version ".tar.gz"))
1781 (base32 "0ql8q6y1k356li1g9gbvl21448mlxphxxi6kjb2b3pxvzd0pp2b3"))))
1782 (build-system gnu-build-system)
1784 `(#:tests? #f)) ; no tests exist
1786 `(("libxrandr" ,libxrandr)))
1787 (home-page "http://bochs.sourceforge.net/")
1788 (synopsis "Emulator for x86 PC")
1790 "Bochs is an emulator which can emulate Intel x86 CPU, common I/O
1791 devices, and a custom BIOS. It can also be compiled to emulate many different
1792 x86 CPUs, from early 386 to the most recent x86-64 Intel and AMD processors.
1793 Bochs can run most Operating Systems inside the emulation including Linux,
1794 DOS or Microsoft Windows.")
1795 (license license:lgpl2.0+)))
1804 (url "git://xenbits.xenproject.org/xen.git")
1805 (commit (string-append "RELEASE-" version))))
1806 (file-name (git-file-name name version))
1809 "1r90rvypw76ya9clqw5p02gm1k8hxz73f7gr95ca778nnzvb7xjw"))))
1810 (build-system gnu-build-system)
1813 (list "--enable-rpath"
1814 "--disable-qemu-traditional" ; It tries to do "git clone"
1815 "--disable-rombios" ; would try to "git clone" via etherboot.
1816 ;; TODO: Re-enable stubdom (it's "more secure" to use it).
1817 "--disable-stubdom" ; tries to "git clone" old patched newlib.
1818 (string-append "--with-initddir="
1819 (assoc-ref %outputs "out")
1821 (string-append "--with-system-qemu="
1822 (assoc-ref %build-inputs "qemu")
1823 "/bin/qemu-system-i386")
1824 (string-append "--with-system-seabios="
1825 (assoc-ref %build-inputs "seabios")
1826 "/share/firmware/bios.bin")
1827 (string-append "--with-system-ovmf="
1828 (assoc-ref %build-inputs "ovmf")
1829 "/share/firmware/ovmf_ia32.bin"))
1830 #:make-flags (list "-j" "1"
1831 "XEN_BUILD_DATE=Thu Jan 1 01:00:01 CET 1970"
1832 "XEN_BUILD_TIME=01:00:01"
1835 "SMBIOS_REL_DATE=01/01/1970"
1836 "VGABIOS_REL_DATE=01 Jan 1970"
1837 ; QEMU_TRADITIONAL_LOC
1839 "SYSCONFIG_DIR=/tmp/etc/default"
1840 (string-append "BASH_COMPLETION_DIR="
1841 (assoc-ref %outputs "out")
1842 "/etc/bash_completion.d")
1843 (string-append "BOOT_DIR="
1844 (assoc-ref %outputs "out")
1846 (string-append "DEBUG_DIR="
1847 (assoc-ref %outputs "out")
1849 (string-append "EFI_DIR="
1850 (assoc-ref %outputs "out")
1851 "/lib/efi") ; TODO lib64 ?
1852 "MINIOS_UPSTREAM_URL="
1853 ;(string-append "DISTDIR="
1854 ; (assoc-ref %outputs "out"))
1856 #:test-target "test"
1858 (modify-phases %standard-phases
1859 (add-after 'unpack 'unpack-mini-os
1860 (lambda* (#:key inputs #:allow-other-keys)
1861 (copy-recursively (assoc-ref inputs "mini-os") "extras/mini-os")
1863 (add-after 'unpack-mini-os 'patch
1864 (lambda* (#:key inputs outputs #:allow-other-keys)
1865 (substitute* "tools/firmware/Rules.mk"
1866 (("override XEN_TARGET_ARCH = x86_32")
1867 (string-append "override XEN_TARGET_ARCH = x86_32
1868 override CC = " (assoc-ref inputs "cross-gcc") "/bin/i686-linux-gnu-gcc"))
1870 (string-append "CFLAGS=-I" (assoc-ref inputs "cross-libc")
1872 (substitute* "config/x86_32.mk"
1873 (("CFLAGS += -m32 -march=i686")
1874 (string-append "CFLAGS += -march=i686 -I"
1875 (assoc-ref inputs "cross-libc")
1877 ;; /var is not in /gnu/store , so don't try to create it.
1878 (substitute* '("tools/Makefile"
1879 "tools/xenstore/Makefile"
1880 "tools/xenpaging/Makefile")
1881 (("\\$\\(INSTALL_DIR\\) .*XEN_(DUMP|LOG|RUN|LIB|PAGING)_DIR.*")
1883 (("\\$\\(INSTALL_DIR\\) .*XEN_(RUN|LIB)_STORED.*")
1885 ;; Prevent xen from creating /etc .
1886 (substitute* "tools/examples/Makefile"
1887 ((" install-readmes") "")
1888 ((" install-configs") ""))
1890 (substitute* "tools/pygrub/setup.py"
1892 ; TODO: extra_link_args = ['-Wl,-rpath=/opt/foo'],
1893 (string-append "runtime_library_dirs = ['"
1894 (assoc-ref outputs "out")
1895 "/lib'],\nlibrary_dirs =")))
1897 (add-before 'configure 'patch-xen-script-directory
1898 (lambda* (#:key outputs #:allow-other-keys)
1899 (substitute* '("configure"
1902 (("XEN_SCRIPT_DIR=.*")
1903 (string-append "XEN_SCRIPT_DIR="
1904 (assoc-ref outputs "out")
1905 "/etc/xen/scripts")))
1907 (add-before 'configure 'set-environment-up
1908 (lambda* (#:key make-flags #:allow-other-keys)
1910 (string-contains x "cross-i686-linux"))
1911 (define (filter-environment! filter-predicate
1912 environment-variable-names)
1915 (let* ((env-value (getenv env-name))
1916 (search-path (search-path-as-string->list env-value))
1917 (new-search-path (filter filter-predicate
1919 (new-env-value (list->search-path-as-string
1920 new-search-path ":")))
1921 (setenv env-name new-env-value)))
1922 environment-variable-names))
1923 (setenv "CROSS_C_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))
1924 (setenv "CROSS_CPLUS_INCLUDE_PATH" (getenv "CPLUS_INCLUDE_PATH"))
1925 (setenv "CROSS_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
1926 (filter-environment! cross?
1927 '("CROSS_C_INCLUDE_PATH" "CROSS_CPLUS_INCLUDE_PATH"
1928 "CROSS_LIBRARY_PATH"))
1929 (filter-environment! (lambda (e) (not (cross? e)))
1930 '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH"
1932 ;; Guix tries to be helpful and automatically adds
1933 ;; mini-os-git-checkout/include to the include path,
1934 ;; but actually we don't want it to be there (yet).
1935 (filter-environment! (lambda (e)
1938 "mini-os-git-checkout")))
1939 '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH"
1941 (setenv "EFI_VENDOR" "guix")
1944 (lambda* (#:key make-flags #:allow-other-keys)
1945 (apply invoke "make" "world" make-flags))))))
1947 `(("acpica" ,acpica) ; TODO: patch iasl invocation.
1948 ("bridge-utils" ,bridge-utils) ; TODO: patch invocations.
1950 ("iproute" ,iproute) ; TODO: patch invocations.
1953 ("libyajl" ,libyajl)
1954 ("ncurses" ,ncurses)
1955 ("openssl" ,openssl)
1958 ("qemu" ,qemu-minimal)
1959 ("seabios" ,seabios)
1960 ("util-linux" ,util-linux "lib") ; uuid
1961 ; TODO: ocaml-findlib, ocaml-nox.
1962 ("xz" ,xz) ; for liblzma
1967 ("cmake" ,cmake-minimal)
1970 ("gettext" ,gettext-minimal)
1976 (url "http://xenbits.xen.org/git-http/mini-os.git")
1977 (commit (string-append "xen-RELEASE-" version))))
1980 "1i8pcl19n60i2m9vlg79q3nknpj209c9ic5x10wxaicx45kc107f"))
1981 (file-name "mini-os-git-checkout")))
1984 ("pkg-config" ,pkg-config)
1985 ("python" ,python-2)
1987 ("cross-gcc" ,(cross-gcc "i686-linux-gnu"
1988 #:xbinutils (cross-binutils "i686-linux-gnu")
1989 #:libc (cross-libc "i686-linux-gnu")))
1990 ("cross-libc" ,(cross-libc "i686-linux-gnu")) ; header files
1991 ("cross-libc-static" ,(cross-libc "i686-linux-gnu") "static")))
1992 (home-page "https://xenproject.org/")
1993 (synopsis "Xen Virtual Machine Monitor")
1994 (description "This package provides the Xen Virtual Machine Monitor
1995 which is a hypervisor.")
1996 ;; TODO: Some files are licensed differently. List those.
1997 (license license:gpl2)
1998 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))))
2000 (define-public osinfo-db-tools
2002 (name "osinfo-db-tools")
2006 (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-tools-"
2011 "038q3gzdbkfkhpicj0755mw1q4gbvn57pslpw8n2dp3lds9im0g9"))))
2012 (build-system meson-build-system)
2014 `(("libsoup" ,libsoup)
2015 ("libxml2" ,libxml2)
2016 ("libxslt" ,libxslt)
2017 ("json-glib" ,json-glib)
2018 ("libarchive" ,libarchive)))
2021 ("gobject-introspection" ,gobject-introspection)
2022 ("gettext" ,gettext-minimal)
2023 ("pkg-config" ,pkg-config)
2026 ("pytest" ,python-pytest)
2027 ("requests" ,python-requests)))
2028 (home-page "https://gitlab.com/libosinfo/osinfo-db-tools")
2029 (synopsis "Tools for managing the osinfo database")
2030 (description "This package contains a set of tools to assist
2031 administrators and developers in managing the database.")
2032 (license license:lgpl2.0+)))
2034 (define-public osinfo-db
2037 (version "20201218")
2040 (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-"
2044 "0ydbindwgw7kg861rqii5036gq0dbbbmv35dzrmmv937ddfsxwh0"))))
2045 (build-system trivial-build-system)
2047 `(#:modules ((guix build utils))
2050 (use-modules (guix build utils))
2051 (let* ((out (assoc-ref %outputs "out"))
2052 (osinfo-dir (string-append out "/share/osinfo"))
2053 (source (assoc-ref %build-inputs "source"))
2055 (string-append (assoc-ref %build-inputs "osinfo-db-tools")
2056 "/bin/osinfo-db-import")))
2057 (mkdir-p osinfo-dir)
2058 (invoke osinfo-db-import "--dir" osinfo-dir source)
2061 `(("intltool" ,intltool)
2062 ("osinfo-db-tools" ,osinfo-db-tools)))
2063 (home-page "https://gitlab.com/libosinfo/osinfo-db")
2064 (synopsis "Database of information about operating systems")
2065 (description "Osinfo-db provides the database files for use with the
2066 libosinfo library. It provides information about guest operating systems for
2067 use with virtualization provisioning tools")
2068 (license license:lgpl2.0+)))
2070 (define-public python-transient
2072 (name "python-transient")
2077 (uri (pypi-uri "transient" version))
2080 "148yiqrmcscsi6787y0f27i1y9cf0gcw3mqfv5frhpmsmv62mv5z"))))
2081 (build-system python-build-system)
2083 `(#:tests? #f ; Requires behave
2084 #:phases (modify-phases %standard-phases
2085 (add-after 'unpack 'fix-dependencies
2087 (substitute* "setup.py"
2092 `(("python-beautifultable" ,python-beautifultable)
2093 ("python-click" ,python-click)
2094 ("python-importlib-resources"
2095 ,python-importlib-resources)
2096 ("python-lark-parser" ,python-lark-parser)
2097 ("python-marshmallow" ,python-marshmallow)
2098 ("python-progressbar2" ,python-progressbar2)
2099 ("python-requests" ,python-requests)
2100 ("python-toml" ,python-toml)))
2102 `(("python-black" ,python-black)
2103 ("python-mypy" ,python-mypy)
2104 ("python-pyhamcrest" ,python-pyhamcrest)
2105 ("python-twine" ,python-twine)))
2107 "https://github.com/ALSchwalm/transient")
2109 "QEMU Wrapper written in Python")
2111 "@code{transient} is a wrapper for QEMU allowing the creation of virtual
2112 machines with shared folder, ssh, and disk creation support.")
2113 (license license:expat)))