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, 2018, 2019, 2020 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>
20 ;;; This file is part of GNU Guix.
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35 (define-module (gnu packages virtualization)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages admin)
38 #:use-module (gnu packages assembly)
39 #:use-module (gnu packages attr)
40 #:use-module (gnu packages autotools)
41 #:use-module (gnu packages backup)
42 #:use-module (gnu packages base)
43 #:use-module (gnu packages bison)
44 #:use-module (gnu packages check)
45 #:use-module (gnu packages cmake)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages cross-base)
48 #:use-module (gnu packages curl)
49 #:use-module (gnu packages cyrus-sasl)
50 #:use-module (gnu packages debian)
51 #:use-module (gnu packages disk)
52 #:use-module (gnu packages dns)
53 #:use-module (gnu packages docbook)
54 #:use-module (gnu packages documentation)
55 #:use-module (gnu packages figlet)
56 #:use-module (gnu packages firmware)
57 #:use-module (gnu packages flex)
58 #:use-module (gnu packages fontutils)
59 #:use-module (gnu packages freedesktop)
60 #:use-module (gnu packages gettext)
61 #:use-module (gnu packages gl)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages gnome)
64 #:use-module (gnu packages gnupg)
65 #:use-module (gnu packages golang)
66 #:use-module (gnu packages graphviz)
67 #:use-module (gnu packages gtk)
68 #:use-module (gnu packages haskell)
69 #:use-module (gnu packages haskell-apps)
70 #:use-module (gnu packages haskell-check)
71 #:use-module (gnu packages haskell-crypto)
72 #:use-module (gnu packages haskell-web)
73 #:use-module (gnu packages haskell-xyz)
74 #:use-module (gnu packages image)
75 #:use-module (gnu packages libbsd)
76 #:use-module (gnu packages libusb)
77 #:use-module (gnu packages linux)
78 #:use-module (gnu packages m4)
79 #:use-module (gnu packages ncurses)
80 #:use-module (gnu packages nettle)
81 #:use-module (gnu packages networking)
82 #:use-module (gnu packages onc-rpc)
83 #:use-module (gnu packages package-management)
84 #:use-module (gnu packages perl)
85 #:use-module (gnu packages pkg-config)
86 #:use-module (gnu packages polkit)
87 #:use-module (gnu packages protobuf)
88 #:use-module (gnu packages python)
89 #:use-module (gnu packages python-crypto)
90 #:use-module (gnu packages python-web)
91 #:use-module (gnu packages python-xyz)
92 #:use-module (gnu packages pulseaudio)
93 #:use-module (gnu packages selinux)
94 #:use-module (gnu packages sdl)
95 #:use-module (gnu packages sphinx)
96 #:use-module (gnu packages spice)
97 #:use-module (gnu packages ssh)
98 #:use-module (gnu packages texinfo)
99 #:use-module (gnu packages textutils)
100 #:use-module (gnu packages tls)
101 #:use-module (gnu packages web)
102 #:use-module (gnu packages wget)
103 #:use-module (gnu packages xdisorg)
104 #:use-module (gnu packages xml)
105 #:use-module (gnu packages xorg)
106 #:use-module (guix build-system cmake)
107 #:use-module (guix build-system gnu)
108 #:use-module (guix build-system go)
109 #:use-module (guix build-system meson)
110 #:use-module (guix build-system python)
111 #:use-module (guix build-system trivial)
112 #:use-module (guix download)
113 #:use-module (guix git-download)
114 #:use-module ((guix licenses) #:prefix license:)
115 #:use-module (guix packages)
116 #:use-module (guix utils)
117 #:use-module (srfi srfi-1)
118 #:use-module (ice-9 match))
120 (define (qemu-patch commit file-name sha256-bv)
121 "Return an origin for COMMIT."
125 "http://git.qemu.org/?p=qemu.git;a=commitdiff_plain;h="
127 (hash (content-hash sha256-bv sha256))
128 (file-name file-name)))
136 (uri (string-append "https://download.qemu.org/qemu-"
140 "1rd41wwlvp0vpialjp2czs6i3lsc338xc72l3zkbb7ixjfslw5y9"))
141 (patches (search-patches "qemu-build-info-manual.patch"))))
142 (outputs '("out" "doc")) ;4.7 MiB of HTML docs
143 (build-system gnu-build-system)
145 `(;; FIXME: Disable tests on i686 to work around
146 ;; <https://bugs.gnu.org/40527>.
147 #:tests? ,(or (%current-target-system)
148 (not (string=? "i686-linux" (%current-system))))
150 #:configure-flags (list "--enable-usb-redir" "--enable-opengl"
152 (string-append "--smbd="
153 (assoc-ref %outputs "out")
154 "/libexec/samba-wrapper")
155 "--audio-drv-list=alsa,pa,sdl")
156 ;; Make build and test output verbose to facilitate investigation upon failure.
157 #:make-flags '("V=1")
158 #:modules ((srfi srfi-1)
160 ,@%gnu-build-system-modules)
162 (modify-phases %standard-phases
163 (add-after 'set-paths 'hide-glibc
164 (lambda* (#:key inputs #:allow-other-keys)
165 ;; Work around https://issues.guix.info/issue/36882. We need to
166 ;; remove glibc from C_INCLUDE_PATH so that the one hardcoded in GCC,
167 ;; at the bottom of GCC include search-path is used.
168 (let* ((filters '("libc"))
170 (filter-map (lambda (input)
173 (and (not (member name filters))
176 (set-path-environment-variable "C_INCLUDE_PATH"
180 (add-after 'unpack 'disable-unusable-tests
182 (substitute* "tests/Makefile.include"
183 ;; Comment out the test-qga test, which needs /sys and
184 ;; fails within the build environment.
185 (("check-unit-.* tests/test-qga" all)
186 (string-append "# " all))
187 ;; Comment out the test-char test, which needs networking and
188 ;; fails within the build environment.
189 (("check-unit-.* tests/test-char" all)
190 (string-append "# " all)))
191 (substitute* "tests/qtest/Makefile.include"
192 ;; Disable the following test, which triggers a crash on some
193 ;; x86 CPUs (see https://issues.guix.info/43048 and
194 ;; https://bugs.launchpad.net/qemu/+bug/1896263).
195 (("check-qtest-i386-y \\+= bios-tables-test" all)
196 (string-append "# " all)))
198 (add-after 'patch-source-shebangs 'patch-/bin/sh-references
200 ;; Ensure the executables created by these source files reference
201 ;; /bin/sh from the store so they work inside the build container.
202 (substitute* '("block/cloop.c" "migration/exec.c"
203 "net/tap.c" "tests/qtest/libqtest.c")
204 (("/bin/sh") (which "sh")))
207 (lambda* (#:key inputs outputs (configure-flags '())
209 ;; The `configure' script doesn't understand some of the
210 ;; GNU options. Thus, add a new phase that's compatible.
211 (let ((out (assoc-ref outputs "out")))
212 (setenv "SHELL" (which "bash"))
214 ;; While we're at it, patch for tests.
215 (substitute* "tests/qemu-iotests/check"
216 (("#!/usr/bin/env python3")
217 (string-append "#!" (which "python3"))))
219 ;; Ensure config.status gets the correct shebang off the bat.
220 ;; The build system gets confused if we change it later and
221 ;; attempts to re-run the whole configury, and fails.
222 (substitute* "configure"
224 (string-append "#!" (which "sh"))))
226 ;; The binaries need to be linked against -lrt.
227 (setenv "LDFLAGS" "-lrt")
230 ,(string-append "--cc=" (which "gcc"))
231 ;; Some architectures insist on using HOST_CC
232 ,(string-append "--host-cc=" (which "gcc"))
233 "--disable-debug-info" ; save build space
234 "--enable-virtfs" ; just to be sure
235 ,(string-append "--prefix=" out)
236 ,(string-append "--sysconfdir=/etc")
237 ,@configure-flags)))))
238 ;; Create a wrapper for Samba. This allows QEMU to use Samba without
239 ;; pulling it in as an input. Note that you need to explicitly install
240 ;; Samba in your Guix profile for Samba support.
241 (add-after 'install 'create-samba-wrapper
242 (lambda* (#:key inputs outputs #:allow-other-keys)
243 (let* ((out (assoc-ref outputs "out"))
244 (libexec (string-append out "/libexec")))
245 (call-with-output-file "samba-wrapper"
247 (format port "#!/bin/sh
249 (chmod "samba-wrapper" #o755)
250 (install-file "samba-wrapper" libexec))
252 (add-after 'install 'move-html-doc
253 (lambda* (#:key inputs outputs #:allow-other-keys)
254 (let* ((out (assoc-ref outputs "out"))
255 (doc (assoc-ref outputs "doc"))
256 (qemu-doc (string-append doc "/share/doc/qemu-" ,version)))
258 (rename-file (string-append out "/share/doc/qemu")
259 (string-append qemu-doc "/html")))
261 (inputs ; TODO: Add optional inputs.
262 `(("alsa-lib" ,alsa-lib)
268 ("libcacard" ,libcacard) ; smartcard support
269 ("libcap-ng" ,libcap-ng) ; virtfs support requires libcap-ng & libattr
271 ("libepoxy" ,libepoxy)
272 ("libjpeg" ,libjpeg-turbo)
274 ("libseccomp" ,libseccomp)
275 ("libusb" ,libusb) ;USB pass-through support
278 ;; ("pciutils" ,pciutils)
280 ("pulseaudio" ,pulseaudio)
283 ("usbredir" ,usbredir)
284 ("util-linux" ,util-linux)
286 ("virglrenderer" ,virglrenderer)
288 (native-inputs `(("gettext" ,gettext-minimal)
289 ("glib:bin" ,glib "bin") ; gtester, etc.
293 ("pkg-config" ,pkg-config)
294 ("python-wrapper" ,python-wrapper)
295 ("python-sphinx" ,python-sphinx)
296 ("texinfo" ,texinfo)))
297 (home-page "https://www.qemu.org")
298 (synopsis "Machine emulator and virtualizer")
300 "QEMU is a generic machine emulator and virtualizer.
302 When used as a machine emulator, QEMU can run OSes and programs made for one
303 machine (e.g. an ARM board) on a different machine---e.g., your own PC. By
304 using dynamic translation, it achieves very good performance.
306 When used as a virtualizer, QEMU achieves near native performances by
307 executing the guest code directly on the host CPU. QEMU supports
308 virtualization when executing under the Xen hypervisor or using
309 the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86,
310 server and embedded PowerPC, and S390 guests.")
312 ;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'.
313 (license license:gpl2)
315 ;; Several tests fail on MIPS; see <http://hydra.gnu.org/build/117914>.
316 (supported-systems (fold delete %supported-systems
317 '("mips64el-linux" "i586-gnu")))))
319 (define-public qemu-minimal
320 ;; QEMU without GUI support, only supporting the host's architecture
321 (package (inherit qemu)
322 (name "qemu-minimal")
324 "Machine emulator and virtualizer (without GUI) for the host architecture")
326 (substitute-keyword-arguments (package-arguments qemu)
327 ((#:configure-flags _ '(list))
328 ;; Restrict to the host's architecture.
329 (match (car (string-split (or (%current-target-system)
333 '(list "--target-list=i386-softmmu"))
335 '(list "--target-list=i386-softmmu,x86_64-softmmu"))
337 '(list (string-append "--target-list=mips-softmmu,mipsel-softmmu,"
338 "mips64-softmmu,mips64el-softmmu")))
340 '(list "--target-list=mips-softmmu,mipsel-softmmu"))
342 '(list "--target-list=arm-softmmu,aarch64-softmmu"))
344 '(list "--target-list=arm-softmmu"))
346 '(list "--target-list=alpha-softmmu"))
348 '(list "--target-list=ppc-softmmu,ppc64-softmmu"))
350 '(list "--target-list=ppc-softmmu"))
352 '(list "--target-list=s390x-softmmu"))
354 '(list "--target-list=riscv32-softmmu,riscv64-softmmu"))
355 (else ; An empty list actually builds all the targets.
358 ;; Remove dependencies on optional libraries, notably GUI libraries.
359 (native-inputs (fold alist-delete (package-native-inputs qemu)
361 (inputs (fold alist-delete (package-inputs qemu)
362 '("libusb" "mesa" "sdl2" "spice" "virglrenderer" "gtk+"
363 "usbredir" "libdrm" "libepoxy" "pulseaudio" "vde2"
366 (define (system->qemu-target system)
368 ((string-prefix? "i686" system)
370 ((string-prefix? "arm" system)
373 (string-append "qemu-system-" (match (string-split system #\-)
377 (define-public ganeti
380 ;; Note: we use a pre-release for Python 3 compatibility as well as many
382 (version "3.0.0beta1-24-g024cc9fa2")
386 (url "https://github.com/ganeti/ganeti")
387 (commit (string-append "v" version))))
389 (base32 "1ll34qd2mifni3bhg7cnir3xfnkafig8ch33qndqwrsby0y5ssia"))
390 (file-name (git-file-name name version))
391 (patches (search-patches "ganeti-shepherd-support.patch"
392 "ganeti-shepherd-master-failover.patch"
393 "ganeti-deterministic-manual.patch"
394 "ganeti-drbd-compat.patch"
395 "ganeti-os-disk-size.patch"
396 "ganeti-haskell-pythondir.patch"
397 "ganeti-disable-version-symlinks.patch"
398 "ganeti-preserve-PYTHONPATH.patch"))))
399 (build-system gnu-build-system)
401 `(#:imported-modules (,@%gnu-build-system-modules
402 (guix build haskell-build-system)
403 (guix build python-build-system))
404 #:modules (,@%gnu-build-system-modules
405 ((guix build haskell-build-system) #:prefix haskell:)
406 ((guix build python-build-system) #:select (python-version))
409 ;; The default test target includes a lot of checks that are only really
410 ;; relevant for developers such as NEWS file checking, line lengths, etc.
411 ;; We are only interested in the "py-tests" and "hs-tests" targets: this
412 ;; is the closest we've got even though it includes a little more.
413 #:test-target "check-TESTS"
416 (list "--localstatedir=/var"
417 "--sharedstatedir=/var"
419 "--enable-haskell-tests"
421 ;; By default, the build system installs everything to versioned
422 ;; directories such as $libdir/3.0 and relies on a $libdir/default
423 ;; symlink pointed from /etc/ganeti/{lib,share} to actually function.
424 ;; This is done to accommodate installing multiple versions in
425 ;; parallel, but is of little use to us as Guix users can just
426 ;; roll back and forth. Thus, disable it for simplicity.
427 "--disable-version-links"
429 ;; Ganeti can optionally take control over SSH host keys and
430 ;; distribute them to nodes as they are added, and also rotate keys
431 ;; with 'gnt-cluster renew-crypto --new-ssh-keys'. Thus it needs to
432 ;; know how to restart the SSH daemon.
433 "--with-sshd-restart-command='herd restart ssh-daemon'"
435 ;; Look for OS definitions in this directory by default. It can
436 ;; be changed in the cluster configuration.
437 "--with-os-search-path=/run/current-system/profile/share/ganeti/os"
439 ;; The default QEMU executable to use. We don't use the package
440 ;; here because this entry is stored in the cluster configuration.
441 (string-append "--with-kvm-path=/run/current-system/profile/bin/"
442 ,(system->qemu-target (%current-system))))
444 (modify-phases %standard-phases
445 (add-after 'unpack 'create-vcs-version
447 ;; If we are building from a git checkout, we need to create a
448 ;; 'vcs-version' file manually because the build system does
449 ;; not have access to the git repository information.
450 (unless (file-exists? "vcs-version")
451 (call-with-output-file "vcs-version"
453 (format port "v~a~%" ,version))))
455 (add-after 'unpack 'patch-absolute-file-names
457 (substitute* '("lib/utils/process.py"
459 "src/Ganeti/Constants.hs"
460 "src/Ganeti/HTools/CLI.hs"
461 "test/py/ganeti.config_unittest.py"
462 "test/py/ganeti.hooks_unittest.py"
463 "test/py/ganeti.utils.process_unittest.py"
464 "test/py/ganeti.utils.text_unittest.py"
465 "test/py/ganeti.utils.wrapper_unittest.py")
466 (("/bin/sh") (which "sh"))
467 (("/bin/bash") (which "bash"))
468 (("/usr/bin/env") (which "env"))
469 (("/bin/true") (which "true")))
471 ;; This script is called by the node daemon at startup to perform
472 ;; sanity checks on the cluster IP addresses, and it is also used
473 ;; in a master-failover scenario. Add absolute references to
474 ;; avoid propagating these executables.
475 (substitute* "tools/master-ip-setup"
476 (("arping") (which "arping"))
477 (("ndisc6") (which "ndisc6"))
478 (("fping") (which "fping"))
479 (("grep") (which "grep"))
480 (("ip addr") (string-append (which "ip") " addr")))
482 (add-after 'unpack 'override-builtin-PATH
484 ;; Ganeti runs OS install scripts and similar with a built-in
485 ;; hard coded PATH. Patch so it works on Guix System.
486 (substitute* "src/Ganeti/Constants.hs"
487 (("/sbin:/bin:/usr/sbin:/usr/bin")
488 "/run/setuid-programs:/run/current-system/profile/sbin:\
489 /run/current-system/profile/bin"))
491 (add-after 'bootstrap 'patch-sphinx-version-detection
493 ;; The build system runs 'sphinx-build --version' to verify that
494 ;; the Sphinx is recent enough, but does not expect the
495 ;; .sphinx-build-real executable name created by the Sphinx wrapper.
496 (substitute* "configure"
497 (("\\$SPHINX --version 2>&1")
498 "$SPHINX --version 2>&1 | sed 's/.sphinx-build-real/sphinx-build/g'"))
501 ;; The build system invokes Cabal and GHC, which do not work with
502 ;; GHC_PACKAGE_PATH: <https://github.com/haskell/cabal/issues/3728>.
503 ;; Tweak the build system to do roughly what haskell-build-system does.
504 (add-before 'configure 'configure-haskell
505 (assoc-ref haskell:%standard-phases 'setup-compiler))
506 (add-after 'configure 'do-not-use-GHC_PACKAGE_PATH
508 (unsetenv "GHC_PACKAGE_PATH")
509 (substitute* "Makefile"
511 "$(CABAL) --package-db=../package.conf.d")
513 "$(GHC) -package-db=../package.conf.d"))
515 (add-after 'configure 'make-ghc-use-shared-libraries
517 (substitute* "Makefile"
518 (("HFLAGS =") "HFLAGS = -dynamic -fPIC"))
520 (add-after 'configure 'fix-installation-directories
522 (substitute* "Makefile"
523 ;; Do not attempt to create /var during install.
524 (("\\$\\(DESTDIR\\)\\$\\{localstatedir\\}")
525 "$(DESTDIR)${prefix}${localstatedir}")
526 ;; Similarly, do not attempt to install the sample ifup scripts
528 (("\\$\\(DESTDIR\\)\\$\\(ifupdir\\)")
529 "$(DESTDIR)${prefix}$(ifupdir)"))
531 (add-before 'build 'adjust-tests
533 ;; Disable tests that can not run. Do it early to prevent
534 ;; touching the Makefile later and triggering a needless rebuild.
535 (substitute* "Makefile"
536 ;; These tests expect the presence of a 'root' user (via
537 ;; ganeti/runtime.py), which fails in the build environment.
538 (("test/py/ganeti\\.asyncnotifier_unittest\\.py") "")
539 (("test/py/ganeti\\.backend_unittest\\.py") "")
540 (("test/py/ganeti\\.daemon_unittest\\.py") "")
541 (("test/py/ganeti\\.tools\\.ensure_dirs_unittest\\.py") "")
542 (("test/py/ganeti\\.utils\\.io_unittest-runasroot\\.py") "")
543 ;; Disable the bash_completion test, as it requires the full
544 ;; bash instead of bash-minimal.
545 (("test/py/bash_completion\\.bash")
547 ;; This test requires networking.
548 (("test/py/import-export_unittest\\.bash")
551 ;; Many of the Makefile targets reset PYTHONPATH before running
552 ;; the Python interpreter, which does not work very well for us.
553 (substitute* "Makefile"
555 (string-append "PYTHONPATH=" (getenv "PYTHONPATH") ":")))
557 (add-after 'build 'build-bash-completions
559 (let ((orig-pythonpath (getenv "PYTHONPATH")))
560 (setenv "PYTHONPATH" (string-append ".:" orig-pythonpath))
561 (invoke "./autotools/build-bash-completion")
562 (setenv "PYTHONPATH" orig-pythonpath)
564 (add-before 'check 'pre-check
565 (lambda* (#:key inputs #:allow-other-keys)
566 ;; Set TZDIR so that time zones are found.
567 (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
570 ;; This test checks whether PYTHONPATH is untouched, and extends
571 ;; it to include test directories if so. Add an else branch for
572 ;; our modified PYTHONPATH, in order to prevent a confusing test
573 ;; failure where expired certificates are not cleaned because
574 ;; check-cert-expired is silently crashing.
575 (substitute* "test/py/ganeti-cleaner_unittest.bash"
576 (("then export PYTHONPATH=(.*)" all testpath)
577 (string-append all "else export PYTHONPATH="
578 (getenv "PYTHONPATH") ":" testpath "\n")))
580 (substitute* "test/py/ganeti.utils.process_unittest.py"
581 ;; This test attempts to run an executable with
582 ;; RunCmd(..., reset_env=True), which fails because the default
583 ;; PATH from Constants.hs does not exist in the build container.
584 ((".*def testResetEnv.*" all)
585 (string-append " @unittest.skipIf(True, "
586 "\"cannot reset env in the build container\")\n"
589 ;; XXX: Somehow this test fails in the build container, but
590 ;; works in 'guix environment -C', even without /bin/sh?
591 ((".*def testPidFile.*" all)
592 (string-append " @unittest.skipIf(True, "
593 "\"testPidFile fails in the build container\")\n"
596 ;; XXX: Why are these links not added automatically.
597 (with-directory-excursion "test/hs"
598 (for-each (lambda (file)
599 (symlink "../../src/htools" file))
600 '("hspace" "hscan" "hinfo" "hbal" "hroller"
601 "hcheck" "hail" "hsqueeze")))
603 (add-after 'install 'install-bash-completions
604 (lambda* (#:key outputs #:allow-other-keys)
605 (let* ((out (assoc-ref outputs "out"))
606 (compdir (string-append out "/etc/bash_completion.d")))
608 (copy-file "doc/examples/bash_completion"
609 (string-append compdir "/ganeti"))
610 ;; The one file contains completions for many different
611 ;; executables. Create symlinks for found completions.
612 (with-directory-excursion compdir
614 (lambda (prog) (symlink "ganeti" prog))
615 (call-with-input-file "ganeti"
617 (let loop ((line (read-line port))
619 (if (eof-object? line)
621 (if (string-prefix? "complete" line)
622 (loop (read-line port)
623 ;; Extract "prog" from lines of the form:
624 ;; "complete -F _prog -o filenames prog".
625 ;; Note that 'burnin' is listed with the
626 ;; absolute file name, which is why we
627 ;; run everything through 'basename'.
628 (cons (basename (car (reverse (string-split
631 (loop (read-line port) progs))))))))
633 ;; Wrap all executables with PYTHONPATH. We can't borrow the phase
634 ;; from python-build-system because we also need to wrap the scripts
635 ;; in $out/lib/ganeti such as "node-daemon-setup".
636 (add-after 'install 'wrap
637 (lambda* (#:key inputs outputs #:allow-other-keys)
638 (let* ((out (assoc-ref outputs "out"))
639 (sbin (string-append out "/sbin"))
640 (lib (string-append out "/lib"))
641 (python (assoc-ref inputs "python"))
642 (major+minor (python-version python))
643 (PYTHONPATH (string-append lib "/python" major+minor
645 (getenv "PYTHONPATH"))))
646 (define (shell-script? file)
647 (call-with-ascii-input-file file
649 (let ((shebang (false-if-exception (read-line port))))
651 (string-prefix? "#!" shebang)
652 (or (string-contains shebang "/bin/bash")
653 (string-contains shebang "/bin/sh")))))))
656 ;; Do not wrap shell scripts because some are meant to be
657 ;; sourced, which breaks if they are wrapped. We do wrap
658 ;; the Haskell executables because some call out to Python
660 (and (executable-file? file)
661 (not (symbolic-link? file))
662 (not (shell-script? file))))
664 (for-each (lambda (file)
666 `("PYTHONPATH" ":" prefix (,PYTHONPATH))))
668 (append (find-files (string-append lib "/ganeti"))
673 ("cabal" ,cabal-install)
676 ;; These inputs are necessary to bootstrap the package, because we
677 ;; have patched the build system.
678 ("autoconf" ,autoconf)
679 ("automake" ,automake)
681 ;; For the documentation.
682 ("python-docutils" ,python-docutils)
683 ("sphinx" ,python-sphinx)
687 ;; Test dependencies.
688 ("fakeroot" ,fakeroot)
689 ("ghc-temporary" ,ghc-temporary)
690 ("ghc-test-framework" ,ghc-test-framework)
691 ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
692 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
693 ("python-mock" ,python-mock)
694 ("python-pyyaml" ,python-pyyaml)
697 ("shelltestrunner" ,shelltestrunner)
698 ("tzdata" ,tzdata-for-tests)))
700 `(("arping" ,iputils) ;must be the iputils version
703 ("iproute2" ,iproute)
706 ("qemu" ,qemu-minimal) ;for qemu-img
707 ("ghc-attoparsec" ,ghc-attoparsec)
708 ("ghc-base64-bytestring" ,ghc-base64-bytestring)
709 ("ghc-cryptonite" ,ghc-cryptonite)
710 ("ghc-curl" ,ghc-curl)
711 ("ghc-hinotify" ,ghc-hinotify)
712 ("ghc-hslogger" ,ghc-hslogger)
713 ("ghc-json" ,ghc-json)
714 ("ghc-lens" ,ghc-lens)
715 ("ghc-lifted-base" ,ghc-lifted-base)
716 ("ghc-network" ,ghc-network)
717 ("ghc-old-time" ,ghc-old-time)
718 ("ghc-psqueue" ,ghc-psqueue)
719 ("ghc-regex-pcre" ,ghc-regex-pcre)
720 ("ghc-utf8-string" ,ghc-utf8-string)
721 ("ghc-zlib" ,ghc-zlib)
723 ;; For the optional metadata daemon.
724 ("ghc-snap-core" ,ghc-snap-core)
725 ("ghc-snap-server" ,ghc-snap-server)
728 ("python-pyopenssl" ,python-pyopenssl)
729 ("python-simplejson" ,python-simplejson)
730 ("python-pyparsing" ,python-pyparsing)
731 ("python-pyinotify" ,python-pyinotify)
732 ("python-pycurl" ,python-pycurl)
733 ("python-bitarray" ,python-bitarray)
734 ("python-paramiko" ,python-paramiko)
735 ("python-psutil" ,python-psutil)))
736 (home-page "http://www.ganeti.org/")
737 (synopsis "Cluster-based virtual machine management system")
739 "Ganeti is a virtual machine management tool built on top of existing
740 virtualization technologies such as Xen or KVM. Ganeti controls:
743 @item Disk creation management;
744 @item Operating system installation for instances (in co-operation with
745 OS-specific install scripts); and
746 @item Startup, shutdown, and failover between physical systems.
749 Ganeti is designed to facilitate cluster management of virtual servers and
750 to provide fast and simple recovery after physical failures, using
751 commodity hardware.")
752 (license license:bsd-2)))
754 (define-public ganeti-instance-guix
756 (name "ganeti-instance-guix")
758 (home-page "https://github.com/mbakke/ganeti-instance-guix")
761 (uri (git-reference (url home-page) (commit version)))
762 (file-name (git-file-name name version))
765 "0aa08irpcpns6mhjgsplc5f0p8ab1qcr9ah1gj5z66kxgqyflzrp"))))
766 (build-system gnu-build-system)
768 '(#:configure-flags '("--sysconfdir=/etc" "--localstatedir=/var")))
770 `(("autoconf" ,autoconf)
771 ("automake" ,automake)))
773 `(("util-linux" ,util-linux)
774 ("qemu-img" ,qemu-minimal)))
775 (synopsis "Guix OS integration for Ganeti")
777 "This package provides a guest OS definition for Ganeti that uses
778 Guix to build virtual machines.")
779 (license license:gpl3+)))
781 (define-public ganeti-instance-debootstrap
783 (name "ganeti-instance-debootstrap")
784 ;; We need two commits on top of the latest release for compatibility
785 ;; with newer sfdisk, as well as gnt-network integration.
786 (version "0.16-2-ge145396")
787 (home-page "https://github.com/ganeti/instance-debootstrap")
790 (uri (git-reference (url home-page) (commit version)))
791 (file-name (git-file-name name version))
794 "0f2isw9d8lawzj21rrq1q9xhq8xfa65rqbhqmrn59z201x9q1336"))))
795 (build-system gnu-build-system)
797 '(#:configure-flags '("--sysconfdir=/etc" "--localstatedir=/var")
798 #:phases (modify-phases %standard-phases
799 (add-after 'unpack 'add-absolute-references
801 (substitute* "common.sh.in"
802 (("/sbin/blkid") (which "blkid"))
804 (string-append (which "kpartx") " -")))
805 (substitute* "import"
807 (string-append (which "restore") " -r")))
808 (substitute* "export"
810 (string-append (which "dump") " -0")))
811 (substitute* "create"
812 (("debootstrap") (which "debootstrap"))
813 (("`which run-parts`") (which "run-parts"))
814 ;; Here we actually need to hard code /bin/passwd
815 ;; because it's called via chroot, which fails if
816 ;; "/bin" is not in PATH.
817 (("passwd") "/bin/passwd"))
819 (add-after 'unpack 'set-dpkg-arch
820 (lambda* (#:key system #:allow-other-keys)
821 ;; The create script passes --arch to debootstrap,
822 ;; and defaults to `dpkg --print-architecture` when
823 ;; ARCH is not set in variant.conf. Hard code the
824 ;; build-time architecture to avoid the dpkg dependency.
826 (cond ((string-prefix? "x86_64" system)
828 ((string-prefix? "i686" system)
830 ((string-prefix? "aarch64" system)
832 (else (car (string-split system #\-))))))
833 (substitute* "create"
834 (("`dpkg --print-architecture`")
837 (add-after 'configure 'adjust-Makefile
839 ;; Do not attempt to create /etc/ganeti/instance-debootstrap
840 ;; and /etc/default/ganeti-instance-debootstrap during install.
841 ;; They are created by the Ganeti service.
842 (substitute* "Makefile"
843 (("\\$\\(variantsdir\\)")
844 "$(prefix)/etc/ganeti/instance-debootstrap/variants")
845 (("\\$\\(defaultsdir\\)")
846 "$(prefix)/etc/default/ganeti-instance-debootstrap"))
848 (add-after 'install 'make-variants.list-symlink
849 (lambda* (#:key outputs #:allow-other-keys)
850 ;; The Ganeti OS API mandates a variants.list file that
851 ;; describes all supported "variants" of this OS.
852 ;; Guix generates this file, so make the original file
854 (with-directory-excursion (string-append
855 (assoc-ref outputs "out")
856 "/share/ganeti/os/debootstrap")
857 (delete-file "variants.list")
858 (symlink "/etc/ganeti/instance-debootstrap/variants/variants.list"
862 `(("autoconf" ,autoconf)
863 ("automake" ,automake)))
865 `(("debianutils" ,debianutils)
866 ("debootstrap" ,debootstrap)
868 ("kpartx" ,multipath-tools)
869 ("util-linux" ,util-linux)))
870 (synopsis "Debian OS integration for Ganeti")
872 "This package provides a guest OS definition for Ganeti. It installs
873 Debian or a derivative using @command{debootstrap}.")
874 (license license:gpl2+)))
876 (define-public libosinfo
883 (uri (string-append "https://releases.pagure.org/libosinfo/libosinfo-"
887 "1s97sv24bybggjx6hgqba2qdqz3ivfpd4cmkh4zm5y59sim109mv"))))
888 (build-system meson-build-system)
891 (list (string-append "-Dwith-usb-ids-path="
892 (assoc-ref %build-inputs "usb.ids"))
893 (string-append "-Dwith-pci-ids-path="
894 (assoc-ref %build-inputs "pci.ids")))
896 (modify-phases %standard-phases
897 (add-after 'unpack 'patch-osinfo-path
898 (lambda* (#:key inputs #:allow-other-keys)
899 (substitute* "osinfo/osinfo_loader.c"
900 (("path = DATA_DIR.*")
901 (string-append "path = \"" (assoc-ref inputs "osinfo-db")
902 "/share/osinfo\";")))
905 `(("libsoup" ,libsoup)
908 ("osinfo-db" ,osinfo-db)))
910 `(("glib" ,glib "bin") ; glib-mkenums, etc.
911 ("gobject-introspection" ,gobject-introspection)
914 ("intltool" ,intltool)
915 ("pkg-config" ,pkg-config)
919 (uri "https://github.com/pciutils/pciids/raw/ad02084f0bc143e3c15e31a6152a3dfb1d7a3156/pci.ids")
922 "0kfhpj5rnh24hz2714qhfmxk281vwc2w50sm73ggw5d15af7zfsw"))))
926 (uri "https://svn.code.sf.net/p/linux-usb/repo/trunk/htdocs/usb.ids?r=2681")
927 (file-name "usb.ids")
930 "1m6yhvz5k8aqzxgk7xj3jkk8frl1hbv0h3vgj4wbnvnx79qnvz3r"))))))
931 (home-page "https://libosinfo.org/")
932 (synopsis "Operating system information database")
933 (description "libosinfo is a GObject based library API for managing
934 information about operating systems, hypervisors and the (virtual) hardware
935 devices they can support. It includes a database containing device metadata
936 and provides APIs to match/identify optimal devices for deploying an operating
937 system on a hypervisor. Via GObject Introspection, the API is available in
938 all common programming languages. Vala bindings are also provided.")
939 ;; The library files are released under LGPLv2.1 or later; the source
940 ;; files in the "tools" directory are released under GPLv2+.
941 (license (list license:lgpl2.1+ license:gpl2+))))
950 "https://linuxcontainers.org/downloads/lxc/lxc-"
954 "1igxqgx8q9cp15mcp1y8j564bl85ijw04jcmgb1s5bmfbg1751sd"))))
955 (build-system gnu-build-system)
957 `(("pkg-config" ,pkg-config)))
961 ("libseccomp" ,libseccomp)
962 ("libselinux" ,libselinux)))
965 (list (string-append "--docdir=" (assoc-ref %outputs "out")
966 "/share/doc/" ,name "-" ,version)
968 "--localstatedir=/var")
970 (modify-phases %standard-phases
972 (lambda* (#:key outputs #:allow-other-keys)
973 (let* ((out (assoc-ref outputs "out"))
974 (bashcompdir (string-append out "/etc/bash_completion.d")))
975 (invoke "make" "install"
976 (string-append "bashcompdir=" bashcompdir)
977 ;; Don't install files into /var and /etc.
978 "LXCPATH=/tmp/var/lib/lxc"
979 "localstatedir=/tmp/var"
980 "sysconfdir=/tmp/etc"
981 "sysconfigdir=/tmp/etc/default")))))))
982 (synopsis "Linux container tools")
983 (home-page "https://linuxcontainers.org/")
985 "LXC is a userspace interface for the Linux kernel containment features.
986 Through a powerful API and simple tools, it lets Linux users easily create and
987 manage system or application containers.")
988 (license license:lgpl2.1+)))
990 (define-public libvirt
997 (uri (string-append "https://libvirt.org/sources/libvirt-"
1000 (base32 "0m8cqaqflvys5kaqpvb0qr4k365j09jc5xk6x70yvg8qkcl2hcz2"))
1002 (search-patches "libvirt-create-machine-cgroup.patch"))))
1003 (build-system gnu-build-system)
1007 "--with-qemu-user=nobody"
1008 "--with-qemu-group=kvm"
1010 (string-append "--docdir=" (assoc-ref %outputs "out") "/share/doc/"
1013 "--localstatedir=/var")
1015 (modify-phases %standard-phases
1016 (add-before 'configure 'fix-BOURNE_SHELL-definition
1017 ;; BOURNE_SHELL is hard-#defined to ‘/bin/sh’, causing test failures.
1019 (substitute* "config.h.in"
1020 (("/bin/sh") (which "sh")))
1022 (add-before 'configure 'patch-libtirpc-file-names
1023 (lambda* (#:key inputs #:allow-other-keys)
1024 ;; libvirt uses an m4 macro instead of pkg-config to determine where
1025 ;; the RPC headers are located. Tell it to look in the right place.
1026 (substitute* "configure"
1027 (("/usr/include/tirpc") ;defined in m4/virt-xdr.m4
1028 (string-append (assoc-ref inputs "libtirpc")
1031 (add-before 'configure 'disable-broken-tests
1033 (let ((tests (list "commandtest" ; hangs idly
1034 "qemuxml2argvtest" ; fails
1035 "qemuhotplugtest" ; fails
1036 "virnetsockettest" ; tries to network
1037 "virshtest"))) ; fails
1038 (substitute* "tests/Makefile.in"
1039 (((format #f "(~a)\\$\\(EXEEXT\\)" (string-join tests "|")))
1043 ;; Since the sysconfdir and localstatedir should be /etc and /var
1044 ;; at runtime, we must prevent writing to them at installation
1046 (lambda* (#:key make-flags #:allow-other-keys)
1047 (apply invoke "make" "install"
1048 "sysconfdir=/tmp/etc"
1049 "localstatedir=/tmp/var"
1052 `(("libxml2" ,libxml2)
1054 ("libpciaccess" ,libpciaccess)
1057 ("libpcap" ,libpcap)
1059 ("libtirpc" ,libtirpc) ;for <rpc/rpc.h>
1060 ("libuuid" ,util-linux "lib")
1061 ("lvm2" ,lvm2) ;for libdevmapper
1063 ("openssl" ,openssl)
1064 ("cyrus-sasl" ,cyrus-sasl)
1065 ("libyajl" ,libyajl)
1067 ("dmidecode" ,dmidecode)
1068 ("dnsmasq" ,dnsmasq)
1069 ("ebtables" ,ebtables)
1070 ("iproute" ,iproute)
1071 ("iptables" ,iptables)))
1073 `(("xsltproc" ,libxslt)
1075 ("pkg-config" ,pkg-config)
1077 ("python" ,python-wrapper)))
1078 (home-page "https://libvirt.org")
1079 (synopsis "Simple API for virtualization")
1080 (description "Libvirt is a C toolkit to interact with the virtualization
1081 capabilities of recent versions of Linux. The library aims at providing long
1082 term stable C API initially for the Xen paravirtualization but should be able
1083 to integrate other virtualization mechanisms if needed.")
1084 (license license:lgpl2.1+)))
1086 (define-public libvirt-glib
1088 (name "libvirt-glib")
1092 (uri (string-append "ftp://libvirt.org/libvirt/glib/"
1093 "libvirt-glib-" version ".tar.gz"))
1096 "1zpbv4ninc57c9rw4zmmkvvqn7154iv1qfr20kyxn8xplalqrzvz"))))
1097 (build-system gnu-build-system)
1099 `(("openssl" ,openssl)
1100 ("cyrus-sasl" ,cyrus-sasl)
1101 ("lvm2" ,lvm2) ; for libdevmapper
1102 ("libyajl" ,libyajl)))
1104 `(("pkg-config" ,pkg-config)
1105 ("intltool" ,intltool)
1106 ("glib" ,glib "bin")
1109 ;; ‘Required:’ by the installed .pc files.
1111 ("libvirt" ,libvirt)
1112 ("libxml2" ,libxml2)
1113 ("gobject-introspection" ,gobject-introspection)))
1114 (home-page "https://libvirt.org")
1115 (synopsis "GLib wrapper around libvirt")
1116 (description "libvirt-glib wraps the libvirt library to provide a
1117 high-level object-oriented API better suited for glib-based applications, via
1121 @item libvirt-glib - GLib main loop integration & misc helper APIs
1122 @item libvirt-gconfig - GObjects for manipulating libvirt XML documents
1123 @item libvirt-gobject - GObjects for managing libvirt objects
1126 (license license:lgpl2.1+)))
1128 (define-public python-libvirt
1130 (name "python-libvirt")
1135 (uri (string-append "https://libvirt.org/sources/python/libvirt-python-"
1138 (base32 "0kyz3lx49d8p75mvbzinxc1zgs8g7adn77y9bm15b8b4ad9zl5s6"))))
1139 (build-system python-build-system)
1142 (modify-phases %standard-phases
1143 (add-after 'unpack 'patch-nosetests-path
1144 (lambda* (#:key inputs #:allow-other-keys)
1145 (substitute* "setup.py"
1146 (("\"/usr/bin/nosetests\"")
1147 (string-append "\"" (which "nosetests") "\""))
1148 (("self\\.spawn\\(\\[sys\\.executable, nose\\]\\)")
1149 (format #f "self.spawn([\"~a\", nose])" (which "bash"))))
1152 `(("libvirt" ,libvirt)))
1154 `(("python-lxml" ,python-lxml)))
1156 `(("pkg-config" ,pkg-config)
1157 ("python-nose" ,python-nose)))
1158 (home-page "https://libvirt.org")
1159 (synopsis "Python bindings to libvirt")
1160 (description "This package provides Python bindings to the libvirt
1161 virtualization library.")
1162 (license license:lgpl2.1+)))
1164 (define-public python2-libvirt
1165 (package-with-python2 python-libvirt))
1167 (define-public virt-manager
1169 (name "virt-manager")
1173 (uri (string-append "https://virt-manager.org/download/sources"
1174 "/virt-manager/virt-manager-"
1178 "06ws0agxlip6p6n3n43knsnjyd91gqhh2dadgc33wl9lx1k8vn6g"))))
1179 (build-system python-build-system)
1181 `(#:use-setuptools? #f ; uses custom distutils 'install' command
1182 #:test-target "test_ui"
1183 #:tests? #f ; TODO The tests currently fail
1184 ; RuntimeError: Loop condition wasn't
1186 #:imported-modules ((guix build glib-or-gtk-build-system)
1187 ,@%python-build-system-modules)
1188 #:modules ((ice-9 match)
1190 (guix build python-build-system)
1191 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
1194 (modify-phases %standard-phases
1195 (add-after 'unpack 'fix-setup
1196 (lambda* (#:key outputs #:allow-other-keys)
1197 (substitute* "virtinst/buildconfig.py"
1198 (("/usr") (assoc-ref outputs "out")))
1200 (add-after 'unpack 'fix-qemu-img-reference
1201 (lambda* (#:key inputs #:allow-other-keys)
1202 (substitute* "virtconv/formats.py"
1203 (("/usr(/bin/qemu-img)" _ suffix)
1204 (string-append (assoc-ref inputs "qemu") suffix)))
1206 (add-after 'unpack 'fix-default-uri
1207 (lambda* (#:key inputs #:allow-other-keys)
1208 ;; Xen is not available for now - so only patch qemu.
1209 (substitute* "virtManager/createconn.py"
1210 (("/usr(/bin/qemu-system)" _ suffix)
1211 (string-append (assoc-ref inputs "qemu") suffix)))
1213 (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH
1214 (lambda* (#:key inputs outputs #:allow-other-keys)
1215 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
1216 (bin-files (find-files bin ".*"))
1217 (paths (map (match-lambda
1218 ((output . directory)
1219 (let* ((girepodir (string-append
1221 "/lib/girepository-1.0")))
1222 (if (file-exists? girepodir)
1225 (for-each (lambda (file)
1226 (format #t "wrapping ~a\n" file)
1228 `("GI_TYPELIB_PATH" ":" prefix
1229 ,(filter identity paths))))
1233 (lambda* (#:key tests? #:allow-other-keys)
1235 (setenv "HOME" "/tmp")
1236 (system "Xvfb :1 &")
1237 (setenv "DISPLAY" ":1")
1238 ;; Dogtail requires that Assistive Technology support be enabled
1239 (setenv "GTK_MODULES" "gail:atk-bridge")
1240 (invoke "dbus-run-session" "--" "python" "setup.py" "test_ui"))
1242 (add-after 'install 'glib-or-gtk-compile-schemas
1243 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
1244 (add-after 'install 'glib-or-gtk-wrap
1245 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
1249 ("gtk-vnc" ,gtk-vnc)
1250 ("gtksourceview" ,gtksourceview)
1251 ("libvirt" ,libvirt)
1252 ("libvirt-glib" ,libvirt-glib)
1253 ("libosinfo" ,libosinfo)
1255 ("python-libvirt" ,python-libvirt)
1256 ("python-requests" ,python-requests)
1257 ("python-pycairo" ,python-pycairo)
1258 ("python-pygobject" ,python-pygobject)
1259 ("python-libxml2" ,python-libxml2)
1260 ("spice-gtk" ,spice-gtk)))
1261 ;; virt-manager searches for qemu-img or kvm-img in the PATH.
1265 `(("glib" ,glib "bin") ; glib-compile-schemas
1266 ("gobject-introspection" ,gobject-introspection)
1267 ("gtk+" ,gtk+ "bin") ; gtk-update-icon-cache
1268 ("perl" ,perl) ; pod2man
1269 ("intltool" ,intltool)
1270 ;; The following are required for running the tests
1271 ;; ("python-dogtail" ,python-dogtail)
1272 ;; ("xvfb" ,xorg-server-for-tests)
1274 ;; ("at-spi2-core" ,at-spi2-core)
1275 ;; ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
1277 (home-page "https://virt-manager.org/")
1278 (synopsis "Manage virtual machines")
1280 "The virt-manager application is a desktop user interface for managing
1281 virtual machines through libvirt. It primarily targets KVM VMs, but also
1282 manages Xen and LXC (Linux containers). It presents a summary view of running
1283 domains, their live performance and resource utilization statistics.")
1284 (license license:gpl2+)))
1292 (uri (string-append "https://download.openvz.org/criu/criu-"
1293 version ".tar.bz2"))
1296 "1jrr3v99g18gc0hriz0avq6ccdvyya0j6wwz888sdsc4icc30gzn"))))
1297 (build-system gnu-build-system)
1299 `(#:test-target "test"
1300 #:tests? #f ; tests require mounting as root
1302 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1303 (string-append "LIBDIR=" (assoc-ref %outputs "out")
1305 (string-append "ASCIIDOC=" (assoc-ref %build-inputs "asciidoc")
1307 (string-append "XMLTO=" (assoc-ref %build-inputs "xmlto")
1310 (modify-phases %standard-phases
1312 (lambda* (#:key inputs #:allow-other-keys)
1313 ;; The includes for libnl are located in a sub-directory.
1314 (setenv "C_INCLUDE_PATH"
1315 (string-append (assoc-ref inputs "libnl")
1317 (or (getenv "C_INCLUDE_PATH") "")))
1319 (add-after 'configure 'fix-documentation
1320 (lambda* (#:key inputs outputs #:allow-other-keys)
1321 (substitute* "Documentation/Makefile"
1324 "-m custom.xsl --skip-validation -x "
1325 (assoc-ref inputs "docbook-xsl") "/xml/xsl/"
1326 ,(package-name docbook-xsl) "-"
1327 ,(package-version docbook-xsl)
1328 "/manpages/docbook.xsl")))
1330 (add-after 'unpack 'hardcode-variables
1331 (lambda* (#:key inputs #:allow-other-keys)
1332 ;; Hardcode arm version detection
1333 (substitute* "Makefile"
1334 (("ARMV.*:=.*") "ARMV := 7\n"))
1335 ;; We are currently using python-2
1336 (substitute* "crit/Makefile"
1337 (("\\$\\(PYTHON\\)") "python2"))
1338 (substitute* "lib/Makefile"
1339 (("\\$\\(PYTHON\\)")
1340 (string-append (assoc-ref inputs "python")
1343 (add-before 'build 'fix-symlink
1344 (lambda* (#:key inputs #:allow-other-keys)
1345 ;; The file 'images/google/protobuf/descriptor.proto' points to
1346 ;; /usr/include/..., which obviously does not exist.
1347 (let* ((file "google/protobuf/descriptor.proto")
1348 (target (string-append "images/" file))
1349 (source (string-append (assoc-ref inputs "protobuf")
1351 (delete-file target)
1352 (symlink source target)
1354 (add-after 'install 'wrap
1355 (lambda* (#:key inputs outputs #:allow-other-keys)
1356 ;; Make sure 'crit' runs with the correct PYTHONPATH.
1357 (let* ((out (assoc-ref outputs "out"))
1358 (path (string-append out
1360 (string-take (string-take-right
1361 (assoc-ref inputs "python") 5) 3)
1363 (getenv "PYTHONPATH"))))
1364 (wrap-program (string-append out "/bin/crit")
1365 `("PYTHONPATH" ":" prefix (,path))))
1368 `(("protobuf" ,protobuf)
1369 ("python" ,python-2)
1370 ("python2-protobuf" ,python2-protobuf)
1371 ("python2-ipaddr" ,python2-ipaddr)
1372 ("iproute" ,iproute)
1377 ("libbsd" ,libbsd)))
1379 `(("pkg-config" ,pkg-config)
1381 ("protobuf-c" ,protobuf-c)
1382 ("asciidoc" ,asciidoc)
1384 ("docbook-xml" ,docbook-xml)
1385 ("docbook-xsl" ,docbook-xsl)))
1386 (home-page "https://criu.org")
1387 (synopsis "Checkpoint and restore in user space")
1388 (description "Using this tool, you can freeze a running application (or
1389 part of it) and checkpoint it to a hard drive as a collection of files. You
1390 can then use the files to restore and run the application from the point it
1391 was frozen at. The distinctive feature of the CRIU project is that it is
1392 mainly implemented in user space.")
1393 ;; The project is licensed under GPLv2; files in the lib/ directory are
1395 (license (list license:gpl2 license:lgpl2.1))))
1397 (define-public qmpbackup
1404 (url "https://github.com/abbbi/qmpbackup")
1406 (file-name (git-file-name name version))
1409 "0swhp5byz44brhyis1a39p11fyn9q84xz5q6v2fah29r7d71kmmx"))))
1410 (build-system python-build-system)
1412 `(#:python ,python-2))
1413 (home-page "https://github.com/abbbi/qmpbackup")
1414 (synopsis "Backup and restore QEMU machines")
1415 (description "qmpbackup is designed to create and restore full and
1416 incremental backups of running QEMU virtual machines via QMP, the QEMU
1418 (license license:gpl3+)))
1420 (define-public looking-glass-client
1421 (let ((commit "182c4752d57690da7f99d5e788de9b8baea33895"))
1423 (name "looking-glass-client")
1424 (version (string-append "a12-" (string-take commit 7)))
1428 (uri (git-reference (url "https://github.com/gnif/LookingGlass")
1430 (file-name (git-file-name name version))
1433 "02bq46ndmzq9cihazzn7xq1x7q5nzm7iw4l9lqzihxcxp9famkhw"))
1434 (modules '((guix build utils)))
1437 ;; Do not create binaries optimized for the CPU of the build machine,
1438 ;; for reproducibility and compatibility. TODO: in the next version
1439 ;; of looking glass, this is exposed as a CMake configure option.
1440 (substitute* "client/CMakeLists.txt"
1444 (build-system cmake-build-system)
1445 (inputs `(("fontconfig" ,fontconfig)
1448 ("openssl" ,openssl)
1450 ("sdl2-ttf" ,sdl2-ttf)
1451 ("spice-protocol" ,spice-protocol)
1452 ("wayland" ,wayland)))
1453 (native-inputs `(("libconfig" ,libconfig)
1455 ("pkg-config" ,pkg-config)))
1457 `(#:tests? #f ;; No tests are available.
1458 #:make-flags '("CC=gcc")
1459 #:phases (modify-phases %standard-phases
1460 (add-before 'configure 'chdir-to-client
1461 (lambda* (#:key outputs #:allow-other-keys)
1464 (add-after 'chdir-to-client 'add-missing-include
1466 ;; Mimic upstream commit b9797529893, required since the
1467 ;; update to Mesa 19.2.
1468 (substitute* "renderers/egl/shader.h"
1469 (("#include <stdbool\\.h>")
1470 "#include <stdbool.h>\n#include <stddef.h>"))
1473 (lambda* (#:key outputs #:allow-other-keys)
1474 (install-file "looking-glass-client"
1475 (string-append (assoc-ref outputs "out")
1478 (home-page "https://looking-glass.hostfission.com")
1479 (synopsis "KVM Frame Relay (KVMFR) implementation")
1480 (description "Looking Glass allows the use of a KVM (Kernel-based Virtual
1481 Machine) configured for VGA PCI Pass-through without an attached physical
1482 monitor, keyboard or mouse. It displays the VM's rendered contents on your main
1484 ;; This package requires SSE instructions.
1485 (supported-systems '("i686-linux" "x86_64-linux"))
1486 (license license:gpl2+))))
1491 (version "1.0.0-rc6")
1495 "https://github.com/opencontainers/runc/releases/"
1496 "download/v" version "/runc.tar.xz"))
1497 (file-name (string-append name "-" version ".tar.xz"))
1498 (patches (search-patches "runc-CVE-2019-5736.patch"))
1501 "1c7832dq70slkjh8qp2civ1wxhhdd2hrx84pq7db1mmqc9fdr3cc"))))
1502 (build-system go-build-system)
1504 '(#:import-path "github.com/opencontainers/runc"
1505 #:install-source? #f
1506 ;; XXX: 20/139 tests fail due to missing /var, cgroups and apparmor in
1507 ;; the build environment.
1510 (modify-phases %standard-phases
1512 (lambda* (#:key source import-path #:allow-other-keys)
1513 ;; Unpack the tarball into 'runc' instead of 'runc-1.0.0-rc5'.
1514 (let ((dest (string-append "src/" import-path)))
1516 (invoke "tar" "-C" (string-append "src/" import-path)
1517 "--strip-components=1"
1520 (lambda* (#:key import-path #:allow-other-keys)
1521 (with-directory-excursion (string-append "src/" import-path)
1522 ;; XXX: requires 'go-md2man'.
1523 ;; (invoke "make" "man")
1527 ;; (invoke "make" "localunittest")))
1529 (lambda* (#:key import-path outputs #:allow-other-keys)
1530 (with-directory-excursion (string-append "src/" import-path)
1531 (let ((out (assoc-ref outputs "out")))
1532 (invoke "make" "install" "install-bash"
1533 (string-append "PREFIX=" out)))))))))
1535 `(("pkg-config" ,pkg-config)))
1537 `(("libseccomp" ,libseccomp)))
1538 (synopsis "Open container initiative runtime")
1539 (home-page "https://www.opencontainers.org/")
1541 "@command{runc} is a command line client for running applications
1542 packaged according to the
1543 @uref{https://github.com/opencontainers/runtime-spec/blob/master/spec.md, Open
1544 Container Initiative (OCI) format} and is a compliant implementation of the
1545 Open Container Initiative specification.")
1546 (license license:asl2.0)))
1548 (define-public umoci
1556 "https://github.com/opencontainers/umoci/releases/download/v"
1557 version "/umoci.tar.xz"))
1558 (file-name (string-append "umoci-" version ".tar.xz"))
1560 (base32 "06q7xfwnqysc013hapx31jhlzmyg8qb467qfkynj673qc7p9bd6h"))))
1561 (build-system go-build-system)
1563 '(#:import-path "github.com/opencontainers/umoci"
1564 #:install-source? #f
1566 (modify-phases %standard-phases
1568 (lambda* (#:key source import-path #:allow-other-keys)
1569 ;; Unpack the tarball into 'umoci' instead of "runc-${version}".
1570 (let ((dest (string-append "src/" import-path)))
1572 (invoke "tar" "-C" (string-append "src/" import-path)
1573 "--strip-components=1"
1576 (lambda* (#:key import-path #:allow-other-keys)
1577 (with-directory-excursion (string-append "src/" import-path)
1578 ;; TODO: build manpages with 'go-md2man'.
1579 (invoke "make" "SHELL=bash"))))
1581 (lambda* (#:key import-path outputs #:allow-other-keys)
1582 (let* ((out (assoc-ref outputs "out"))
1583 (bindir (string-append out "/bin")))
1584 (install-file (string-append "src/" import-path "/umoci")
1587 (home-page "https://umo.ci/")
1588 (synopsis "Tool for modifying Open Container images")
1590 "@command{umoci} is a tool that allows for high-level modification of an
1591 Open Container Initiative (OCI) image layout and its tagged images.")
1592 (license license:asl2.0)))
1594 (define-public skopeo
1601 (url "https://github.com/containers/skopeo")
1602 (commit (string-append "v" version))))
1603 (file-name (git-file-name name version))
1606 "1v7k3ki10i6082r7zswblyirx6zck674y6bw3plssw4p1l2611rd"))))
1607 (build-system go-build-system)
1609 `(("pkg-config" ,pkg-config)
1610 ("go-github-com-go-md2man" ,go-github-com-go-md2man)))
1612 `(("btrfs-progs" ,btrfs-progs)
1614 ("libassuan" ,libassuan)
1615 ("libselinux" ,libselinux)
1616 ("libostree" ,libostree)
1621 '(#:import-path "github.com/containers/skopeo"
1622 #:install-source? #f
1623 #:tests? #f ; The tests require Docker
1625 (modify-phases %standard-phases
1627 (lambda* (#:key import-path #:allow-other-keys)
1628 (with-directory-excursion (string-append "src/" import-path)
1629 (invoke "make" "bin/skopeo"))))
1630 (add-after 'build 'build-docs
1631 (lambda* (#:key import-path #:allow-other-keys)
1632 (with-directory-excursion (string-append "src/" import-path)
1633 (invoke "make" "docs"))))
1635 (lambda* (#:key import-path outputs #:allow-other-keys)
1636 (with-directory-excursion (string-append "src/" import-path)
1637 (let ((out (assoc-ref outputs "out")))
1638 (install-file "default-policy.json"
1639 (string-append out "/etc/containers"))
1640 (invoke "make" "install-binary" "install-completions" "install-docs"
1641 (string-append "PREFIX=" out)))))))))
1642 (home-page "https://github.com/containers/skopeo")
1643 (synopsis "Interact with container images and container image registries")
1645 "@command{skopeo} is a command line utility providing various operations
1646 with container images and container image registries. It can:
1649 @item Copy container images between various containers image stores,
1650 converting them as necessary.
1652 @item Convert a Docker schema 2 or schema 1 container image to an OCI image.
1654 @item Inspect a repository on a container registry without needlessly pulling
1657 @item Sign and verify container images.
1659 @item Delete container images from a remote container registry.
1662 (license license:asl2.0)))
1664 (define-public python-vagrant
1666 (name "python-vagrant")
1671 (uri (pypi-uri "python-vagrant" version))
1674 "1ikrh6canhcxg5y7pzmkcnnydikppv7s6sm9prfx90nk0ac8m6mg"))))
1675 (build-system python-build-system)
1677 '(#:tests? #f)) ; tests involve running vagrant.
1678 (home-page "https://github.com/todddeluca/python-vagrant")
1679 (synopsis "Python bindings for Vagrant")
1681 "Python-vagrant is a Python module that provides a thin wrapper around the
1682 @code{vagrant} command line executable, allowing programmatic control of Vagrant
1684 (license license:expat)))
1686 (define-public bubblewrap
1692 (uri (string-append "https://github.com/containers/bubblewrap/"
1693 "releases/download/v" version "/bubblewrap-"
1697 "00ycgi6q2yngh06bnz50wkvar6r2jnjf3j158grhi9k13jdrpimr"))))
1698 (build-system gnu-build-system)
1701 (modify-phases %standard-phases
1702 (add-after 'unpack 'fix-test
1703 (lambda* (#:key outputs #:allow-other-keys)
1704 ;; Tests try to access /var/tmp, which is not possible in our build
1705 ;; environment. Let's give them another directory.
1706 ;; /tmp gets overriden in some tests, so we need another directory.
1707 ;; the only possibility is the output directory.
1708 (let ((tmp-dir (string-append (assoc-ref outputs "out") "/tmp")))
1710 (substitute* "tests/test-run.sh"
1711 (("/var/tmp") tmp-dir)
1712 ;; Tests create a temporary python script, so fix its shebang.
1713 (("/usr/bin/env python") (which "python"))
1714 ;; Some tests try to access /usr, but that doesn't exist.
1715 ;; Give them /gnu instead.
1717 (("--ro-bind /bin /bin") "--ro-bind /gnu /bin")
1718 (("--ro-bind /sbin /sbin") "--ro-bind /gnu /sbin")
1719 (("--ro-bind /lib /lib") "--ro-bind /gnu /lib")
1720 ((" */bin/bash") (which "bash"))
1721 (("/bin/sh") (which "sh"))
1722 (("findmnt") (which "findmnt"))))
1724 ;; Remove the directory we gave to tests to have a clean package.
1725 (add-after 'check 'remove-tmp-dir
1726 (lambda* (#:key outputs #:allow-other-keys)
1727 (delete-file-recursively (string-append (assoc-ref outputs "out") "/tmp"))
1730 `(("libcap" ,libcap)))
1732 `(("python" ,python-wrapper)
1733 ("util-linux" ,util-linux)))
1734 (home-page "https://github.com/containers/bubblewrap")
1735 (synopsis "Unprivileged sandboxing tool")
1736 (description "Bubblewrap is aimed at running applications in a sandbox,
1737 restricting their access to parts of the operating system or user data such as
1738 the home directory. Bubblewrap always creates a new mount namespace, and the
1739 user can specify exactly what parts of the file system should be made visible
1740 in the sandbox. These directories are mounted with the @code{nodev} option
1741 by default and can be made read-only.")
1742 (license license:lgpl2.0+)))
1744 (define-public bochs
1751 (uri (string-append "https://sourceforge.net/projects/bochs/files/bochs/"
1752 version "/bochs-" version ".tar.gz"))
1754 (base32 "0ql8q6y1k356li1g9gbvl21448mlxphxxi6kjb2b3pxvzd0pp2b3"))))
1755 (build-system gnu-build-system)
1757 `(#:tests? #f)) ; no tests exist
1759 `(("libxrandr" ,libxrandr)))
1760 (home-page "http://bochs.sourceforge.net/")
1761 (synopsis "Emulator for x86 PC")
1763 "Bochs is an emulator which can emulate Intel x86 CPU, common I/O
1764 devices, and a custom BIOS. It can also be compiled to emulate many different
1765 x86 CPUs, from early 386 to the most recent x86-64 Intel and AMD processors.
1766 Bochs can run most Operating Systems inside the emulation including Linux,
1767 DOS or Microsoft Windows.")
1768 (license license:lgpl2.0+)))
1777 (url "git://xenbits.xenproject.org/xen.git")
1778 (commit (string-append "RELEASE-" version))))
1779 (file-name (git-file-name name version))
1782 "0py50n995gv909i0d1lfdcj9wcp5g1d5z6m2291jqqlfyany138g"))))
1783 (build-system gnu-build-system)
1786 (list "--enable-rpath"
1787 "--disable-qemu-traditional" ; It tries to do "git clone"
1788 "--disable-rombios" ; would try to "git clone" via etherboot.
1789 ;; TODO: Re-enable stubdom (it's "more secure" to use it).
1790 "--disable-stubdom" ; tries to "git clone" old patched newlib.
1791 (string-append "--with-initddir="
1792 (assoc-ref %outputs "out")
1794 (string-append "--with-system-qemu="
1795 (assoc-ref %build-inputs "qemu")
1796 "/bin/qemu-system-i386")
1797 (string-append "--with-system-seabios="
1798 (assoc-ref %build-inputs "seabios")
1799 "/share/firmware/bios.bin")
1800 (string-append "--with-system-ovmf="
1801 (assoc-ref %build-inputs "ovmf")
1802 "/share/firmware/ovmf_ia32.bin"))
1803 #:make-flags (list "-j" "1"
1804 "XEN_BUILD_DATE=Thu Jan 1 01:00:01 CET 1970"
1805 "XEN_BUILD_TIME=01:00:01"
1808 "SMBIOS_REL_DATE=01/01/1970"
1809 "VGABIOS_REL_DATE=01 Jan 1970"
1810 ; QEMU_TRADITIONAL_LOC
1812 "SYSCONFIG_DIR=/tmp/etc/default"
1813 (string-append "BASH_COMPLETION_DIR="
1814 (assoc-ref %outputs "out")
1815 "/etc/bash_completion.d")
1816 (string-append "BOOT_DIR="
1817 (assoc-ref %outputs "out")
1819 (string-append "DEBUG_DIR="
1820 (assoc-ref %outputs "out")
1822 (string-append "EFI_DIR="
1823 (assoc-ref %outputs "out")
1824 "/lib/efi") ; TODO lib64 ?
1825 "MINIOS_UPSTREAM_URL="
1826 ;(string-append "DISTDIR="
1827 ; (assoc-ref %outputs "out"))
1829 #:test-target "test"
1831 (modify-phases %standard-phases
1832 (add-after 'unpack 'unpack-mini-os
1833 (lambda* (#:key inputs #:allow-other-keys)
1834 (copy-recursively (assoc-ref inputs "mini-os") "extras/mini-os")
1836 (add-after 'unpack-mini-os 'patch
1837 (lambda* (#:key inputs outputs #:allow-other-keys)
1838 (substitute* "tools/firmware/Rules.mk"
1839 (("override XEN_TARGET_ARCH = x86_32")
1840 (string-append "override XEN_TARGET_ARCH = x86_32
1841 override CC = " (assoc-ref inputs "cross-gcc") "/bin/i686-linux-gnu-gcc"))
1843 (string-append "CFLAGS=-I" (assoc-ref inputs "cross-libc")
1845 (substitute* "config/x86_32.mk"
1846 (("CFLAGS += -m32 -march=i686")
1847 (string-append "CFLAGS += -march=i686 -I"
1848 (assoc-ref inputs "cross-libc")
1850 ;; /var is not in /gnu/store , so don't try to create it.
1851 (substitute* '("tools/Makefile"
1852 "tools/xenstore/Makefile"
1853 "tools/xenpaging/Makefile")
1854 (("\\$\\(INSTALL_DIR\\) .*XEN_(DUMP|LOG|RUN|LIB|PAGING)_DIR.*")
1856 (("\\$\\(INSTALL_DIR\\) .*XEN_(RUN|LIB)_STORED.*")
1858 ;; Prevent xen from creating /etc .
1859 (substitute* "tools/examples/Makefile"
1860 ((" install-readmes") "")
1861 ((" install-configs") ""))
1863 (substitute* "tools/pygrub/setup.py"
1865 ; TODO: extra_link_args = ['-Wl,-rpath=/opt/foo'],
1866 (string-append "runtime_library_dirs = ['"
1867 (assoc-ref outputs "out")
1868 "/lib'],\nlibrary_dirs =")))
1870 (add-before 'configure 'patch-xen-script-directory
1871 (lambda* (#:key outputs #:allow-other-keys)
1872 (substitute* '("configure"
1875 (("XEN_SCRIPT_DIR=.*")
1876 (string-append "XEN_SCRIPT_DIR="
1877 (assoc-ref outputs "out")
1878 "/etc/xen/scripts")))
1880 (add-before 'configure 'set-environment-up
1881 (lambda* (#:key make-flags #:allow-other-keys)
1883 (string-contains x "cross-i686-linux"))
1884 (define (filter-environment! filter-predicate
1885 environment-variable-names)
1888 (let* ((env-value (getenv env-name))
1889 (search-path (search-path-as-string->list env-value))
1890 (new-search-path (filter filter-predicate
1892 (new-env-value (list->search-path-as-string
1893 new-search-path ":")))
1894 (setenv env-name new-env-value)))
1895 environment-variable-names))
1896 (setenv "CROSS_CPATH" (getenv "CPATH"))
1897 (setenv "CROSS_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
1898 (filter-environment! cross?
1900 "CROSS_LIBRARY_PATH"))
1901 (filter-environment! (lambda (e) (not (cross? e)))
1904 ;; Guix tries to be helpful and automatically adds
1905 ;; mini-os-git-checkout/include to the include path,
1906 ;; but actually we don't want it to be there (yet).
1907 (filter-environment! (lambda (e)
1910 "mini-os-git-checkout")))
1913 (setenv "EFI_VENDOR" "guix")
1916 (lambda* (#:key make-flags #:allow-other-keys)
1917 (apply invoke "make" "world" make-flags))))))
1919 `(("acpica" ,acpica) ; TODO: patch iasl invocation.
1920 ("bridge-utils" ,bridge-utils) ; TODO: patch invocations.
1922 ("iproute" ,iproute) ; TODO: patch invocations.
1925 ("libyajl" ,libyajl)
1926 ("ncurses" ,ncurses)
1927 ("openssl" ,openssl)
1930 ("qemu" ,qemu-minimal)
1931 ("seabios" ,seabios)
1932 ("util-linux" ,util-linux "lib") ; uuid
1933 ; TODO: ocaml-findlib, ocaml-nox.
1934 ("xz" ,xz) ; for liblzma
1939 ("cmake" ,cmake-minimal)
1942 ("gettext" ,gettext-minimal)
1948 (url "http://xenbits.xen.org/git-http/mini-os.git")
1949 (commit (string-append "xen-RELEASE-" version))))
1952 "1i8pcl19n60i2m9vlg79q3nknpj209c9ic5x10wxaicx45kc107f"))
1953 (file-name "mini-os-git-checkout")))
1956 ("pkg-config" ,pkg-config)
1957 ("python" ,python-2)
1959 ("cross-gcc" ,(cross-gcc "i686-linux-gnu"
1960 #:xbinutils (cross-binutils "i686-linux-gnu")
1961 #:libc (cross-libc "i686-linux-gnu")))
1962 ("cross-libc" ,(cross-libc "i686-linux-gnu")) ; header files
1963 ("cross-libc-static" ,(cross-libc "i686-linux-gnu") "static")))
1964 (home-page "https://xenproject.org/")
1965 (synopsis "Xen Virtual Machine Monitor")
1966 (description "This package provides the Xen Virtual Machine Monitor
1967 which is a hypervisor.")
1968 ;; TODO: Some files are licensed differently. List those.
1969 (license license:gpl2)
1970 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))))
1972 (define-public osinfo-db-tools
1974 (name "osinfo-db-tools")
1978 (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-tools-"
1983 "038q3gzdbkfkhpicj0755mw1q4gbvn57pslpw8n2dp3lds9im0g9"))))
1984 (build-system meson-build-system)
1986 `(("libsoup" ,libsoup)
1987 ("libxml2" ,libxml2)
1988 ("libxslt" ,libxslt)
1989 ("json-glib" ,json-glib)
1990 ("libarchive" ,libarchive)))
1993 ("gobject-introspection" ,gobject-introspection)
1994 ("gettext" ,gettext-minimal)
1995 ("pkg-config" ,pkg-config)
1998 ("pytest" ,python-pytest)
1999 ("requests" ,python-requests)))
2000 (home-page "https://gitlab.com/libosinfo/osinfo-db-tools")
2001 (synopsis "Tools for managing the osinfo database")
2002 (description "This package contains a set of tools to assist
2003 administrators and developers in managing the database.")
2004 (license license:lgpl2.0+)))
2006 (define-public osinfo-db
2009 (version "20201011")
2012 (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-"
2016 "1zzx5gsqgzg2zki6h8vl0h7kpcrk5i2s1qhz7gcb18s7g99px8aj"))))
2017 (build-system trivial-build-system)
2019 `(#:modules ((guix build utils))
2022 (use-modules (guix build utils))
2023 (let* ((out (assoc-ref %outputs "out"))
2024 (osinfo-dir (string-append out "/share/osinfo"))
2025 (source (assoc-ref %build-inputs "source"))
2027 (string-append (assoc-ref %build-inputs "osinfo-db-tools")
2028 "/bin/osinfo-db-import")))
2029 (mkdir-p osinfo-dir)
2030 (invoke osinfo-db-import "--dir" osinfo-dir source)
2033 `(("intltool" ,intltool)
2034 ("osinfo-db-tools" ,osinfo-db-tools)))
2035 (home-page "https://gitlab.com/libosinfo/osinfo-db")
2036 (synopsis "Database of information about operating systems")
2037 (description "Osinfo-db provides the database files for use with the
2038 libosinfo library. It provides information about guest operating systems for
2039 use with virtualization provisioning tools")
2040 (license license:lgpl2.0+)))