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>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 (define-module (gnu packages virtualization)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages admin)
37 #:use-module (gnu packages assembly)
38 #:use-module (gnu packages attr)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages backup)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages bison)
43 #:use-module (gnu packages check)
44 #:use-module (gnu packages cmake)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages cross-base)
47 #:use-module (gnu packages curl)
48 #:use-module (gnu packages cyrus-sasl)
49 #:use-module (gnu packages debian)
50 #:use-module (gnu packages disk)
51 #:use-module (gnu packages dns)
52 #:use-module (gnu packages docbook)
53 #:use-module (gnu packages documentation)
54 #:use-module (gnu packages figlet)
55 #:use-module (gnu packages firmware)
56 #:use-module (gnu packages flex)
57 #:use-module (gnu packages fontutils)
58 #:use-module (gnu packages freedesktop)
59 #:use-module (gnu packages gettext)
60 #:use-module (gnu packages gl)
61 #:use-module (gnu packages glib)
62 #:use-module (gnu packages gnome)
63 #:use-module (gnu packages gnupg)
64 #:use-module (gnu packages golang)
65 #:use-module (gnu packages graphviz)
66 #:use-module (gnu packages gtk)
67 #:use-module (gnu packages haskell)
68 #:use-module (gnu packages haskell-apps)
69 #:use-module (gnu packages haskell-check)
70 #:use-module (gnu packages haskell-crypto)
71 #:use-module (gnu packages haskell-web)
72 #:use-module (gnu packages haskell-xyz)
73 #:use-module (gnu packages image)
74 #:use-module (gnu packages libbsd)
75 #:use-module (gnu packages libusb)
76 #:use-module (gnu packages linux)
77 #:use-module (gnu packages m4)
78 #:use-module (gnu packages ncurses)
79 #:use-module (gnu packages nettle)
80 #:use-module (gnu packages networking)
81 #:use-module (gnu packages onc-rpc)
82 #:use-module (gnu packages package-management)
83 #:use-module (gnu packages perl)
84 #:use-module (gnu packages pkg-config)
85 #:use-module (gnu packages polkit)
86 #:use-module (gnu packages protobuf)
87 #:use-module (gnu packages python)
88 #:use-module (gnu packages python-crypto)
89 #:use-module (gnu packages python-web)
90 #:use-module (gnu packages python-xyz)
91 #:use-module (gnu packages pulseaudio)
92 #:use-module (gnu packages selinux)
93 #:use-module (gnu packages sdl)
94 #:use-module (gnu packages sphinx)
95 #:use-module (gnu packages spice)
96 #:use-module (gnu packages ssh)
97 #:use-module (gnu packages texinfo)
98 #:use-module (gnu packages textutils)
99 #:use-module (gnu packages tls)
100 #:use-module (gnu packages web)
101 #:use-module (gnu packages wget)
102 #:use-module (gnu packages xdisorg)
103 #:use-module (gnu packages xml)
104 #:use-module (gnu packages xorg)
105 #:use-module (guix build-system cmake)
106 #:use-module (guix build-system gnu)
107 #:use-module (guix build-system go)
108 #:use-module (guix build-system meson)
109 #:use-module (guix build-system python)
110 #:use-module (guix build-system trivial)
111 #:use-module (guix download)
112 #:use-module (guix git-download)
113 #:use-module ((guix licenses) #:prefix license:)
114 #:use-module (guix packages)
115 #:use-module (guix utils)
116 #:use-module (srfi srfi-1)
117 #:use-module (ice-9 match))
119 (define (qemu-patch commit file-name sha256-bv)
120 "Return an origin for COMMIT."
124 "http://git.qemu.org/?p=qemu.git;a=commitdiff_plain;h="
126 (hash (content-hash sha256-bv sha256))
127 (file-name file-name)))
135 (uri (string-append "https://download.qemu.org/qemu-"
139 "1dlcwyshdp94fwd30pddxf9bn2q8dfw5jsvry2gvdj551wmaj4rg"))))
140 (build-system gnu-build-system)
142 `(;; Running tests in parallel can occasionally lead to failures, like:
143 ;; boot_sector_test: assertion failed (signature == SIGNATURE): (0x00000000 == 0x0000dead)
146 ;; FIXME: Disable tests on i686 to work around
147 ;; <https://bugs.gnu.org/40527>.
148 #:tests? ,(or (%current-target-system)
149 (not (string=? "i686-linux" (%current-system))))
151 #:configure-flags (list "--enable-usb-redir" "--enable-opengl"
153 (string-append "--smbd="
154 (assoc-ref %outputs "out")
155 "/libexec/samba-wrapper")
156 "--audio-drv-list=alsa,pa,sdl")
157 ;; Make build and test output verbose to facilitate investigation upon failure.
158 #:make-flags '("V=1")
159 #:modules ((srfi srfi-1)
161 ,@%gnu-build-system-modules)
163 (modify-phases %standard-phases
164 (add-after 'set-paths 'hide-glibc
165 (lambda* (#:key inputs #:allow-other-keys)
166 ;; Work around https://issues.guix.info/issue/36882. We need to
167 ;; remove glibc from C_INCLUDE_PATH so that the one hardcoded in GCC,
168 ;; at the bottom of GCC include search-path is used.
169 (let* ((filters '("libc"))
171 (filter-map (lambda (input)
174 (and (not (member name filters))
177 (set-path-environment-variable "C_INCLUDE_PATH"
181 (add-after 'patch-source-shebangs 'patch-/bin/sh-references
183 ;; Ensure the executables created by these source files reference
184 ;; /bin/sh from the store so they work inside the build container.
185 (substitute* '("block/cloop.c" "migration/exec.c"
186 "net/tap.c" "tests/qtest/libqtest.c")
187 (("/bin/sh") (which "sh")))
190 (lambda* (#:key inputs outputs (configure-flags '())
192 ;; The `configure' script doesn't understand some of the
193 ;; GNU options. Thus, add a new phase that's compatible.
194 (let ((out (assoc-ref outputs "out")))
195 (setenv "SHELL" (which "bash"))
197 ;; While we're at it, patch for tests.
198 (substitute* "tests/qemu-iotests/check"
199 (("#!/usr/bin/env python3")
200 (string-append "#!" (which "python3"))))
202 ;; Ensure config.status gets the correct shebang off the bat.
203 ;; The build system gets confused if we change it later and
204 ;; attempts to re-run the whole configury, and fails.
205 (substitute* "configure"
207 (string-append "#!" (which "sh"))))
209 ;; The binaries need to be linked against -lrt.
210 (setenv "LDFLAGS" "-lrt")
213 ,(string-append "--cc=" (which "gcc"))
214 ;; Some architectures insist on using HOST_CC
215 ,(string-append "--host-cc=" (which "gcc"))
216 "--disable-debug-info" ; save build space
217 "--enable-virtfs" ; just to be sure
218 ,(string-append "--prefix=" out)
219 ,(string-append "--sysconfdir=/etc")
220 ,@configure-flags)))))
221 (add-after 'install 'install-info
222 (lambda* (#:key inputs outputs #:allow-other-keys)
223 ;; Install the Info manual, unless Texinfo is missing.
224 (when (assoc-ref inputs "texinfo")
225 (let* ((out (assoc-ref outputs "out"))
226 (dir (string-append out "/share/info")))
227 (invoke "make" "info")
228 (for-each (lambda (info)
229 (install-file info dir))
230 (find-files "." "\\.info"))))
232 ;; Create a wrapper for Samba. This allows QEMU to use Samba without
233 ;; pulling it in as an input. Note that you need to explicitly install
234 ;; Samba in your Guix profile for Samba support.
235 (add-after 'install-info 'create-samba-wrapper
236 (lambda* (#:key inputs outputs #:allow-other-keys)
237 (let* ((out (assoc-ref %outputs "out"))
238 (libexec (string-append out "/libexec")))
239 (call-with-output-file "samba-wrapper"
241 (format port "#!/bin/sh
243 (chmod "samba-wrapper" #o755)
244 (install-file "samba-wrapper" libexec))
246 (add-before 'check 'disable-unusable-tests
247 (lambda* (#:key inputs outputs #:allow-other-keys)
248 (substitute* "tests/Makefile.include"
249 ;; Comment out the test-qga test, which needs /sys and
250 ;; fails within the build environment.
251 (("check-unit-.* tests/test-qga" all)
252 (string-append "# " all)))
253 (substitute* "tests/Makefile.include"
254 ;; Comment out the test-char test, which needs networking and
255 ;; fails within the build environment.
256 (("check-unit-.* tests/test-char" all)
257 (string-append "# " all)))
259 (inputs ; TODO: Add optional inputs.
260 `(("alsa-lib" ,alsa-lib)
266 ("libcacard" ,libcacard) ; smartcard support
267 ("libcap-ng" ,libcap-ng) ; virtfs support requires libcap-ng & libattr
269 ("libepoxy" ,libepoxy)
270 ("libjpeg" ,libjpeg-turbo)
272 ("libseccomp" ,libseccomp)
273 ("libusb" ,libusb) ;USB pass-through support
276 ;; ("pciutils" ,pciutils)
278 ("pulseaudio" ,pulseaudio)
281 ("usbredir" ,usbredir)
282 ("util-linux" ,util-linux)
284 ("virglrenderer" ,virglrenderer)
286 (native-inputs `(("gettext" ,gettext-minimal)
287 ("glib:bin" ,glib "bin") ; gtester, etc.
291 ("pkg-config" ,pkg-config)
292 ("python-wrapper" ,python-wrapper)
293 ("python-sphinx" ,python-sphinx)
294 ("texinfo" ,texinfo)))
295 (home-page "https://www.qemu.org")
296 (synopsis "Machine emulator and virtualizer")
298 "QEMU is a generic machine emulator and virtualizer.
300 When used as a machine emulator, QEMU can run OSes and programs made for one
301 machine (e.g. an ARM board) on a different machine---e.g., your own PC. By
302 using dynamic translation, it achieves very good performance.
304 When used as a virtualizer, QEMU achieves near native performances by
305 executing the guest code directly on the host CPU. QEMU supports
306 virtualization when executing under the Xen hypervisor or using
307 the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86,
308 server and embedded PowerPC, and S390 guests.")
310 ;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'.
311 (license license:gpl2)
313 ;; Several tests fail on MIPS; see <http://hydra.gnu.org/build/117914>.
314 (supported-systems (fold delete %supported-systems
315 '("mips64el-linux" "i586-gnu")))))
317 (define-public qemu-minimal
318 ;; QEMU without GUI support, only supporting the host's architecture
319 (package (inherit qemu)
320 (name "qemu-minimal")
322 "Machine emulator and virtualizer (without GUI) for the host architecture")
324 (substitute-keyword-arguments (package-arguments qemu)
325 ((#:configure-flags _ '(list))
326 ;; Restrict to the host's architecture.
327 (match (car (string-split (or (%current-target-system)
331 '(list "--target-list=i386-softmmu"))
333 '(list "--target-list=i386-softmmu,x86_64-softmmu"))
335 '(list (string-append "--target-list=mips-softmmu,mipsel-softmmu,"
336 "mips64-softmmu,mips64el-softmmu")))
338 '(list "--target-list=mips-softmmu,mipsel-softmmu"))
340 '(list "--target-list=arm-softmmu,aarch64-softmmu"))
342 '(list "--target-list=arm-softmmu"))
344 '(list "--target-list=alpha-softmmu"))
346 '(list "--target-list=ppc-softmmu,ppc64-softmmu"))
348 '(list "--target-list=ppc-softmmu"))
350 '(list "--target-list=s390x-softmmu"))
352 '(list "--target-list=riscv32-softmmu,riscv64-softmmu"))
353 (else ; An empty list actually builds all the targets.
356 ;; Remove dependencies on optional libraries, notably GUI libraries.
357 (native-inputs (fold alist-delete (package-native-inputs qemu)
359 (inputs (fold alist-delete (package-inputs qemu)
360 '("libusb" "mesa" "sdl2" "spice" "virglrenderer" "gtk+"
361 "usbredir" "libdrm" "libepoxy" "pulseaudio" "vde2"
364 (define (system->qemu-target system)
366 ((string-prefix? "i686" system)
368 ((string-prefix? "arm" system)
371 (string-append "qemu-system-" (match (string-split system #\-)
375 (define-public ganeti
378 ;; Note: we use a pre-release for Python 3 compatibility as well as many
380 (version "3.0.0beta1-24-g024cc9fa2")
384 (url "https://github.com/ganeti/ganeti")
385 (commit (string-append "v" version))))
387 (base32 "1ll34qd2mifni3bhg7cnir3xfnkafig8ch33qndqwrsby0y5ssia"))
388 (file-name (git-file-name name version))
389 (patches (search-patches "ganeti-shepherd-support.patch"
390 "ganeti-shepherd-master-failover.patch"
391 "ganeti-deterministic-manual.patch"
392 "ganeti-drbd-compat.patch"
393 "ganeti-os-disk-size.patch"
394 "ganeti-haskell-pythondir.patch"
395 "ganeti-disable-version-symlinks.patch"
396 "ganeti-preserve-PYTHONPATH.patch"))))
397 (build-system gnu-build-system)
399 `(#:imported-modules (,@%gnu-build-system-modules
400 (guix build haskell-build-system)
401 (guix build python-build-system))
402 #:modules (,@%gnu-build-system-modules
403 ((guix build haskell-build-system) #:prefix haskell:)
404 ((guix build python-build-system) #:select (python-version))
407 ;; The default test target includes a lot of checks that are only really
408 ;; relevant for developers such as NEWS file checking, line lengths, etc.
409 ;; We are only interested in the "py-tests" and "hs-tests" targets: this
410 ;; is the closest we've got even though it includes a little more.
411 #:test-target "check-TESTS"
414 (list "--localstatedir=/var"
415 "--sharedstatedir=/var"
417 "--enable-haskell-tests"
419 ;; By default, the build system installs everything to versioned
420 ;; directories such as $libdir/3.0 and relies on a $libdir/default
421 ;; symlink pointed from /etc/ganeti/{lib,share} to actually function.
422 ;; This is done to accommodate installing multiple versions in
423 ;; parallel, but is of little use to us as Guix users can just
424 ;; roll back and forth. Thus, disable it for simplicity.
425 "--disable-version-links"
427 ;; Ganeti can optionally take control over SSH host keys and
428 ;; distribute them to nodes as they are added, and also rotate keys
429 ;; with 'gnt-cluster renew-crypto --new-ssh-keys'. Thus it needs to
430 ;; know how to restart the SSH daemon.
431 "--with-sshd-restart-command='herd restart ssh-daemon'"
433 ;; Look for OS definitions in this directory by default. It can
434 ;; be changed in the cluster configuration.
435 "--with-os-search-path=/run/current-system/profile/share/ganeti/os"
437 ;; The default QEMU executable to use. We don't use the package
438 ;; here because this entry is stored in the cluster configuration.
439 (string-append "--with-kvm-path=/run/current-system/profile/bin/"
440 ,(system->qemu-target (%current-system))))
442 (modify-phases %standard-phases
443 (add-after 'unpack 'create-vcs-version
445 ;; If we are building from a git checkout, we need to create a
446 ;; 'vcs-version' file manually because the build system does
447 ;; not have access to the git repository information.
448 (unless (file-exists? "vcs-version")
449 (call-with-output-file "vcs-version"
451 (format port "v~a~%" ,version))))
453 (add-after 'unpack 'patch-absolute-file-names
455 (substitute* '("lib/utils/process.py"
457 "src/Ganeti/Constants.hs"
458 "src/Ganeti/HTools/CLI.hs"
459 "test/py/ganeti.config_unittest.py"
460 "test/py/ganeti.hooks_unittest.py"
461 "test/py/ganeti.utils.process_unittest.py"
462 "test/py/ganeti.utils.text_unittest.py"
463 "test/py/ganeti.utils.wrapper_unittest.py")
464 (("/bin/sh") (which "sh"))
465 (("/bin/bash") (which "bash"))
466 (("/usr/bin/env") (which "env"))
467 (("/bin/true") (which "true")))
469 ;; This script is called by the node daemon at startup to perform
470 ;; sanity checks on the cluster IP addresses, and it is also used
471 ;; in a master-failover scenario. Add absolute references to
472 ;; avoid propagating these executables.
473 (substitute* "tools/master-ip-setup"
474 (("arping") (which "arping"))
475 (("ndisc6") (which "ndisc6"))
476 (("fping") (which "fping"))
477 (("grep") (which "grep"))
478 (("ip addr") (string-append (which "ip") " addr")))
480 (add-after 'unpack 'override-builtin-PATH
482 ;; Ganeti runs OS install scripts and similar with a built-in
483 ;; hard coded PATH. Patch so it works on Guix System.
484 (substitute* "src/Ganeti/Constants.hs"
485 (("/sbin:/bin:/usr/sbin:/usr/bin")
486 "/run/setuid-programs:/run/current-system/profile/sbin:\
487 /run/current-system/profile/bin"))
489 (add-after 'bootstrap 'patch-sphinx-version-detection
491 ;; The build system runs 'sphinx-build --version' to verify that
492 ;; the Sphinx is recent enough, but does not expect the
493 ;; .sphinx-build-real executable name created by the Sphinx wrapper.
494 (substitute* "configure"
495 (("\\$SPHINX --version 2>&1")
496 "$SPHINX --version 2>&1 | sed 's/.sphinx-build-real/sphinx-build/g'"))
499 ;; The build system invokes Cabal and GHC, which do not work with
500 ;; GHC_PACKAGE_PATH: <https://github.com/haskell/cabal/issues/3728>.
501 ;; Tweak the build system to do roughly what haskell-build-system does.
502 (add-before 'configure 'configure-haskell
503 (assoc-ref haskell:%standard-phases 'setup-compiler))
504 (add-after 'configure 'do-not-use-GHC_PACKAGE_PATH
506 (unsetenv "GHC_PACKAGE_PATH")
507 (substitute* "Makefile"
509 "$(CABAL) --package-db=../package.conf.d")
511 "$(GHC) -package-db=../package.conf.d"))
513 (add-after 'configure 'make-ghc-use-shared-libraries
515 (substitute* "Makefile"
516 (("HFLAGS =") "HFLAGS = -dynamic -fPIC"))
518 (add-after 'configure 'fix-installation-directories
520 (substitute* "Makefile"
521 ;; Do not attempt to create /var during install.
522 (("\\$\\(DESTDIR\\)\\$\\{localstatedir\\}")
523 "$(DESTDIR)${prefix}${localstatedir}")
524 ;; Similarly, do not attempt to install the sample ifup scripts
526 (("\\$\\(DESTDIR\\)\\$\\(ifupdir\\)")
527 "$(DESTDIR)${prefix}$(ifupdir)"))
529 (add-before 'build 'adjust-tests
531 ;; Disable tests that can not run. Do it early to prevent
532 ;; touching the Makefile later and triggering a needless rebuild.
533 (substitute* "Makefile"
534 ;; These tests expect the presence of a 'root' user (via
535 ;; ganeti/runtime.py), which fails in the build environment.
536 (("test/py/ganeti\\.asyncnotifier_unittest\\.py") "")
537 (("test/py/ganeti\\.backend_unittest\\.py") "")
538 (("test/py/ganeti\\.daemon_unittest\\.py") "")
539 (("test/py/ganeti\\.tools\\.ensure_dirs_unittest\\.py") "")
540 (("test/py/ganeti\\.utils\\.io_unittest-runasroot\\.py") "")
541 ;; Disable the bash_completion test, as it requires the full
542 ;; bash instead of bash-minimal.
543 (("test/py/bash_completion\\.bash")
545 ;; This test requires networking.
546 (("test/py/import-export_unittest\\.bash")
549 ;; Many of the Makefile targets reset PYTHONPATH before running
550 ;; the Python interpreter, which does not work very well for us.
551 (substitute* "Makefile"
553 (string-append "PYTHONPATH=" (getenv "PYTHONPATH") ":")))
555 (add-after 'build 'build-bash-completions
557 (let ((orig-pythonpath (getenv "PYTHONPATH")))
558 (setenv "PYTHONPATH" (string-append ".:" orig-pythonpath))
559 (invoke "./autotools/build-bash-completion")
560 (setenv "PYTHONPATH" orig-pythonpath)
562 (add-before 'check 'pre-check
563 (lambda* (#:key inputs #:allow-other-keys)
564 ;; Set TZDIR so that time zones are found.
565 (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
568 ;; This test checks whether PYTHONPATH is untouched, and extends
569 ;; it to include test directories if so. Add an else branch for
570 ;; our modified PYTHONPATH, in order to prevent a confusing test
571 ;; failure where expired certificates are not cleaned because
572 ;; check-cert-expired is silently crashing.
573 (substitute* "test/py/ganeti-cleaner_unittest.bash"
574 (("then export PYTHONPATH=(.*)" all testpath)
575 (string-append all "else export PYTHONPATH="
576 (getenv "PYTHONPATH") ":" testpath "\n")))
578 (substitute* "test/py/ganeti.utils.process_unittest.py"
579 ;; This test attempts to run an executable with
580 ;; RunCmd(..., reset_env=True), which fails because the default
581 ;; PATH from Constants.hs does not exist in the build container.
582 ((".*def testResetEnv.*" all)
583 (string-append " @unittest.skipIf(True, "
584 "\"cannot reset env in the build container\")\n"
587 ;; XXX: Somehow this test fails in the build container, but
588 ;; works in 'guix environment -C', even without /bin/sh?
589 ((".*def testPidFile.*" all)
590 (string-append " @unittest.skipIf(True, "
591 "\"testPidFile fails in the build container\")\n"
594 ;; XXX: Why are these links not added automatically.
595 (with-directory-excursion "test/hs"
596 (for-each (lambda (file)
597 (symlink "../../src/htools" file))
598 '("hspace" "hscan" "hinfo" "hbal" "hroller"
599 "hcheck" "hail" "hsqueeze")))
601 (add-after 'install 'install-bash-completions
602 (lambda* (#:key outputs #:allow-other-keys)
603 (let* ((out (assoc-ref outputs "out"))
604 (compdir (string-append out "/etc/bash_completion.d")))
606 (copy-file "doc/examples/bash_completion"
607 (string-append compdir "/ganeti"))
608 ;; The one file contains completions for many different
609 ;; executables. Create symlinks for found completions.
610 (with-directory-excursion compdir
612 (lambda (prog) (symlink "ganeti" prog))
613 (call-with-input-file "ganeti"
615 (let loop ((line (read-line port))
617 (if (eof-object? line)
619 (if (string-prefix? "complete" line)
620 (loop (read-line port)
621 ;; Extract "prog" from lines of the form:
622 ;; "complete -F _prog -o filenames prog".
623 ;; Note that 'burnin' is listed with the
624 ;; absolute file name, which is why we
625 ;; run everything through 'basename'.
626 (cons (basename (car (reverse (string-split
629 (loop (read-line port) progs))))))))
631 ;; Wrap all executables with PYTHONPATH. We can't borrow the phase
632 ;; from python-build-system because we also need to wrap the scripts
633 ;; in $out/lib/ganeti such as "node-daemon-setup".
634 (add-after 'install 'wrap
635 (lambda* (#:key inputs outputs #:allow-other-keys)
636 (let* ((out (assoc-ref outputs "out"))
637 (sbin (string-append out "/sbin"))
638 (lib (string-append out "/lib"))
639 (python (assoc-ref inputs "python"))
640 (major+minor (python-version python))
641 (PYTHONPATH (string-append lib "/python" major+minor
643 (getenv "PYTHONPATH"))))
644 (define (shell-script? file)
645 (call-with-ascii-input-file file
647 (let ((shebang (false-if-exception (read-line port))))
649 (string-prefix? "#!" shebang)
650 (or (string-contains shebang "/bin/bash")
651 (string-contains shebang "/bin/sh")))))))
654 ;; Do not wrap shell scripts because some are meant to be
655 ;; sourced, which breaks if they are wrapped. We do wrap
656 ;; the Haskell executables because some call out to Python
658 (and (executable-file? file)
659 (not (symbolic-link? file))
660 (not (shell-script? file))))
662 (for-each (lambda (file)
664 `("PYTHONPATH" ":" prefix (,PYTHONPATH))))
666 (append (find-files (string-append lib "/ganeti"))
671 ("cabal" ,cabal-install)
674 ;; These inputs are necessary to bootstrap the package, because we
675 ;; have patched the build system.
676 ("autoconf" ,autoconf)
677 ("automake" ,automake)
679 ;; For the documentation.
680 ("python-docutils" ,python-docutils)
681 ("sphinx" ,python-sphinx)
685 ;; Test dependencies.
686 ("fakeroot" ,fakeroot)
687 ("ghc-temporary" ,ghc-temporary)
688 ("ghc-test-framework" ,ghc-test-framework)
689 ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
690 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
691 ("python-mock" ,python-mock)
692 ("python-pyyaml" ,python-pyyaml)
695 ("shelltestrunner" ,shelltestrunner)
696 ("tzdata" ,tzdata-for-tests)))
698 `(("arping" ,iputils) ;must be the iputils version
701 ("iproute2" ,iproute)
704 ("qemu" ,qemu-minimal) ;for qemu-img
705 ("ghc-attoparsec" ,ghc-attoparsec)
706 ("ghc-base64-bytestring" ,ghc-base64-bytestring)
707 ("ghc-cryptonite" ,ghc-cryptonite)
708 ("ghc-curl" ,ghc-curl)
709 ("ghc-hinotify" ,ghc-hinotify)
710 ("ghc-hslogger" ,ghc-hslogger)
711 ("ghc-json" ,ghc-json)
712 ("ghc-lens" ,ghc-lens)
713 ("ghc-lifted-base" ,ghc-lifted-base)
714 ("ghc-network" ,ghc-network)
715 ("ghc-old-time" ,ghc-old-time)
716 ("ghc-psqueue" ,ghc-psqueue)
717 ("ghc-regex-pcre" ,ghc-regex-pcre)
718 ("ghc-utf8-string" ,ghc-utf8-string)
719 ("ghc-zlib" ,ghc-zlib)
721 ;; For the optional metadata daemon.
722 ("ghc-snap-core" ,ghc-snap-core)
723 ("ghc-snap-server" ,ghc-snap-server)
726 ("python-pyopenssl" ,python-pyopenssl)
727 ("python-simplejson" ,python-simplejson)
728 ("python-pyparsing" ,python-pyparsing)
729 ("python-pyinotify" ,python-pyinotify)
730 ("python-pycurl" ,python-pycurl)
731 ("python-bitarray" ,python-bitarray)
732 ("python-paramiko" ,python-paramiko)
733 ("python-psutil" ,python-psutil)))
734 (home-page "http://www.ganeti.org/")
735 (synopsis "Cluster-based virtual machine management system")
737 "Ganeti is a virtual machine management tool built on top of existing
738 virtualization technologies such as Xen or KVM. Ganeti controls:
741 @item Disk creation management;
742 @item Operating system installation for instances (in co-operation with
743 OS-specific install scripts); and
744 @item Startup, shutdown, and failover between physical systems.
747 Ganeti is designed to facilitate cluster management of virtual servers and
748 to provide fast and simple recovery after physical failures, using
749 commodity hardware.")
750 (license license:bsd-2)))
752 (define-public ganeti-instance-guix
754 (name "ganeti-instance-guix")
756 (home-page "https://github.com/mbakke/ganeti-instance-guix")
759 (uri (git-reference (url home-page) (commit version)))
760 (file-name (git-file-name name version))
763 "0aa08irpcpns6mhjgsplc5f0p8ab1qcr9ah1gj5z66kxgqyflzrp"))))
764 (build-system gnu-build-system)
766 '(#:configure-flags '("--sysconfdir=/etc" "--localstatedir=/var")))
768 `(("autoconf" ,autoconf)
769 ("automake" ,automake)))
771 `(("util-linux" ,util-linux)
772 ("qemu-img" ,qemu-minimal)))
773 (synopsis "Guix OS integration for Ganeti")
775 "This package provides a guest OS definition for Ganeti that uses
776 Guix to build virtual machines.")
777 (license license:gpl3+)))
779 (define-public ganeti-instance-debootstrap
781 (name "ganeti-instance-debootstrap")
782 ;; We need two commits on top of the latest release for compatibility
783 ;; with newer sfdisk, as well as gnt-network integration.
784 (version "0.16-2-ge145396")
785 (home-page "https://github.com/ganeti/instance-debootstrap")
788 (uri (git-reference (url home-page) (commit version)))
789 (file-name (git-file-name name version))
792 "0f2isw9d8lawzj21rrq1q9xhq8xfa65rqbhqmrn59z201x9q1336"))))
793 (build-system gnu-build-system)
795 '(#:configure-flags '("--sysconfdir=/etc" "--localstatedir=/var")
796 #:phases (modify-phases %standard-phases
797 (add-after 'unpack 'add-absolute-references
799 (substitute* "common.sh.in"
800 (("/sbin/blkid") (which "blkid"))
802 (string-append (which "kpartx") " -")))
803 (substitute* "import"
805 (string-append (which "restore") " -r")))
806 (substitute* "export"
808 (string-append (which "dump") " -0")))
809 (substitute* "create"
810 (("debootstrap") (which "debootstrap"))
811 (("`which run-parts`") (which "run-parts"))
812 ;; Here we actually need to hard code /bin/passwd
813 ;; because it's called via chroot, which fails if
814 ;; "/bin" is not in PATH.
815 (("passwd") "/bin/passwd"))
817 (add-after 'unpack 'set-dpkg-arch
818 (lambda* (#:key system #:allow-other-keys)
819 ;; The create script passes --arch to debootstrap,
820 ;; and defaults to `dpkg --print-architecture` when
821 ;; ARCH is not set in variant.conf. Hard code the
822 ;; build-time architecture to avoid the dpkg dependency.
824 (cond ((string-prefix? "x86_64" system)
826 ((string-prefix? "i686" system)
828 ((string-prefix? "aarch64" system)
830 (else (car (string-split system #\-))))))
831 (substitute* "create"
832 (("`dpkg --print-architecture`")
835 (add-after 'configure 'adjust-Makefile
837 ;; Do not attempt to create /etc/ganeti/instance-debootstrap
838 ;; and /etc/default/ganeti-instance-debootstrap during install.
839 ;; They are created by the Ganeti service.
840 (substitute* "Makefile"
841 (("\\$\\(variantsdir\\)")
842 "$(prefix)/etc/ganeti/instance-debootstrap/variants")
843 (("\\$\\(defaultsdir\\)")
844 "$(prefix)/etc/default/ganeti-instance-debootstrap"))
846 (add-after 'install 'make-variants.list-symlink
847 (lambda* (#:key outputs #:allow-other-keys)
848 ;; The Ganeti OS API mandates a variants.list file that
849 ;; describes all supported "variants" of this OS.
850 ;; Guix generates this file, so make the original file
852 (with-directory-excursion (string-append
853 (assoc-ref outputs "out")
854 "/share/ganeti/os/debootstrap")
855 (delete-file "variants.list")
856 (symlink "/etc/ganeti/instance-debootstrap/variants/variants.list"
860 `(("autoconf" ,autoconf)
861 ("automake" ,automake)))
863 `(("debianutils" ,debianutils)
864 ("debootstrap" ,debootstrap)
866 ("kpartx" ,multipath-tools)
867 ("util-linux" ,util-linux)))
868 (synopsis "Debian OS integration for Ganeti")
870 "This package provides a guest OS definition for Ganeti. It installs
871 Debian or a derivative using @command{debootstrap}.")
872 (license license:gpl2+)))
874 (define-public libosinfo
881 (uri (string-append "https://releases.pagure.org/libosinfo/libosinfo-"
885 "1s97sv24bybggjx6hgqba2qdqz3ivfpd4cmkh4zm5y59sim109mv"))))
886 (build-system meson-build-system)
889 (list (string-append "-Dwith-usb-ids-path="
890 (assoc-ref %build-inputs "usb.ids"))
891 (string-append "-Dwith-pci-ids-path="
892 (assoc-ref %build-inputs "pci.ids")))
894 (modify-phases %standard-phases
895 (add-after 'unpack 'patch-osinfo-path
896 (lambda* (#:key inputs #:allow-other-keys)
897 (substitute* "osinfo/osinfo_loader.c"
898 (("path = DATA_DIR.*")
899 (string-append "path = \"" (assoc-ref inputs "osinfo-db")
900 "/share/osinfo\";")))
903 `(("libsoup" ,libsoup)
906 ("osinfo-db" ,osinfo-db)))
908 `(("glib" ,glib "bin") ; glib-mkenums, etc.
909 ("gobject-introspection" ,gobject-introspection)
912 ("intltool" ,intltool)
913 ("pkg-config" ,pkg-config)
917 (uri "https://github.com/pciutils/pciids/raw/ad02084f0bc143e3c15e31a6152a3dfb1d7a3156/pci.ids")
920 "0kfhpj5rnh24hz2714qhfmxk281vwc2w50sm73ggw5d15af7zfsw"))))
924 (uri "https://svn.code.sf.net/p/linux-usb/repo/trunk/htdocs/usb.ids?r=2681")
925 (file-name "usb.ids")
928 "1m6yhvz5k8aqzxgk7xj3jkk8frl1hbv0h3vgj4wbnvnx79qnvz3r"))))))
929 (home-page "https://libosinfo.org/")
930 (synopsis "Operating system information database")
931 (description "libosinfo is a GObject based library API for managing
932 information about operating systems, hypervisors and the (virtual) hardware
933 devices they can support. It includes a database containing device metadata
934 and provides APIs to match/identify optimal devices for deploying an operating
935 system on a hypervisor. Via GObject Introspection, the API is available in
936 all common programming languages. Vala bindings are also provided.")
937 ;; The library files are released under LGPLv2.1 or later; the source
938 ;; files in the "tools" directory are released under GPLv2+.
939 (license (list license:lgpl2.1+ license:gpl2+))))
948 "https://linuxcontainers.org/downloads/lxc/lxc-"
952 "1igxqgx8q9cp15mcp1y8j564bl85ijw04jcmgb1s5bmfbg1751sd"))))
953 (build-system gnu-build-system)
955 `(("pkg-config" ,pkg-config)))
959 ("libseccomp" ,libseccomp)
960 ("libselinux" ,libselinux)))
963 (list (string-append "--docdir=" (assoc-ref %outputs "out")
964 "/share/doc/" ,name "-" ,version)
966 "--localstatedir=/var")
968 (modify-phases %standard-phases
970 (lambda* (#:key outputs #:allow-other-keys)
971 (let* ((out (assoc-ref outputs "out"))
972 (bashcompdir (string-append out "/etc/bash_completion.d")))
973 (invoke "make" "install"
974 (string-append "bashcompdir=" bashcompdir)
975 ;; Don't install files into /var and /etc.
976 "LXCPATH=/tmp/var/lib/lxc"
977 "localstatedir=/tmp/var"
978 "sysconfdir=/tmp/etc"
979 "sysconfigdir=/tmp/etc/default")))))))
980 (synopsis "Linux container tools")
981 (home-page "https://linuxcontainers.org/")
983 "LXC is a userspace interface for the Linux kernel containment features.
984 Through a powerful API and simple tools, it lets Linux users easily create and
985 manage system or application containers.")
986 (license license:lgpl2.1+)))
988 (define-public libvirt
995 (uri (string-append "https://libvirt.org/sources/libvirt-"
998 (base32 "0m8cqaqflvys5kaqpvb0qr4k365j09jc5xk6x70yvg8qkcl2hcz2"))
1000 (search-patches "libvirt-create-machine-cgroup.patch"))))
1001 (build-system gnu-build-system)
1005 "--with-qemu-user=nobody"
1006 "--with-qemu-group=kvm"
1008 (string-append "--docdir=" (assoc-ref %outputs "out") "/share/doc/"
1011 "--localstatedir=/var")
1013 (modify-phases %standard-phases
1014 (add-before 'configure 'fix-BOURNE_SHELL-definition
1015 ;; BOURNE_SHELL is hard-#defined to ‘/bin/sh’, causing test failures.
1017 (substitute* "config.h.in"
1018 (("/bin/sh") (which "sh")))
1020 (add-before 'configure 'patch-libtirpc-file-names
1021 (lambda* (#:key inputs #:allow-other-keys)
1022 ;; libvirt uses an m4 macro instead of pkg-config to determine where
1023 ;; the RPC headers are located. Tell it to look in the right place.
1024 (substitute* "configure"
1025 (("/usr/include/tirpc") ;defined in m4/virt-xdr.m4
1026 (string-append (assoc-ref inputs "libtirpc")
1029 (add-before 'configure 'disable-broken-tests
1031 (let ((tests (list "commandtest" ; hangs idly
1032 "qemuxml2argvtest" ; fails
1033 "qemuhotplugtest" ; fails
1034 "virnetsockettest" ; tries to network
1035 "virshtest"))) ; fails
1036 (substitute* "tests/Makefile.in"
1037 (((format #f "(~a)\\$\\(EXEEXT\\)" (string-join tests "|")))
1041 ;; Since the sysconfdir and localstatedir should be /etc and /var
1042 ;; at runtime, we must prevent writing to them at installation
1044 (lambda* (#:key make-flags #:allow-other-keys)
1045 (apply invoke "make" "install"
1046 "sysconfdir=/tmp/etc"
1047 "localstatedir=/tmp/var"
1050 `(("libxml2" ,libxml2)
1052 ("libpciaccess" ,libpciaccess)
1055 ("libpcap" ,libpcap)
1057 ("libtirpc" ,libtirpc) ;for <rpc/rpc.h>
1058 ("libuuid" ,util-linux "lib")
1059 ("lvm2" ,lvm2) ;for libdevmapper
1061 ("openssl" ,openssl)
1062 ("cyrus-sasl" ,cyrus-sasl)
1063 ("libyajl" ,libyajl)
1065 ("dmidecode" ,dmidecode)
1066 ("dnsmasq" ,dnsmasq)
1067 ("ebtables" ,ebtables)
1068 ("iproute" ,iproute)
1069 ("iptables" ,iptables)))
1071 `(("xsltproc" ,libxslt)
1073 ("pkg-config" ,pkg-config)
1075 ("python" ,python-wrapper)))
1076 (home-page "https://libvirt.org")
1077 (synopsis "Simple API for virtualization")
1078 (description "Libvirt is a C toolkit to interact with the virtualization
1079 capabilities of recent versions of Linux. The library aims at providing long
1080 term stable C API initially for the Xen paravirtualization but should be able
1081 to integrate other virtualization mechanisms if needed.")
1082 (license license:lgpl2.1+)))
1084 (define-public libvirt-glib
1086 (name "libvirt-glib")
1090 (uri (string-append "ftp://libvirt.org/libvirt/glib/"
1091 "libvirt-glib-" version ".tar.gz"))
1094 "1zpbv4ninc57c9rw4zmmkvvqn7154iv1qfr20kyxn8xplalqrzvz"))))
1095 (build-system gnu-build-system)
1097 `(("openssl" ,openssl)
1098 ("cyrus-sasl" ,cyrus-sasl)
1099 ("lvm2" ,lvm2) ; for libdevmapper
1100 ("libyajl" ,libyajl)))
1102 `(("pkg-config" ,pkg-config)
1103 ("intltool" ,intltool)
1104 ("glib" ,glib "bin")
1107 ;; ‘Required:’ by the installed .pc files.
1109 ("libvirt" ,libvirt)
1110 ("libxml2" ,libxml2)
1111 ("gobject-introspection" ,gobject-introspection)))
1112 (home-page "https://libvirt.org")
1113 (synopsis "GLib wrapper around libvirt")
1114 (description "libvirt-glib wraps the libvirt library to provide a
1115 high-level object-oriented API better suited for glib-based applications, via
1119 @item libvirt-glib - GLib main loop integration & misc helper APIs
1120 @item libvirt-gconfig - GObjects for manipulating libvirt XML documents
1121 @item libvirt-gobject - GObjects for managing libvirt objects
1124 (license license:lgpl2.1+)))
1126 (define-public python-libvirt
1128 (name "python-libvirt")
1133 (uri (string-append "https://libvirt.org/sources/python/libvirt-python-"
1136 (base32 "0kyz3lx49d8p75mvbzinxc1zgs8g7adn77y9bm15b8b4ad9zl5s6"))))
1137 (build-system python-build-system)
1140 (modify-phases %standard-phases
1141 (add-after 'unpack 'patch-nosetests-path
1142 (lambda* (#:key inputs #:allow-other-keys)
1143 (substitute* "setup.py"
1144 (("\"/usr/bin/nosetests\"")
1145 (string-append "\"" (which "nosetests") "\""))
1146 (("self\\.spawn\\(\\[sys\\.executable, nose\\]\\)")
1147 (format #f "self.spawn([\"~a\", nose])" (which "bash"))))
1150 `(("libvirt" ,libvirt)))
1152 `(("python-lxml" ,python-lxml)))
1154 `(("pkg-config" ,pkg-config)
1155 ("python-nose" ,python-nose)))
1156 (home-page "https://libvirt.org")
1157 (synopsis "Python bindings to libvirt")
1158 (description "This package provides Python bindings to the libvirt
1159 virtualization library.")
1160 (license license:lgpl2.1+)))
1162 (define-public python2-libvirt
1163 (package-with-python2 python-libvirt))
1165 (define-public virt-manager
1167 (name "virt-manager")
1171 (uri (string-append "https://virt-manager.org/download/sources"
1172 "/virt-manager/virt-manager-"
1176 "06ws0agxlip6p6n3n43knsnjyd91gqhh2dadgc33wl9lx1k8vn6g"))))
1177 (build-system python-build-system)
1179 `(#:use-setuptools? #f ; uses custom distutils 'install' command
1180 #:test-target "test_ui"
1181 #:tests? #f ; TODO The tests currently fail
1182 ; RuntimeError: Loop condition wasn't
1184 #:imported-modules ((guix build glib-or-gtk-build-system)
1185 ,@%python-build-system-modules)
1186 #:modules ((ice-9 match)
1188 (guix build python-build-system)
1189 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
1192 (modify-phases %standard-phases
1193 (add-after 'unpack 'fix-setup
1194 (lambda* (#:key outputs #:allow-other-keys)
1195 (substitute* "virtinst/buildconfig.py"
1196 (("/usr") (assoc-ref outputs "out")))
1198 (add-after 'unpack 'fix-qemu-img-reference
1199 (lambda* (#:key inputs #:allow-other-keys)
1200 (substitute* "virtconv/formats.py"
1201 (("/usr(/bin/qemu-img)" _ suffix)
1202 (string-append (assoc-ref inputs "qemu") suffix)))
1204 (add-after 'unpack 'fix-default-uri
1205 (lambda* (#:key inputs #:allow-other-keys)
1206 ;; Xen is not available for now - so only patch qemu.
1207 (substitute* "virtManager/createconn.py"
1208 (("/usr(/bin/qemu-system)" _ suffix)
1209 (string-append (assoc-ref inputs "qemu") suffix)))
1211 (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH
1212 (lambda* (#:key inputs outputs #:allow-other-keys)
1213 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
1214 (bin-files (find-files bin ".*"))
1215 (paths (map (match-lambda
1216 ((output . directory)
1217 (let* ((girepodir (string-append
1219 "/lib/girepository-1.0")))
1220 (if (file-exists? girepodir)
1223 (for-each (lambda (file)
1224 (format #t "wrapping ~a\n" file)
1226 `("GI_TYPELIB_PATH" ":" prefix
1227 ,(filter identity paths))))
1231 (lambda* (#:key tests? #:allow-other-keys)
1233 (setenv "HOME" "/tmp")
1234 (system "Xvfb :1 &")
1235 (setenv "DISPLAY" ":1")
1236 ;; Dogtail requires that Assistive Technology support be enabled
1237 (setenv "GTK_MODULES" "gail:atk-bridge")
1238 (invoke "dbus-run-session" "--" "python" "setup.py" "test_ui"))
1240 (add-after 'install 'glib-or-gtk-compile-schemas
1241 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
1242 (add-after 'install 'glib-or-gtk-wrap
1243 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
1247 ("gtk-vnc" ,gtk-vnc)
1248 ("gtksourceview" ,gtksourceview)
1249 ("libvirt" ,libvirt)
1250 ("libvirt-glib" ,libvirt-glib)
1251 ("libosinfo" ,libosinfo)
1253 ("python-libvirt" ,python-libvirt)
1254 ("python-requests" ,python-requests)
1255 ("python-pycairo" ,python-pycairo)
1256 ("python-pygobject" ,python-pygobject)
1257 ("python-libxml2" ,python-libxml2)
1258 ("spice-gtk" ,spice-gtk)))
1259 ;; virt-manager searches for qemu-img or kvm-img in the PATH.
1263 `(("glib" ,glib "bin") ; glib-compile-schemas
1264 ("gobject-introspection" ,gobject-introspection)
1265 ("gtk+" ,gtk+ "bin") ; gtk-update-icon-cache
1266 ("perl" ,perl) ; pod2man
1267 ("intltool" ,intltool)
1268 ;; The following are required for running the tests
1269 ;; ("python-dogtail" ,python-dogtail)
1270 ;; ("xvfb" ,xorg-server-for-tests)
1272 ;; ("at-spi2-core" ,at-spi2-core)
1273 ;; ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
1275 (home-page "https://virt-manager.org/")
1276 (synopsis "Manage virtual machines")
1278 "The virt-manager application is a desktop user interface for managing
1279 virtual machines through libvirt. It primarily targets KVM VMs, but also
1280 manages Xen and LXC (Linux containers). It presents a summary view of running
1281 domains, their live performance and resource utilization statistics.")
1282 (license license:gpl2+)))
1290 (uri (string-append "https://download.openvz.org/criu/criu-"
1291 version ".tar.bz2"))
1294 "1jrr3v99g18gc0hriz0avq6ccdvyya0j6wwz888sdsc4icc30gzn"))))
1295 (build-system gnu-build-system)
1297 `(#:test-target "test"
1298 #:tests? #f ; tests require mounting as root
1300 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1301 (string-append "LIBDIR=" (assoc-ref %outputs "out")
1303 (string-append "ASCIIDOC=" (assoc-ref %build-inputs "asciidoc")
1305 (string-append "XMLTO=" (assoc-ref %build-inputs "xmlto")
1308 (modify-phases %standard-phases
1310 (lambda* (#:key inputs #:allow-other-keys)
1311 ;; The includes for libnl are located in a sub-directory.
1312 (setenv "C_INCLUDE_PATH"
1313 (string-append (assoc-ref inputs "libnl")
1315 (or (getenv "C_INCLUDE_PATH") "")))
1317 (add-after 'configure 'fix-documentation
1318 (lambda* (#:key inputs outputs #:allow-other-keys)
1319 (substitute* "Documentation/Makefile"
1322 "-m custom.xsl --skip-validation -x "
1323 (assoc-ref inputs "docbook-xsl") "/xml/xsl/"
1324 ,(package-name docbook-xsl) "-"
1325 ,(package-version docbook-xsl)
1326 "/manpages/docbook.xsl")))
1328 (add-after 'unpack 'hardcode-variables
1329 (lambda* (#:key inputs #:allow-other-keys)
1330 ;; Hardcode arm version detection
1331 (substitute* "Makefile"
1332 (("ARMV.*:=.*") "ARMV := 7\n"))
1333 ;; We are currently using python-2
1334 (substitute* "crit/Makefile"
1335 (("\\$\\(PYTHON\\)") "python2"))
1336 (substitute* "lib/Makefile"
1337 (("\\$\\(PYTHON\\)")
1338 (string-append (assoc-ref inputs "python")
1341 (add-before 'build 'fix-symlink
1342 (lambda* (#:key inputs #:allow-other-keys)
1343 ;; The file 'images/google/protobuf/descriptor.proto' points to
1344 ;; /usr/include/..., which obviously does not exist.
1345 (let* ((file "google/protobuf/descriptor.proto")
1346 (target (string-append "images/" file))
1347 (source (string-append (assoc-ref inputs "protobuf")
1349 (delete-file target)
1350 (symlink source target)
1352 (add-after 'install 'wrap
1353 (lambda* (#:key inputs outputs #:allow-other-keys)
1354 ;; Make sure 'crit' runs with the correct PYTHONPATH.
1355 (let* ((out (assoc-ref outputs "out"))
1356 (path (string-append out
1358 (string-take (string-take-right
1359 (assoc-ref inputs "python") 5) 3)
1361 (getenv "PYTHONPATH"))))
1362 (wrap-program (string-append out "/bin/crit")
1363 `("PYTHONPATH" ":" prefix (,path))))
1366 `(("protobuf" ,protobuf)
1367 ("python" ,python-2)
1368 ("python2-protobuf" ,python2-protobuf)
1369 ("python2-ipaddr" ,python2-ipaddr)
1370 ("iproute" ,iproute)
1375 ("libbsd" ,libbsd)))
1377 `(("pkg-config" ,pkg-config)
1379 ("protobuf-c" ,protobuf-c)
1380 ("asciidoc" ,asciidoc)
1382 ("docbook-xml" ,docbook-xml)
1383 ("docbook-xsl" ,docbook-xsl)))
1384 (home-page "https://criu.org")
1385 (synopsis "Checkpoint and restore in user space")
1386 (description "Using this tool, you can freeze a running application (or
1387 part of it) and checkpoint it to a hard drive as a collection of files. You
1388 can then use the files to restore and run the application from the point it
1389 was frozen at. The distinctive feature of the CRIU project is that it is
1390 mainly implemented in user space.")
1391 ;; The project is licensed under GPLv2; files in the lib/ directory are
1393 (license (list license:gpl2 license:lgpl2.1))))
1395 (define-public qmpbackup
1402 (url "https://github.com/abbbi/qmpbackup")
1404 (file-name (git-file-name name version))
1407 "0swhp5byz44brhyis1a39p11fyn9q84xz5q6v2fah29r7d71kmmx"))))
1408 (build-system python-build-system)
1410 `(#:python ,python-2))
1411 (home-page "https://github.com/abbbi/qmpbackup")
1412 (synopsis "Backup and restore QEMU machines")
1413 (description "qmpbackup is designed to create and restore full and
1414 incremental backups of running QEMU virtual machines via QMP, the QEMU
1416 (license license:gpl3+)))
1418 (define-public looking-glass-client
1419 (let ((commit "182c4752d57690da7f99d5e788de9b8baea33895"))
1421 (name "looking-glass-client")
1422 (version (string-append "a12-" (string-take commit 7)))
1426 (uri (git-reference (url "https://github.com/gnif/LookingGlass")
1428 (file-name (git-file-name name version))
1431 "02bq46ndmzq9cihazzn7xq1x7q5nzm7iw4l9lqzihxcxp9famkhw"))
1432 (modules '((guix build utils)))
1435 ;; Do not create binaries optimized for the CPU of the build machine,
1436 ;; for reproducibility and compatibility. TODO: in the next version
1437 ;; of looking glass, this is exposed as a CMake configure option.
1438 (substitute* "client/CMakeLists.txt"
1442 (build-system cmake-build-system)
1443 (inputs `(("fontconfig" ,fontconfig)
1446 ("openssl" ,openssl)
1448 ("sdl2-ttf" ,sdl2-ttf)
1449 ("spice-protocol" ,spice-protocol)
1450 ("wayland" ,wayland)))
1451 (native-inputs `(("libconfig" ,libconfig)
1453 ("pkg-config" ,pkg-config)))
1455 `(#:tests? #f ;; No tests are available.
1456 #:make-flags '("CC=gcc")
1457 #:phases (modify-phases %standard-phases
1458 (add-before 'configure 'chdir-to-client
1459 (lambda* (#:key outputs #:allow-other-keys)
1462 (add-after 'chdir-to-client 'add-missing-include
1464 ;; Mimic upstream commit b9797529893, required since the
1465 ;; update to Mesa 19.2.
1466 (substitute* "renderers/egl/shader.h"
1467 (("#include <stdbool\\.h>")
1468 "#include <stdbool.h>\n#include <stddef.h>"))
1471 (lambda* (#:key outputs #:allow-other-keys)
1472 (install-file "looking-glass-client"
1473 (string-append (assoc-ref outputs "out")
1476 (home-page "https://looking-glass.hostfission.com")
1477 (synopsis "KVM Frame Relay (KVMFR) implementation")
1478 (description "Looking Glass allows the use of a KVM (Kernel-based Virtual
1479 Machine) configured for VGA PCI Pass-through without an attached physical
1480 monitor, keyboard or mouse. It displays the VM's rendered contents on your main
1482 ;; This package requires SSE instructions.
1483 (supported-systems '("i686-linux" "x86_64-linux"))
1484 (license license:gpl2+))))
1489 (version "1.0.0-rc6")
1493 "https://github.com/opencontainers/runc/releases/"
1494 "download/v" version "/runc.tar.xz"))
1495 (file-name (string-append name "-" version ".tar.xz"))
1496 (patches (search-patches "runc-CVE-2019-5736.patch"))
1499 "1c7832dq70slkjh8qp2civ1wxhhdd2hrx84pq7db1mmqc9fdr3cc"))))
1500 (build-system go-build-system)
1502 '(#:import-path "github.com/opencontainers/runc"
1503 #:install-source? #f
1504 ;; XXX: 20/139 tests fail due to missing /var, cgroups and apparmor in
1505 ;; the build environment.
1508 (modify-phases %standard-phases
1510 (lambda* (#:key source import-path #:allow-other-keys)
1511 ;; Unpack the tarball into 'runc' instead of 'runc-1.0.0-rc5'.
1512 (let ((dest (string-append "src/" import-path)))
1514 (invoke "tar" "-C" (string-append "src/" import-path)
1515 "--strip-components=1"
1518 (lambda* (#:key import-path #:allow-other-keys)
1519 (chdir (string-append "src/" import-path))
1520 ;; XXX: requires 'go-md2man'.
1521 ;; (invoke "make" "man")
1525 ;; (invoke "make" "localunittest")))
1527 (lambda* (#:key outputs #:allow-other-keys)
1528 (let ((out (assoc-ref outputs "out")))
1529 (invoke "make" "install" "install-bash"
1530 (string-append "PREFIX=" out))))))))
1532 `(("pkg-config" ,pkg-config)))
1534 `(("libseccomp" ,libseccomp)))
1535 (synopsis "Open container initiative runtime")
1536 (home-page "https://www.opencontainers.org/")
1538 "@command{runc} is a command line client for running applications
1539 packaged according to the
1540 @uref{https://github.com/opencontainers/runtime-spec/blob/master/spec.md, Open
1541 Container Initiative (OCI) format} and is a compliant implementation of the
1542 Open Container Initiative specification.")
1543 (license license:asl2.0)))
1545 (define-public umoci
1553 "https://github.com/opencontainers/umoci/releases/download/v"
1554 version "/umoci.tar.xz"))
1555 (file-name (string-append "umoci-" version ".tar.xz"))
1557 (base32 "06q7xfwnqysc013hapx31jhlzmyg8qb467qfkynj673qc7p9bd6h"))))
1558 (build-system go-build-system)
1560 '(#:import-path "github.com/opencontainers/umoci"
1561 #:install-source? #f
1563 (modify-phases %standard-phases
1565 (lambda* (#:key source import-path #:allow-other-keys)
1566 ;; Unpack the tarball into 'umoci' instead of "runc-${version}".
1567 (let ((dest (string-append "src/" import-path)))
1569 (invoke "tar" "-C" (string-append "src/" import-path)
1570 "--strip-components=1"
1573 (lambda* (#:key import-path #:allow-other-keys)
1574 (chdir (string-append "src/" import-path))
1575 ;; TODO: build manpages with 'go-md2man'.
1576 (invoke "make" "SHELL=bash")))
1578 (lambda* (#:key outputs #:allow-other-keys)
1579 (let* ((out (assoc-ref outputs "out"))
1580 (bindir (string-append out "/bin")))
1581 (install-file "umoci" bindir)
1583 (home-page "https://umo.ci/")
1584 (synopsis "Tool for modifying Open Container images")
1586 "@command{umoci} is a tool that allows for high-level modification of an
1587 Open Container Initiative (OCI) image layout and its tagged images.")
1588 (license license:asl2.0)))
1590 (define-public skopeo
1597 (url "https://github.com/projectatomic/skopeo")
1598 (commit (string-append "v" version))))
1599 (file-name (git-file-name name version))
1602 "1bagirzdzjhicn5dr691092ac3q6lhz3xngjzgqiqkxnvpz7p6cn"))))
1603 (build-system go-build-system)
1605 `(("pkg-config" ,pkg-config)))
1607 `(("btrfs-progs" ,btrfs-progs)
1609 ("libassuan" ,libassuan)
1610 ("libselinux" ,libselinux)
1611 ("libostree" ,libostree)
1616 '(#:import-path "github.com/projectatomic/skopeo"
1617 #:install-source? #f
1618 #:tests? #f ; The tests require Docker
1620 (modify-phases %standard-phases
1622 (lambda* (#:key import-path #:allow-other-keys)
1623 (chdir (string-append "src/" import-path))
1624 ;; TODO: build manpages with 'go-md2man'.
1625 (invoke "make" "binary-local")))
1627 (lambda* (#:key outputs #:allow-other-keys)
1628 (let ((out (assoc-ref outputs "out")))
1629 (invoke "make" "install-binary" "install-completions"
1630 (string-append "PREFIX=" out))))))))
1631 (home-page "https://github.com/projectatomic/skopeo")
1632 (synopsis "Interact with container images and container image registries")
1634 "@command{skopeo} is a command line utility providing various operations
1635 with container images and container image registries. It can:
1638 @item Copy container images between various containers image stores,
1639 converting them as necessary.
1641 @item Convert a Docker schema 2 or schema 1 container image to an OCI image.
1643 @item Inspect a repository on a container registry without needlessly pulling
1646 @item Sign and verify container images.
1648 @item Delete container images from a remote container registry.
1651 (license license:asl2.0)))
1653 (define-public python-vagrant
1655 (name "python-vagrant")
1660 (uri (pypi-uri "python-vagrant" version))
1663 "1ikrh6canhcxg5y7pzmkcnnydikppv7s6sm9prfx90nk0ac8m6mg"))))
1664 (build-system python-build-system)
1666 '(#:tests? #f)) ; tests involve running vagrant.
1667 (home-page "https://github.com/todddeluca/python-vagrant")
1668 (synopsis "Python bindings for Vagrant")
1670 "Python-vagrant is a Python module that provides a thin wrapper around the
1671 @code{vagrant} command line executable, allowing programmatic control of Vagrant
1673 (license license:expat)))
1675 (define-public bubblewrap
1681 (uri (string-append "https://github.com/containers/bubblewrap/"
1682 "releases/download/v" version "/bubblewrap-"
1686 "00ycgi6q2yngh06bnz50wkvar6r2jnjf3j158grhi9k13jdrpimr"))))
1687 (build-system gnu-build-system)
1690 (modify-phases %standard-phases
1691 (add-after 'unpack 'fix-test
1692 (lambda* (#:key outputs #:allow-other-keys)
1693 ;; Tests try to access /var/tmp, which is not possible in our build
1694 ;; environment. Let's give them another directory.
1695 ;; /tmp gets overriden in some tests, so we need another directory.
1696 ;; the only possibility is the output directory.
1697 (let ((tmp-dir (string-append (assoc-ref outputs "out") "/tmp")))
1699 (substitute* "tests/test-run.sh"
1700 (("/var/tmp") tmp-dir)
1701 ;; Tests create a temporary python script, so fix its shebang.
1702 (("/usr/bin/env python") (which "python"))
1703 ;; Some tests try to access /usr, but that doesn't exist.
1704 ;; Give them /gnu instead.
1706 (("--ro-bind /bin /bin") "--ro-bind /gnu /bin")
1707 (("--ro-bind /sbin /sbin") "--ro-bind /gnu /sbin")
1708 (("--ro-bind /lib /lib") "--ro-bind /gnu /lib")
1709 ((" */bin/bash") (which "bash"))
1710 (("/bin/sh") (which "sh"))
1711 (("findmnt") (which "findmnt"))))
1713 ;; Remove the directory we gave to tests to have a clean package.
1714 (add-after 'check 'remove-tmp-dir
1715 (lambda* (#:key outputs #:allow-other-keys)
1716 (delete-file-recursively (string-append (assoc-ref outputs "out") "/tmp"))
1719 `(("libcap" ,libcap)))
1721 `(("python" ,python-wrapper)
1722 ("util-linux" ,util-linux)))
1723 (home-page "https://github.com/containers/bubblewrap")
1724 (synopsis "Unprivileged sandboxing tool")
1725 (description "Bubblewrap is aimed at running applications in a sandbox,
1726 restricting their access to parts of the operating system or user data such as
1727 the home directory. Bubblewrap always creates a new mount namespace, and the
1728 user can specify exactly what parts of the file system should be made visible
1729 in the sandbox. These directories are mounted with the @code{nodev} option
1730 by default and can be made read-only.")
1731 (license license:lgpl2.0+)))
1733 (define-public bochs
1740 (uri (string-append "https://sourceforge.net/projects/bochs/files/bochs/"
1741 version "/bochs-" version ".tar.gz"))
1743 (base32 "0ql8q6y1k356li1g9gbvl21448mlxphxxi6kjb2b3pxvzd0pp2b3"))))
1744 (build-system gnu-build-system)
1746 `(#:tests? #f)) ; no tests exist
1748 `(("libxrandr" ,libxrandr)))
1749 (home-page "http://bochs.sourceforge.net/")
1750 (synopsis "Emulator for x86 PC")
1752 "Bochs is an emulator which can emulate Intel x86 CPU, common I/O
1753 devices, and a custom BIOS. It can also be compiled to emulate many different
1754 x86 CPUs, from early 386 to the most recent x86-64 Intel and AMD processors.
1755 Bochs can run most Operating Systems inside the emulation including Linux,
1756 DOS or Microsoft Windows.")
1757 (license license:lgpl2.0+)))
1766 (url "git://xenbits.xenproject.org/xen.git")
1767 (commit (string-append "RELEASE-" version))))
1768 (file-name (git-file-name name version))
1771 "0py50n995gv909i0d1lfdcj9wcp5g1d5z6m2291jqqlfyany138g"))))
1772 (build-system gnu-build-system)
1775 (list "--enable-rpath"
1776 "--disable-qemu-traditional" ; It tries to do "git clone"
1777 "--disable-rombios" ; would try to "git clone" via etherboot.
1778 ;; TODO: Re-enable stubdom (it's "more secure" to use it).
1779 "--disable-stubdom" ; tries to "git clone" old patched newlib.
1780 (string-append "--with-initddir="
1781 (assoc-ref %outputs "out")
1783 (string-append "--with-system-qemu="
1784 (assoc-ref %build-inputs "qemu")
1785 "/bin/qemu-system-i386")
1786 (string-append "--with-system-seabios="
1787 (assoc-ref %build-inputs "seabios")
1788 "/share/firmware/bios.bin")
1789 (string-append "--with-system-ovmf="
1790 (assoc-ref %build-inputs "ovmf")
1791 "/share/firmware/ovmf_ia32.bin"))
1792 #:make-flags (list "-j" "1"
1793 "XEN_BUILD_DATE=Thu Jan 1 01:00:01 CET 1970"
1794 "XEN_BUILD_TIME=01:00:01"
1797 "SMBIOS_REL_DATE=01/01/1970"
1798 "VGABIOS_REL_DATE=01 Jan 1970"
1799 ; QEMU_TRADITIONAL_LOC
1801 "SYSCONFIG_DIR=/tmp/etc/default"
1802 (string-append "BASH_COMPLETION_DIR="
1803 (assoc-ref %outputs "out")
1804 "/etc/bash_completion.d")
1805 (string-append "BOOT_DIR="
1806 (assoc-ref %outputs "out")
1808 (string-append "DEBUG_DIR="
1809 (assoc-ref %outputs "out")
1811 (string-append "EFI_DIR="
1812 (assoc-ref %outputs "out")
1813 "/lib/efi") ; TODO lib64 ?
1814 "MINIOS_UPSTREAM_URL="
1815 ;(string-append "DISTDIR="
1816 ; (assoc-ref %outputs "out"))
1818 #:test-target "test"
1820 (modify-phases %standard-phases
1821 (add-after 'unpack 'unpack-mini-os
1822 (lambda* (#:key inputs #:allow-other-keys)
1823 (copy-recursively (assoc-ref inputs "mini-os") "extras/mini-os")
1825 (add-after 'unpack-mini-os 'patch
1826 (lambda* (#:key inputs outputs #:allow-other-keys)
1827 (substitute* "tools/firmware/Rules.mk"
1828 (("override XEN_TARGET_ARCH = x86_32")
1829 (string-append "override XEN_TARGET_ARCH = x86_32
1830 override CC = " (assoc-ref inputs "cross-gcc") "/bin/i686-linux-gnu-gcc"))
1832 (string-append "CFLAGS=-I" (assoc-ref inputs "cross-libc")
1834 (substitute* "config/x86_32.mk"
1835 (("CFLAGS += -m32 -march=i686")
1836 (string-append "CFLAGS += -march=i686 -I"
1837 (assoc-ref inputs "cross-libc")
1839 ;; /var is not in /gnu/store , so don't try to create it.
1840 (substitute* '("tools/Makefile"
1841 "tools/xenstore/Makefile"
1842 "tools/xenpaging/Makefile")
1843 (("\\$\\(INSTALL_DIR\\) .*XEN_(DUMP|LOG|RUN|LIB|PAGING)_DIR.*")
1845 (("\\$\\(INSTALL_DIR\\) .*XEN_(RUN|LIB)_STORED.*")
1847 ;; Prevent xen from creating /etc .
1848 (substitute* "tools/examples/Makefile"
1849 ((" install-readmes") "")
1850 ((" install-configs") ""))
1852 (substitute* "tools/pygrub/setup.py"
1854 ; TODO: extra_link_args = ['-Wl,-rpath=/opt/foo'],
1855 (string-append "runtime_library_dirs = ['"
1856 (assoc-ref outputs "out")
1857 "/lib'],\nlibrary_dirs =")))
1859 (add-before 'configure 'patch-xen-script-directory
1860 (lambda* (#:key outputs #:allow-other-keys)
1861 (substitute* '("configure"
1864 (("XEN_SCRIPT_DIR=.*")
1865 (string-append "XEN_SCRIPT_DIR="
1866 (assoc-ref outputs "out")
1867 "/etc/xen/scripts")))
1869 (add-before 'configure 'set-environment-up
1870 (lambda* (#:key make-flags #:allow-other-keys)
1872 (string-contains x "cross-i686-linux"))
1873 (define (filter-environment! filter-predicate
1874 environment-variable-names)
1877 (let* ((env-value (getenv env-name))
1878 (search-path (search-path-as-string->list env-value))
1879 (new-search-path (filter filter-predicate
1881 (new-env-value (list->search-path-as-string
1882 new-search-path ":")))
1883 (setenv env-name new-env-value)))
1884 environment-variable-names))
1885 (setenv "CROSS_CPATH" (getenv "CPATH"))
1886 (setenv "CROSS_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
1887 (filter-environment! cross?
1889 "CROSS_LIBRARY_PATH"))
1890 (filter-environment! (lambda (e) (not (cross? e)))
1893 ;; Guix tries to be helpful and automatically adds
1894 ;; mini-os-git-checkout/include to the include path,
1895 ;; but actually we don't want it to be there (yet).
1896 (filter-environment! (lambda (e)
1899 "mini-os-git-checkout")))
1902 (setenv "EFI_VENDOR" "guix")
1905 (lambda* (#:key make-flags #:allow-other-keys)
1906 (apply invoke "make" "world" make-flags))))))
1908 `(("acpica" ,acpica) ; TODO: patch iasl invocation.
1909 ("bridge-utils" ,bridge-utils) ; TODO: patch invocations.
1911 ("iproute" ,iproute) ; TODO: patch invocations.
1914 ("libyajl" ,libyajl)
1915 ("ncurses" ,ncurses)
1916 ("openssl" ,openssl)
1919 ("qemu" ,qemu-minimal)
1920 ("seabios" ,seabios)
1921 ("util-linux" ,util-linux "lib") ; uuid
1922 ; TODO: ocaml-findlib, ocaml-nox.
1923 ("xz" ,xz) ; for liblzma
1928 ("cmake" ,cmake-minimal)
1931 ("gettext" ,gettext-minimal)
1937 (url "http://xenbits.xen.org/git-http/mini-os.git")
1938 (commit (string-append "xen-RELEASE-" version))))
1941 "1i8pcl19n60i2m9vlg79q3nknpj209c9ic5x10wxaicx45kc107f"))
1942 (file-name "mini-os-git-checkout")))
1945 ("pkg-config" ,pkg-config)
1946 ("python" ,python-2)
1948 ("cross-gcc" ,(cross-gcc "i686-linux-gnu"
1949 #:xbinutils (cross-binutils "i686-linux-gnu")
1950 #:libc (cross-libc "i686-linux-gnu")))
1951 ("cross-libc" ,(cross-libc "i686-linux-gnu")) ; header files
1952 ("cross-libc-static" ,(cross-libc "i686-linux-gnu") "static")))
1953 (home-page "https://xenproject.org/")
1954 (synopsis "Xen Virtual Machine Monitor")
1955 (description "This package provides the Xen Virtual Machine Monitor
1956 which is a hypervisor.")
1957 ;; TODO: Some files are licensed differently. List those.
1958 (license license:gpl2)
1959 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))))
1961 (define-public osinfo-db-tools
1963 (name "osinfo-db-tools")
1967 (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-tools-"
1972 "038q3gzdbkfkhpicj0755mw1q4gbvn57pslpw8n2dp3lds9im0g9"))))
1973 (build-system meson-build-system)
1975 `(("libsoup" ,libsoup)
1976 ("libxml2" ,libxml2)
1977 ("libxslt" ,libxslt)
1978 ("json-glib" ,json-glib)
1979 ("libarchive" ,libarchive)))
1982 ("gobject-introspection" ,gobject-introspection)
1983 ("gettext" ,gettext-minimal)
1984 ("pkg-config" ,pkg-config)
1987 ("pytest" ,python-pytest)
1988 ("requests" ,python-requests)))
1989 (home-page "https://gitlab.com/libosinfo/osinfo-db-tools")
1990 (synopsis "Tools for managing the osinfo database")
1991 (description "This package contains a set of tools to assist
1992 administrators and developers in managing the database.")
1993 (license license:lgpl2.0+)))
1995 (define-public osinfo-db
1998 (version "20200813")
2001 (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-"
2005 "127lr4kvdy2b2lil7i0gbbxcf8vap0r6hxhnbmms4p7h2h0sdgri"))))
2006 (build-system trivial-build-system)
2008 `(#:modules ((guix build utils))
2011 (use-modules (guix build utils))
2012 (let* ((out (assoc-ref %outputs "out"))
2013 (osinfo-dir (string-append out "/share/osinfo"))
2014 (source (assoc-ref %build-inputs "source"))
2016 (string-append (assoc-ref %build-inputs "osinfo-db-tools")
2017 "/bin/osinfo-db-import")))
2018 (mkdir-p osinfo-dir)
2019 (invoke osinfo-db-import "--dir" osinfo-dir source)
2022 `(("intltool" ,intltool)
2023 ("osinfo-db-tools" ,osinfo-db-tools)))
2024 (home-page "https://gitlab.com/libosinfo/osinfo-db")
2025 (synopsis "Database of information about operating systems")
2026 (description "Osinfo-db provides the database files for use with the
2027 libosinfo library. It provides information about guest operating systems for
2028 use with virtualization provisioning tools")
2029 (license license:lgpl2.0+)))