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 'extend-test-time-outs
182 ;; These tests can time out on heavily-loaded and/or slow storage.
183 (substitute* (cons* "tests/qemu-iotests/common.qemu"
184 (find-files "tests/qemu-iotests" "^[0-9]+$"))
185 (("QEMU_COMM_TIMEOUT=[0-9]+" match)
186 (string-append match "9")))))
187 (add-after 'unpack 'disable-unusable-tests
189 (substitute* "tests/Makefile.include"
190 ;; Comment out the test-qga test, which needs /sys and
191 ;; fails within the build environment.
192 (("check-unit-.* tests/test-qga" all)
193 (string-append "# " all))
194 ;; Comment out the test-char test, which needs networking and
195 ;; fails within the build environment.
196 (("check-unit-.* tests/test-char" all)
197 (string-append "# " all)))
198 (substitute* "tests/qtest/Makefile.include"
199 ;; Disable the following test, which triggers a crash on some
200 ;; x86 CPUs (see https://issues.guix.info/43048 and
201 ;; https://bugs.launchpad.net/qemu/+bug/1896263).
202 (("check-qtest-i386-y \\+= bios-tables-test" all)
203 (string-append "# " all)))
205 (add-after 'patch-source-shebangs 'patch-/bin/sh-references
207 ;; Ensure the executables created by these source files reference
208 ;; /bin/sh from the store so they work inside the build container.
209 (substitute* '("block/cloop.c" "migration/exec.c"
210 "net/tap.c" "tests/qtest/libqtest.c")
211 (("/bin/sh") (which "sh")))
214 (lambda* (#:key inputs outputs (configure-flags '())
216 ;; The `configure' script doesn't understand some of the
217 ;; GNU options. Thus, add a new phase that's compatible.
218 (let ((out (assoc-ref outputs "out")))
219 (setenv "SHELL" (which "bash"))
221 ;; While we're at it, patch for tests.
222 (substitute* "tests/qemu-iotests/check"
223 (("#!/usr/bin/env python3")
224 (string-append "#!" (which "python3"))))
226 ;; Ensure config.status gets the correct shebang off the bat.
227 ;; The build system gets confused if we change it later and
228 ;; attempts to re-run the whole configury, and fails.
229 (substitute* "configure"
231 (string-append "#!" (which "sh"))))
233 ;; The binaries need to be linked against -lrt.
234 (setenv "LDFLAGS" "-lrt")
237 ,(string-append "--cc=" (which "gcc"))
238 ;; Some architectures insist on using HOST_CC
239 ,(string-append "--host-cc=" (which "gcc"))
240 "--disable-debug-info" ; save build space
241 "--enable-virtfs" ; just to be sure
242 ,(string-append "--prefix=" out)
243 ,(string-append "--sysconfdir=/etc")
244 ,@configure-flags)))))
245 ;; Create a wrapper for Samba. This allows QEMU to use Samba without
246 ;; pulling it in as an input. Note that you need to explicitly install
247 ;; Samba in your Guix profile for Samba support.
248 (add-after 'install 'create-samba-wrapper
249 (lambda* (#:key inputs outputs #:allow-other-keys)
250 (let* ((out (assoc-ref outputs "out"))
251 (libexec (string-append out "/libexec")))
252 (call-with-output-file "samba-wrapper"
254 (format port "#!/bin/sh
256 (chmod "samba-wrapper" #o755)
257 (install-file "samba-wrapper" libexec))
259 (add-after 'install 'move-html-doc
260 (lambda* (#:key inputs outputs #:allow-other-keys)
261 (let* ((out (assoc-ref outputs "out"))
262 (doc (assoc-ref outputs "doc"))
263 (qemu-doc (string-append doc "/share/doc/qemu-" ,version)))
265 (rename-file (string-append out "/share/doc/qemu")
266 (string-append qemu-doc "/html")))
268 (inputs ; TODO: Add optional inputs.
269 `(("alsa-lib" ,alsa-lib)
275 ("libcacard" ,libcacard) ; smartcard support
276 ("libcap-ng" ,libcap-ng) ; virtfs support requires libcap-ng & libattr
278 ("libepoxy" ,libepoxy)
279 ("libjpeg" ,libjpeg-turbo)
281 ("libseccomp" ,libseccomp)
282 ("libusb" ,libusb) ;USB pass-through support
285 ;; ("pciutils" ,pciutils)
287 ("pulseaudio" ,pulseaudio)
290 ("usbredir" ,usbredir)
291 ("util-linux" ,util-linux)
293 ("virglrenderer" ,virglrenderer)
295 (native-inputs `(("gettext" ,gettext-minimal)
296 ("glib:bin" ,glib "bin") ; gtester, etc.
300 ("pkg-config" ,pkg-config)
301 ("python-wrapper" ,python-wrapper)
302 ("python-sphinx" ,python-sphinx)
303 ("texinfo" ,texinfo)))
304 (home-page "https://www.qemu.org")
305 (synopsis "Machine emulator and virtualizer")
307 "QEMU is a generic machine emulator and virtualizer.
309 When used as a machine emulator, QEMU can run OSes and programs made for one
310 machine (e.g. an ARM board) on a different machine---e.g., your own PC. By
311 using dynamic translation, it achieves very good performance.
313 When used as a virtualizer, QEMU achieves near native performances by
314 executing the guest code directly on the host CPU. QEMU supports
315 virtualization when executing under the Xen hypervisor or using
316 the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86,
317 server and embedded PowerPC, and S390 guests.")
319 ;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'.
320 (license license:gpl2)
322 ;; Several tests fail on MIPS; see <http://hydra.gnu.org/build/117914>.
323 (supported-systems (fold delete %supported-systems
324 '("mips64el-linux" "i586-gnu")))))
326 (define-public qemu-minimal
327 ;; QEMU without GUI support, only supporting the host's architecture
328 (package (inherit qemu)
329 (name "qemu-minimal")
331 "Machine emulator and virtualizer (without GUI) for the host architecture")
333 (substitute-keyword-arguments (package-arguments qemu)
334 ((#:configure-flags _ '(list))
335 ;; Restrict to the host's architecture.
336 (match (car (string-split (or (%current-target-system)
340 '(list "--target-list=i386-softmmu"))
342 '(list "--target-list=i386-softmmu,x86_64-softmmu"))
344 '(list (string-append "--target-list=mips-softmmu,mipsel-softmmu,"
345 "mips64-softmmu,mips64el-softmmu")))
347 '(list "--target-list=mips-softmmu,mipsel-softmmu"))
349 '(list "--target-list=arm-softmmu,aarch64-softmmu"))
351 '(list "--target-list=arm-softmmu"))
353 '(list "--target-list=alpha-softmmu"))
355 '(list "--target-list=ppc-softmmu,ppc64-softmmu"))
357 '(list "--target-list=ppc-softmmu"))
359 '(list "--target-list=s390x-softmmu"))
361 '(list "--target-list=riscv32-softmmu,riscv64-softmmu"))
362 (else ; An empty list actually builds all the targets.
365 ;; Remove dependencies on optional libraries, notably GUI libraries.
366 (native-inputs (fold alist-delete (package-native-inputs qemu)
368 (inputs (fold alist-delete (package-inputs qemu)
369 '("libusb" "mesa" "sdl2" "spice" "virglrenderer" "gtk+"
370 "usbredir" "libdrm" "libepoxy" "pulseaudio" "vde2"
373 (define (system->qemu-target system)
375 ((string-prefix? "i686" system)
377 ((string-prefix? "arm" system)
380 (string-append "qemu-system-" (match (string-split system #\-)
384 (define-public ganeti
387 ;; Note: we use a pre-release for Python 3 compatibility as well as many
389 (version "3.0.0beta1-24-g024cc9fa2")
393 (url "https://github.com/ganeti/ganeti")
394 (commit (string-append "v" version))))
396 (base32 "1ll34qd2mifni3bhg7cnir3xfnkafig8ch33qndqwrsby0y5ssia"))
397 (file-name (git-file-name name version))
398 (patches (search-patches "ganeti-shepherd-support.patch"
399 "ganeti-shepherd-master-failover.patch"
400 "ganeti-deterministic-manual.patch"
401 "ganeti-drbd-compat.patch"
402 "ganeti-os-disk-size.patch"
403 "ganeti-haskell-pythondir.patch"
404 "ganeti-disable-version-symlinks.patch"
405 "ganeti-preserve-PYTHONPATH.patch"))))
406 (build-system gnu-build-system)
408 `(#:imported-modules (,@%gnu-build-system-modules
409 (guix build haskell-build-system)
410 (guix build python-build-system))
411 #:modules (,@%gnu-build-system-modules
412 ((guix build haskell-build-system) #:prefix haskell:)
413 ((guix build python-build-system) #:select (python-version))
416 ;; The default test target includes a lot of checks that are only really
417 ;; relevant for developers such as NEWS file checking, line lengths, etc.
418 ;; We are only interested in the "py-tests" and "hs-tests" targets: this
419 ;; is the closest we've got even though it includes a little more.
420 #:test-target "check-TESTS"
423 (list "--localstatedir=/var"
424 "--sharedstatedir=/var"
426 "--enable-haskell-tests"
428 ;; By default, the build system installs everything to versioned
429 ;; directories such as $libdir/3.0 and relies on a $libdir/default
430 ;; symlink pointed from /etc/ganeti/{lib,share} to actually function.
431 ;; This is done to accommodate installing multiple versions in
432 ;; parallel, but is of little use to us as Guix users can just
433 ;; roll back and forth. Thus, disable it for simplicity.
434 "--disable-version-links"
436 ;; Ganeti can optionally take control over SSH host keys and
437 ;; distribute them to nodes as they are added, and also rotate keys
438 ;; with 'gnt-cluster renew-crypto --new-ssh-keys'. Thus it needs to
439 ;; know how to restart the SSH daemon.
440 "--with-sshd-restart-command='herd restart ssh-daemon'"
442 ;; Look for OS definitions in this directory by default. It can
443 ;; be changed in the cluster configuration.
444 "--with-os-search-path=/run/current-system/profile/share/ganeti/os"
446 ;; The default QEMU executable to use. We don't use the package
447 ;; here because this entry is stored in the cluster configuration.
448 (string-append "--with-kvm-path=/run/current-system/profile/bin/"
449 ,(system->qemu-target (%current-system))))
451 (modify-phases %standard-phases
452 (add-after 'unpack 'create-vcs-version
454 ;; If we are building from a git checkout, we need to create a
455 ;; 'vcs-version' file manually because the build system does
456 ;; not have access to the git repository information.
457 (unless (file-exists? "vcs-version")
458 (call-with-output-file "vcs-version"
460 (format port "v~a~%" ,version))))
462 (add-after 'unpack 'patch-absolute-file-names
464 (substitute* '("lib/utils/process.py"
466 "src/Ganeti/Constants.hs"
467 "src/Ganeti/HTools/CLI.hs"
468 "test/py/ganeti.config_unittest.py"
469 "test/py/ganeti.hooks_unittest.py"
470 "test/py/ganeti.utils.process_unittest.py"
471 "test/py/ganeti.utils.text_unittest.py"
472 "test/py/ganeti.utils.wrapper_unittest.py")
473 (("/bin/sh") (which "sh"))
474 (("/bin/bash") (which "bash"))
475 (("/usr/bin/env") (which "env"))
476 (("/bin/true") (which "true")))
478 ;; This script is called by the node daemon at startup to perform
479 ;; sanity checks on the cluster IP addresses, and it is also used
480 ;; in a master-failover scenario. Add absolute references to
481 ;; avoid propagating these executables.
482 (substitute* "tools/master-ip-setup"
483 (("arping") (which "arping"))
484 (("ndisc6") (which "ndisc6"))
485 (("fping") (which "fping"))
486 (("grep") (which "grep"))
487 (("ip addr") (string-append (which "ip") " addr")))
489 (add-after 'unpack 'override-builtin-PATH
491 ;; Ganeti runs OS install scripts and similar with a built-in
492 ;; hard coded PATH. Patch so it works on Guix System.
493 (substitute* "src/Ganeti/Constants.hs"
494 (("/sbin:/bin:/usr/sbin:/usr/bin")
495 "/run/setuid-programs:/run/current-system/profile/sbin:\
496 /run/current-system/profile/bin"))
498 (add-after 'bootstrap 'patch-sphinx-version-detection
500 ;; The build system runs 'sphinx-build --version' to verify that
501 ;; the Sphinx is recent enough, but does not expect the
502 ;; .sphinx-build-real executable name created by the Sphinx wrapper.
503 (substitute* "configure"
504 (("\\$SPHINX --version 2>&1")
505 "$SPHINX --version 2>&1 | sed 's/.sphinx-build-real/sphinx-build/g'"))
508 ;; The build system invokes Cabal and GHC, which do not work with
509 ;; GHC_PACKAGE_PATH: <https://github.com/haskell/cabal/issues/3728>.
510 ;; Tweak the build system to do roughly what haskell-build-system does.
511 (add-before 'configure 'configure-haskell
512 (assoc-ref haskell:%standard-phases 'setup-compiler))
513 (add-after 'configure 'do-not-use-GHC_PACKAGE_PATH
515 (unsetenv "GHC_PACKAGE_PATH")
516 (substitute* "Makefile"
518 "$(CABAL) --package-db=../package.conf.d")
520 "$(GHC) -package-db=../package.conf.d"))
522 (add-after 'configure 'make-ghc-use-shared-libraries
524 (substitute* "Makefile"
525 (("HFLAGS =") "HFLAGS = -dynamic -fPIC"))
527 (add-after 'configure 'fix-installation-directories
529 (substitute* "Makefile"
530 ;; Do not attempt to create /var during install.
531 (("\\$\\(DESTDIR\\)\\$\\{localstatedir\\}")
532 "$(DESTDIR)${prefix}${localstatedir}")
533 ;; Similarly, do not attempt to install the sample ifup scripts
535 (("\\$\\(DESTDIR\\)\\$\\(ifupdir\\)")
536 "$(DESTDIR)${prefix}$(ifupdir)"))
538 (add-before 'build 'adjust-tests
540 ;; Disable tests that can not run. Do it early to prevent
541 ;; touching the Makefile later and triggering a needless rebuild.
542 (substitute* "Makefile"
543 ;; These tests expect the presence of a 'root' user (via
544 ;; ganeti/runtime.py), which fails in the build environment.
545 (("test/py/ganeti\\.asyncnotifier_unittest\\.py") "")
546 (("test/py/ganeti\\.backend_unittest\\.py") "")
547 (("test/py/ganeti\\.daemon_unittest\\.py") "")
548 (("test/py/ganeti\\.tools\\.ensure_dirs_unittest\\.py") "")
549 (("test/py/ganeti\\.utils\\.io_unittest-runasroot\\.py") "")
550 ;; Disable the bash_completion test, as it requires the full
551 ;; bash instead of bash-minimal.
552 (("test/py/bash_completion\\.bash")
554 ;; This test requires networking.
555 (("test/py/import-export_unittest\\.bash")
558 ;; Many of the Makefile targets reset PYTHONPATH before running
559 ;; the Python interpreter, which does not work very well for us.
560 (substitute* "Makefile"
562 (string-append "PYTHONPATH=" (getenv "PYTHONPATH") ":")))
564 (add-after 'build 'build-bash-completions
566 (let ((orig-pythonpath (getenv "PYTHONPATH")))
567 (setenv "PYTHONPATH" (string-append ".:" orig-pythonpath))
568 (invoke "./autotools/build-bash-completion")
569 (setenv "PYTHONPATH" orig-pythonpath)
571 (add-before 'check 'pre-check
572 (lambda* (#:key inputs #:allow-other-keys)
573 ;; Set TZDIR so that time zones are found.
574 (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
577 ;; This test checks whether PYTHONPATH is untouched, and extends
578 ;; it to include test directories if so. Add an else branch for
579 ;; our modified PYTHONPATH, in order to prevent a confusing test
580 ;; failure where expired certificates are not cleaned because
581 ;; check-cert-expired is silently crashing.
582 (substitute* "test/py/ganeti-cleaner_unittest.bash"
583 (("then export PYTHONPATH=(.*)" all testpath)
584 (string-append all "else export PYTHONPATH="
585 (getenv "PYTHONPATH") ":" testpath "\n")))
587 (substitute* "test/py/ganeti.utils.process_unittest.py"
588 ;; This test attempts to run an executable with
589 ;; RunCmd(..., reset_env=True), which fails because the default
590 ;; PATH from Constants.hs does not exist in the build container.
591 ((".*def testResetEnv.*" all)
592 (string-append " @unittest.skipIf(True, "
593 "\"cannot reset env in the build container\")\n"
596 ;; XXX: Somehow this test fails in the build container, but
597 ;; works in 'guix environment -C', even without /bin/sh?
598 ((".*def testPidFile.*" all)
599 (string-append " @unittest.skipIf(True, "
600 "\"testPidFile fails in the build container\")\n"
603 ;; XXX: Why are these links not added automatically.
604 (with-directory-excursion "test/hs"
605 (for-each (lambda (file)
606 (symlink "../../src/htools" file))
607 '("hspace" "hscan" "hinfo" "hbal" "hroller"
608 "hcheck" "hail" "hsqueeze")))
610 (add-after 'install 'install-bash-completions
611 (lambda* (#:key outputs #:allow-other-keys)
612 (let* ((out (assoc-ref outputs "out"))
613 (compdir (string-append out "/etc/bash_completion.d")))
615 (copy-file "doc/examples/bash_completion"
616 (string-append compdir "/ganeti"))
617 ;; The one file contains completions for many different
618 ;; executables. Create symlinks for found completions.
619 (with-directory-excursion compdir
621 (lambda (prog) (symlink "ganeti" prog))
622 (call-with-input-file "ganeti"
624 (let loop ((line (read-line port))
626 (if (eof-object? line)
628 (if (string-prefix? "complete" line)
629 (loop (read-line port)
630 ;; Extract "prog" from lines of the form:
631 ;; "complete -F _prog -o filenames prog".
632 ;; Note that 'burnin' is listed with the
633 ;; absolute file name, which is why we
634 ;; run everything through 'basename'.
635 (cons (basename (car (reverse (string-split
638 (loop (read-line port) progs))))))))
640 ;; Wrap all executables with PYTHONPATH. We can't borrow the phase
641 ;; from python-build-system because we also need to wrap the scripts
642 ;; in $out/lib/ganeti such as "node-daemon-setup".
643 (add-after 'install 'wrap
644 (lambda* (#:key inputs outputs #:allow-other-keys)
645 (let* ((out (assoc-ref outputs "out"))
646 (sbin (string-append out "/sbin"))
647 (lib (string-append out "/lib"))
648 (python (assoc-ref inputs "python"))
649 (major+minor (python-version python))
650 (PYTHONPATH (string-append lib "/python" major+minor
652 (getenv "PYTHONPATH"))))
653 (define (shell-script? file)
654 (call-with-ascii-input-file file
656 (let ((shebang (false-if-exception (read-line port))))
658 (string-prefix? "#!" shebang)
659 (or (string-contains shebang "/bin/bash")
660 (string-contains shebang "/bin/sh")))))))
663 ;; Do not wrap shell scripts because some are meant to be
664 ;; sourced, which breaks if they are wrapped. We do wrap
665 ;; the Haskell executables because some call out to Python
667 (and (executable-file? file)
668 (not (symbolic-link? file))
669 (not (shell-script? file))))
671 (for-each (lambda (file)
673 `("PYTHONPATH" ":" prefix (,PYTHONPATH))))
675 (append (find-files (string-append lib "/ganeti"))
680 ("cabal" ,cabal-install)
683 ;; These inputs are necessary to bootstrap the package, because we
684 ;; have patched the build system.
685 ("autoconf" ,autoconf)
686 ("automake" ,automake)
688 ;; For the documentation.
689 ("python-docutils" ,python-docutils)
690 ("sphinx" ,python-sphinx)
694 ;; Test dependencies.
695 ("fakeroot" ,fakeroot)
696 ("ghc-temporary" ,ghc-temporary)
697 ("ghc-test-framework" ,ghc-test-framework)
698 ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
699 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
700 ("python-mock" ,python-mock)
701 ("python-pyyaml" ,python-pyyaml)
704 ("shelltestrunner" ,shelltestrunner)
705 ("tzdata" ,tzdata-for-tests)))
707 `(("arping" ,iputils) ;must be the iputils version
710 ("iproute2" ,iproute)
713 ("qemu" ,qemu-minimal) ;for qemu-img
714 ("ghc-attoparsec" ,ghc-attoparsec)
715 ("ghc-base64-bytestring" ,ghc-base64-bytestring)
716 ("ghc-cryptonite" ,ghc-cryptonite)
717 ("ghc-curl" ,ghc-curl)
718 ("ghc-hinotify" ,ghc-hinotify)
719 ("ghc-hslogger" ,ghc-hslogger)
720 ("ghc-json" ,ghc-json)
721 ("ghc-lens" ,ghc-lens)
722 ("ghc-lifted-base" ,ghc-lifted-base)
723 ("ghc-network" ,ghc-network)
724 ("ghc-old-time" ,ghc-old-time)
725 ("ghc-psqueue" ,ghc-psqueue)
726 ("ghc-regex-pcre" ,ghc-regex-pcre)
727 ("ghc-utf8-string" ,ghc-utf8-string)
728 ("ghc-zlib" ,ghc-zlib)
730 ;; For the optional metadata daemon.
731 ("ghc-snap-core" ,ghc-snap-core)
732 ("ghc-snap-server" ,ghc-snap-server)
735 ("python-pyopenssl" ,python-pyopenssl)
736 ("python-simplejson" ,python-simplejson)
737 ("python-pyparsing" ,python-pyparsing)
738 ("python-pyinotify" ,python-pyinotify)
739 ("python-pycurl" ,python-pycurl)
740 ("python-bitarray" ,python-bitarray)
741 ("python-paramiko" ,python-paramiko)
742 ("python-psutil" ,python-psutil)))
743 (home-page "http://www.ganeti.org/")
744 (synopsis "Cluster-based virtual machine management system")
746 "Ganeti is a virtual machine management tool built on top of existing
747 virtualization technologies such as Xen or KVM. Ganeti controls:
750 @item Disk creation management;
751 @item Operating system installation for instances (in co-operation with
752 OS-specific install scripts); and
753 @item Startup, shutdown, and failover between physical systems.
756 Ganeti is designed to facilitate cluster management of virtual servers and
757 to provide fast and simple recovery after physical failures, using
758 commodity hardware.")
759 (license license:bsd-2)))
761 (define-public ganeti-instance-guix
763 (name "ganeti-instance-guix")
765 (home-page "https://github.com/mbakke/ganeti-instance-guix")
768 (uri (git-reference (url home-page) (commit version)))
769 (file-name (git-file-name name version))
772 "0aa08irpcpns6mhjgsplc5f0p8ab1qcr9ah1gj5z66kxgqyflzrp"))))
773 (build-system gnu-build-system)
775 '(#:configure-flags '("--sysconfdir=/etc" "--localstatedir=/var")))
777 `(("autoconf" ,autoconf)
778 ("automake" ,automake)))
780 `(("util-linux" ,util-linux)
781 ("qemu-img" ,qemu-minimal)))
782 (synopsis "Guix OS integration for Ganeti")
784 "This package provides a guest OS definition for Ganeti that uses
785 Guix to build virtual machines.")
786 (license license:gpl3+)))
788 (define-public ganeti-instance-debootstrap
790 (name "ganeti-instance-debootstrap")
791 ;; We need two commits on top of the latest release for compatibility
792 ;; with newer sfdisk, as well as gnt-network integration.
793 (version "0.16-2-ge145396")
794 (home-page "https://github.com/ganeti/instance-debootstrap")
797 (uri (git-reference (url home-page) (commit version)))
798 (file-name (git-file-name name version))
801 "0f2isw9d8lawzj21rrq1q9xhq8xfa65rqbhqmrn59z201x9q1336"))))
802 (build-system gnu-build-system)
804 '(#:configure-flags '("--sysconfdir=/etc" "--localstatedir=/var")
805 #:phases (modify-phases %standard-phases
806 (add-after 'unpack 'add-absolute-references
808 (substitute* "common.sh.in"
809 (("/sbin/blkid") (which "blkid"))
811 (string-append (which "kpartx") " -")))
812 (substitute* "import"
814 (string-append (which "restore") " -r")))
815 (substitute* "export"
817 (string-append (which "dump") " -0")))
818 (substitute* "create"
819 (("debootstrap") (which "debootstrap"))
820 (("`which run-parts`") (which "run-parts"))
821 ;; Here we actually need to hard code /bin/passwd
822 ;; because it's called via chroot, which fails if
823 ;; "/bin" is not in PATH.
824 (("passwd") "/bin/passwd"))
826 (add-after 'unpack 'set-dpkg-arch
827 (lambda* (#:key system #:allow-other-keys)
828 ;; The create script passes --arch to debootstrap,
829 ;; and defaults to `dpkg --print-architecture` when
830 ;; ARCH is not set in variant.conf. Hard code the
831 ;; build-time architecture to avoid the dpkg dependency.
833 (cond ((string-prefix? "x86_64" system)
835 ((string-prefix? "i686" system)
837 ((string-prefix? "aarch64" system)
839 (else (car (string-split system #\-))))))
840 (substitute* "create"
841 (("`dpkg --print-architecture`")
844 (add-after 'configure 'adjust-Makefile
846 ;; Do not attempt to create /etc/ganeti/instance-debootstrap
847 ;; and /etc/default/ganeti-instance-debootstrap during install.
848 ;; They are created by the Ganeti service.
849 (substitute* "Makefile"
850 (("\\$\\(variantsdir\\)")
851 "$(prefix)/etc/ganeti/instance-debootstrap/variants")
852 (("\\$\\(defaultsdir\\)")
853 "$(prefix)/etc/default/ganeti-instance-debootstrap"))
855 (add-after 'install 'make-variants.list-symlink
856 (lambda* (#:key outputs #:allow-other-keys)
857 ;; The Ganeti OS API mandates a variants.list file that
858 ;; describes all supported "variants" of this OS.
859 ;; Guix generates this file, so make the original file
861 (with-directory-excursion (string-append
862 (assoc-ref outputs "out")
863 "/share/ganeti/os/debootstrap")
864 (delete-file "variants.list")
865 (symlink "/etc/ganeti/instance-debootstrap/variants/variants.list"
869 `(("autoconf" ,autoconf)
870 ("automake" ,automake)))
872 `(("debianutils" ,debianutils)
873 ("debootstrap" ,debootstrap)
875 ("kpartx" ,multipath-tools)
876 ("util-linux" ,util-linux)))
877 (synopsis "Debian OS integration for Ganeti")
879 "This package provides a guest OS definition for Ganeti. It installs
880 Debian or a derivative using @command{debootstrap}.")
881 (license license:gpl2+)))
883 (define-public libosinfo
890 (uri (string-append "https://releases.pagure.org/libosinfo/libosinfo-"
894 "1s97sv24bybggjx6hgqba2qdqz3ivfpd4cmkh4zm5y59sim109mv"))))
895 (build-system meson-build-system)
898 (list (string-append "-Dwith-usb-ids-path="
899 (assoc-ref %build-inputs "usb.ids"))
900 (string-append "-Dwith-pci-ids-path="
901 (assoc-ref %build-inputs "pci.ids")))
903 (modify-phases %standard-phases
904 (add-after 'unpack 'patch-osinfo-path
905 (lambda* (#:key inputs #:allow-other-keys)
906 (substitute* "osinfo/osinfo_loader.c"
907 (("path = DATA_DIR.*")
908 (string-append "path = \"" (assoc-ref inputs "osinfo-db")
909 "/share/osinfo\";")))
912 `(("libsoup" ,libsoup)
915 ("osinfo-db" ,osinfo-db)))
917 `(("glib" ,glib "bin") ; glib-mkenums, etc.
918 ("gobject-introspection" ,gobject-introspection)
921 ("intltool" ,intltool)
922 ("pkg-config" ,pkg-config)
926 (uri "https://github.com/pciutils/pciids/raw/ad02084f0bc143e3c15e31a6152a3dfb1d7a3156/pci.ids")
929 "0kfhpj5rnh24hz2714qhfmxk281vwc2w50sm73ggw5d15af7zfsw"))))
933 (uri "https://svn.code.sf.net/p/linux-usb/repo/trunk/htdocs/usb.ids?r=2681")
934 (file-name "usb.ids")
937 "1m6yhvz5k8aqzxgk7xj3jkk8frl1hbv0h3vgj4wbnvnx79qnvz3r"))))))
938 (home-page "https://libosinfo.org/")
939 (synopsis "Operating system information database")
940 (description "libosinfo is a GObject based library API for managing
941 information about operating systems, hypervisors and the (virtual) hardware
942 devices they can support. It includes a database containing device metadata
943 and provides APIs to match/identify optimal devices for deploying an operating
944 system on a hypervisor. Via GObject Introspection, the API is available in
945 all common programming languages. Vala bindings are also provided.")
946 ;; The library files are released under LGPLv2.1 or later; the source
947 ;; files in the "tools" directory are released under GPLv2+.
948 (license (list license:lgpl2.1+ license:gpl2+))))
957 "https://linuxcontainers.org/downloads/lxc/lxc-"
961 "1igxqgx8q9cp15mcp1y8j564bl85ijw04jcmgb1s5bmfbg1751sd"))))
962 (build-system gnu-build-system)
964 `(("pkg-config" ,pkg-config)))
968 ("libseccomp" ,libseccomp)
969 ("libselinux" ,libselinux)))
972 (list (string-append "--docdir=" (assoc-ref %outputs "out")
973 "/share/doc/" ,name "-" ,version)
975 "--localstatedir=/var")
977 (modify-phases %standard-phases
979 (lambda* (#:key outputs #:allow-other-keys)
980 (let* ((out (assoc-ref outputs "out"))
981 (bashcompdir (string-append out "/etc/bash_completion.d")))
982 (invoke "make" "install"
983 (string-append "bashcompdir=" bashcompdir)
984 ;; Don't install files into /var and /etc.
985 "LXCPATH=/tmp/var/lib/lxc"
986 "localstatedir=/tmp/var"
987 "sysconfdir=/tmp/etc"
988 "sysconfigdir=/tmp/etc/default")))))))
989 (synopsis "Linux container tools")
990 (home-page "https://linuxcontainers.org/")
992 "LXC is a userspace interface for the Linux kernel containment features.
993 Through a powerful API and simple tools, it lets Linux users easily create and
994 manage system or application containers.")
995 (license license:lgpl2.1+)))
997 (define-public libvirt
1004 (uri (string-append "https://libvirt.org/sources/libvirt-"
1007 (base32 "0m8cqaqflvys5kaqpvb0qr4k365j09jc5xk6x70yvg8qkcl2hcz2"))
1009 (search-patches "libvirt-create-machine-cgroup.patch"))))
1010 (build-system gnu-build-system)
1014 "--with-qemu-user=nobody"
1015 "--with-qemu-group=kvm"
1017 (string-append "--docdir=" (assoc-ref %outputs "out") "/share/doc/"
1020 "--localstatedir=/var")
1022 (modify-phases %standard-phases
1023 (add-before 'configure 'fix-BOURNE_SHELL-definition
1024 ;; BOURNE_SHELL is hard-#defined to ‘/bin/sh’, causing test failures.
1026 (substitute* "config.h.in"
1027 (("/bin/sh") (which "sh")))
1029 (add-before 'configure 'patch-libtirpc-file-names
1030 (lambda* (#:key inputs #:allow-other-keys)
1031 ;; libvirt uses an m4 macro instead of pkg-config to determine where
1032 ;; the RPC headers are located. Tell it to look in the right place.
1033 (substitute* "configure"
1034 (("/usr/include/tirpc") ;defined in m4/virt-xdr.m4
1035 (string-append (assoc-ref inputs "libtirpc")
1038 (add-before 'configure 'disable-broken-tests
1040 (let ((tests (list "commandtest" ; hangs idly
1041 "qemuxml2argvtest" ; fails
1042 "qemuhotplugtest" ; fails
1043 "virnetsockettest" ; tries to network
1044 "virshtest"))) ; fails
1045 (substitute* "tests/Makefile.in"
1046 (((format #f "(~a)\\$\\(EXEEXT\\)" (string-join tests "|")))
1050 ;; Since the sysconfdir and localstatedir should be /etc and /var
1051 ;; at runtime, we must prevent writing to them at installation
1053 (lambda* (#:key make-flags #:allow-other-keys)
1054 (apply invoke "make" "install"
1055 "sysconfdir=/tmp/etc"
1056 "localstatedir=/tmp/var"
1059 `(("libxml2" ,libxml2)
1061 ("libpciaccess" ,libpciaccess)
1064 ("libpcap" ,libpcap)
1066 ("libtirpc" ,libtirpc) ;for <rpc/rpc.h>
1067 ("libuuid" ,util-linux "lib")
1068 ("lvm2" ,lvm2) ;for libdevmapper
1070 ("openssl" ,openssl)
1071 ("cyrus-sasl" ,cyrus-sasl)
1072 ("libyajl" ,libyajl)
1074 ("dmidecode" ,dmidecode)
1075 ("dnsmasq" ,dnsmasq)
1076 ("ebtables" ,ebtables)
1077 ("iproute" ,iproute)
1078 ("iptables" ,iptables)))
1080 `(("xsltproc" ,libxslt)
1082 ("pkg-config" ,pkg-config)
1084 ("python" ,python-wrapper)))
1085 (home-page "https://libvirt.org")
1086 (synopsis "Simple API for virtualization")
1087 (description "Libvirt is a C toolkit to interact with the virtualization
1088 capabilities of recent versions of Linux. The library aims at providing long
1089 term stable C API initially for the Xen paravirtualization but should be able
1090 to integrate other virtualization mechanisms if needed.")
1091 (license license:lgpl2.1+)))
1093 (define-public libvirt-glib
1095 (name "libvirt-glib")
1099 (uri (string-append "ftp://libvirt.org/libvirt/glib/"
1100 "libvirt-glib-" version ".tar.gz"))
1103 "1zpbv4ninc57c9rw4zmmkvvqn7154iv1qfr20kyxn8xplalqrzvz"))))
1104 (build-system gnu-build-system)
1106 `(("openssl" ,openssl)
1107 ("cyrus-sasl" ,cyrus-sasl)
1108 ("lvm2" ,lvm2) ; for libdevmapper
1109 ("libyajl" ,libyajl)))
1111 `(("pkg-config" ,pkg-config)
1112 ("intltool" ,intltool)
1113 ("glib" ,glib "bin")
1116 ;; ‘Required:’ by the installed .pc files.
1118 ("libvirt" ,libvirt)
1119 ("libxml2" ,libxml2)
1120 ("gobject-introspection" ,gobject-introspection)))
1121 (home-page "https://libvirt.org")
1122 (synopsis "GLib wrapper around libvirt")
1123 (description "libvirt-glib wraps the libvirt library to provide a
1124 high-level object-oriented API better suited for glib-based applications, via
1128 @item libvirt-glib - GLib main loop integration & misc helper APIs
1129 @item libvirt-gconfig - GObjects for manipulating libvirt XML documents
1130 @item libvirt-gobject - GObjects for managing libvirt objects
1133 (license license:lgpl2.1+)))
1135 (define-public python-libvirt
1137 (name "python-libvirt")
1142 (uri (string-append "https://libvirt.org/sources/python/libvirt-python-"
1145 (base32 "0kyz3lx49d8p75mvbzinxc1zgs8g7adn77y9bm15b8b4ad9zl5s6"))))
1146 (build-system python-build-system)
1149 (modify-phases %standard-phases
1150 (add-after 'unpack 'patch-nosetests-path
1151 (lambda* (#:key inputs #:allow-other-keys)
1152 (substitute* "setup.py"
1153 (("\"/usr/bin/nosetests\"")
1154 (string-append "\"" (which "nosetests") "\""))
1155 (("self\\.spawn\\(\\[sys\\.executable, nose\\]\\)")
1156 (format #f "self.spawn([\"~a\", nose])" (which "bash"))))
1159 `(("libvirt" ,libvirt)))
1161 `(("python-lxml" ,python-lxml)))
1163 `(("pkg-config" ,pkg-config)
1164 ("python-nose" ,python-nose)))
1165 (home-page "https://libvirt.org")
1166 (synopsis "Python bindings to libvirt")
1167 (description "This package provides Python bindings to the libvirt
1168 virtualization library.")
1169 (license license:lgpl2.1+)))
1171 (define-public python2-libvirt
1172 (package-with-python2 python-libvirt))
1174 (define-public virt-manager
1176 (name "virt-manager")
1180 (uri (string-append "https://virt-manager.org/download/sources"
1181 "/virt-manager/virt-manager-"
1185 "06ws0agxlip6p6n3n43knsnjyd91gqhh2dadgc33wl9lx1k8vn6g"))))
1186 (build-system python-build-system)
1188 `(#:use-setuptools? #f ; uses custom distutils 'install' command
1189 #:test-target "test_ui"
1190 #:tests? #f ; TODO The tests currently fail
1191 ; RuntimeError: Loop condition wasn't
1193 #:imported-modules ((guix build glib-or-gtk-build-system)
1194 ,@%python-build-system-modules)
1195 #:modules ((ice-9 match)
1197 (guix build python-build-system)
1198 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
1201 (modify-phases %standard-phases
1202 (add-after 'unpack 'fix-setup
1203 (lambda* (#:key outputs #:allow-other-keys)
1204 (substitute* "virtinst/buildconfig.py"
1205 (("/usr") (assoc-ref outputs "out")))
1207 (add-after 'unpack 'fix-qemu-img-reference
1208 (lambda* (#:key inputs #:allow-other-keys)
1209 (substitute* "virtconv/formats.py"
1210 (("/usr(/bin/qemu-img)" _ suffix)
1211 (string-append (assoc-ref inputs "qemu") suffix)))
1213 (add-after 'unpack 'fix-default-uri
1214 (lambda* (#:key inputs #:allow-other-keys)
1215 ;; Xen is not available for now - so only patch qemu.
1216 (substitute* "virtManager/createconn.py"
1217 (("/usr(/bin/qemu-system)" _ suffix)
1218 (string-append (assoc-ref inputs "qemu") suffix)))
1220 (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH
1221 (lambda* (#:key inputs outputs #:allow-other-keys)
1222 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
1223 (bin-files (find-files bin ".*"))
1224 (paths (map (match-lambda
1225 ((output . directory)
1226 (let* ((girepodir (string-append
1228 "/lib/girepository-1.0")))
1229 (if (file-exists? girepodir)
1232 (for-each (lambda (file)
1233 (format #t "wrapping ~a\n" file)
1235 `("GI_TYPELIB_PATH" ":" prefix
1236 ,(filter identity paths))))
1240 (lambda* (#:key tests? #:allow-other-keys)
1242 (setenv "HOME" "/tmp")
1243 (system "Xvfb :1 &")
1244 (setenv "DISPLAY" ":1")
1245 ;; Dogtail requires that Assistive Technology support be enabled
1246 (setenv "GTK_MODULES" "gail:atk-bridge")
1247 (invoke "dbus-run-session" "--" "python" "setup.py" "test_ui"))
1249 (add-after 'install 'glib-or-gtk-compile-schemas
1250 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
1251 (add-after 'install 'glib-or-gtk-wrap
1252 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
1256 ("gtk-vnc" ,gtk-vnc)
1257 ("gtksourceview" ,gtksourceview)
1258 ("libvirt" ,libvirt)
1259 ("libvirt-glib" ,libvirt-glib)
1260 ("libosinfo" ,libosinfo)
1262 ("python-libvirt" ,python-libvirt)
1263 ("python-requests" ,python-requests)
1264 ("python-pycairo" ,python-pycairo)
1265 ("python-pygobject" ,python-pygobject)
1266 ("python-libxml2" ,python-libxml2)
1267 ("spice-gtk" ,spice-gtk)))
1268 ;; virt-manager searches for qemu-img or kvm-img in the PATH.
1272 `(("glib" ,glib "bin") ; glib-compile-schemas
1273 ("gobject-introspection" ,gobject-introspection)
1274 ("gtk+" ,gtk+ "bin") ; gtk-update-icon-cache
1275 ("perl" ,perl) ; pod2man
1276 ("intltool" ,intltool)
1277 ;; The following are required for running the tests
1278 ;; ("python-dogtail" ,python-dogtail)
1279 ;; ("xvfb" ,xorg-server-for-tests)
1281 ;; ("at-spi2-core" ,at-spi2-core)
1282 ;; ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
1284 (home-page "https://virt-manager.org/")
1285 (synopsis "Manage virtual machines")
1287 "The virt-manager application is a desktop user interface for managing
1288 virtual machines through libvirt. It primarily targets KVM VMs, but also
1289 manages Xen and LXC (Linux containers). It presents a summary view of running
1290 domains, their live performance and resource utilization statistics.")
1291 (license license:gpl2+)))
1299 (uri (string-append "https://download.openvz.org/criu/criu-"
1300 version ".tar.bz2"))
1303 "09d0j24x0cyc7wkgi7cnxqgfjk7kbdlm79zxpj8d356sa3rw2z24"))))
1304 (build-system gnu-build-system)
1306 `(#:test-target "test"
1307 #:tests? #f ; tests require mounting as root
1309 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1310 (string-append "LIBDIR=" (assoc-ref %outputs "out")
1312 (string-append "ASCIIDOC=" (assoc-ref %build-inputs "asciidoc")
1314 (string-append "XMLTO=" (assoc-ref %build-inputs "xmlto")
1317 (modify-phases %standard-phases
1319 (lambda* (#:key inputs #:allow-other-keys)
1320 ;; The includes for libnl are located in a sub-directory.
1321 (setenv "C_INCLUDE_PATH"
1322 (string-append (assoc-ref inputs "libnl")
1324 (or (getenv "C_INCLUDE_PATH") "")))
1326 (add-after 'configure 'fix-documentation
1327 (lambda* (#:key inputs outputs #:allow-other-keys)
1328 (substitute* "Documentation/Makefile"
1331 "-m custom.xsl --skip-validation -x "
1332 (assoc-ref inputs "docbook-xsl") "/xml/xsl/"
1333 ,(package-name docbook-xsl) "-"
1334 ,(package-version docbook-xsl)
1335 "/manpages/docbook.xsl")))
1337 (add-after 'unpack 'hardcode-variables
1338 (lambda* (#:key inputs #:allow-other-keys)
1339 ;; Hardcode arm version detection
1340 (substitute* "Makefile"
1341 (("ARMV.*:=.*") "ARMV := 7\n"))
1342 ;; We are currently using python-2
1343 (substitute* "crit/Makefile"
1344 (("\\$\\(PYTHON\\)") "python2"))
1345 (substitute* "lib/Makefile"
1346 (("\\$\\(PYTHON\\)")
1347 (string-append (assoc-ref inputs "python")
1350 (add-before 'build 'fix-symlink
1351 (lambda* (#:key inputs #:allow-other-keys)
1352 ;; The file 'images/google/protobuf/descriptor.proto' points to
1353 ;; /usr/include/..., which obviously does not exist.
1354 (let* ((file "google/protobuf/descriptor.proto")
1355 (target (string-append "images/" file))
1356 (source (string-append (assoc-ref inputs "protobuf")
1358 (delete-file target)
1359 (symlink source target)
1361 (add-after 'install 'wrap
1362 (lambda* (#:key inputs outputs #:allow-other-keys)
1363 ;; Make sure 'crit' runs with the correct PYTHONPATH.
1364 (let* ((out (assoc-ref outputs "out"))
1365 (path (string-append out
1367 (string-take (string-take-right
1368 (assoc-ref inputs "python") 5) 3)
1370 (getenv "PYTHONPATH"))))
1371 (wrap-program (string-append out "/bin/crit")
1372 `("PYTHONPATH" ":" prefix (,path))))
1375 `(("protobuf" ,protobuf)
1376 ("python" ,python-2)
1377 ("python2-protobuf" ,python2-protobuf)
1378 ("python2-ipaddr" ,python2-ipaddr)
1379 ("iproute" ,iproute)
1385 ("nftables" ,nftables)))
1387 `(("pkg-config" ,pkg-config)
1389 ("protobuf-c" ,protobuf-c)
1390 ("asciidoc" ,asciidoc)
1392 ("docbook-xml" ,docbook-xml)
1393 ("docbook-xsl" ,docbook-xsl)))
1394 (home-page "https://criu.org")
1395 (synopsis "Checkpoint and restore in user space")
1396 (description "Using this tool, you can freeze a running application (or
1397 part of it) and checkpoint it to a hard drive as a collection of files. You
1398 can then use the files to restore and run the application from the point it
1399 was frozen at. The distinctive feature of the CRIU project is that it is
1400 mainly implemented in user space.")
1401 ;; The project is licensed under GPLv2; files in the lib/ directory are
1403 (license (list license:gpl2 license:lgpl2.1))))
1405 (define-public qmpbackup
1412 (url "https://github.com/abbbi/qmpbackup")
1414 (file-name (git-file-name name version))
1417 "0swhp5byz44brhyis1a39p11fyn9q84xz5q6v2fah29r7d71kmmx"))))
1418 (build-system python-build-system)
1420 `(#:python ,python-2))
1421 (home-page "https://github.com/abbbi/qmpbackup")
1422 (synopsis "Backup and restore QEMU machines")
1423 (description "qmpbackup is designed to create and restore full and
1424 incremental backups of running QEMU virtual machines via QMP, the QEMU
1426 (license license:gpl3+)))
1428 (define-public looking-glass-client
1429 (let ((commit "182c4752d57690da7f99d5e788de9b8baea33895"))
1431 (name "looking-glass-client")
1432 (version (string-append "a12-" (string-take commit 7)))
1436 (uri (git-reference (url "https://github.com/gnif/LookingGlass")
1438 (file-name (git-file-name name version))
1441 "02bq46ndmzq9cihazzn7xq1x7q5nzm7iw4l9lqzihxcxp9famkhw"))
1442 (modules '((guix build utils)))
1445 ;; Do not create binaries optimized for the CPU of the build machine,
1446 ;; for reproducibility and compatibility. TODO: in the next version
1447 ;; of looking glass, this is exposed as a CMake configure option.
1448 (substitute* "client/CMakeLists.txt"
1452 (build-system cmake-build-system)
1453 (inputs `(("fontconfig" ,fontconfig)
1456 ("openssl" ,openssl)
1458 ("sdl2-ttf" ,sdl2-ttf)
1459 ("spice-protocol" ,spice-protocol)
1460 ("wayland" ,wayland)))
1461 (native-inputs `(("libconfig" ,libconfig)
1463 ("pkg-config" ,pkg-config)))
1465 `(#:tests? #f ;; No tests are available.
1466 #:make-flags '("CC=gcc")
1467 #:phases (modify-phases %standard-phases
1468 (add-before 'configure 'chdir-to-client
1469 (lambda* (#:key outputs #:allow-other-keys)
1472 (add-after 'chdir-to-client 'add-missing-include
1474 ;; Mimic upstream commit b9797529893, required since the
1475 ;; update to Mesa 19.2.
1476 (substitute* "renderers/egl/shader.h"
1477 (("#include <stdbool\\.h>")
1478 "#include <stdbool.h>\n#include <stddef.h>"))
1481 (lambda* (#:key outputs #:allow-other-keys)
1482 (install-file "looking-glass-client"
1483 (string-append (assoc-ref outputs "out")
1486 (home-page "https://looking-glass.hostfission.com")
1487 (synopsis "KVM Frame Relay (KVMFR) implementation")
1488 (description "Looking Glass allows the use of a KVM (Kernel-based Virtual
1489 Machine) configured for VGA PCI Pass-through without an attached physical
1490 monitor, keyboard or mouse. It displays the VM's rendered contents on your main
1492 ;; This package requires SSE instructions.
1493 (supported-systems '("i686-linux" "x86_64-linux"))
1494 (license license:gpl2+))))
1499 (version "1.0.0-rc6")
1503 "https://github.com/opencontainers/runc/releases/"
1504 "download/v" version "/runc.tar.xz"))
1505 (file-name (string-append name "-" version ".tar.xz"))
1506 (patches (search-patches "runc-CVE-2019-5736.patch"))
1509 "1c7832dq70slkjh8qp2civ1wxhhdd2hrx84pq7db1mmqc9fdr3cc"))))
1510 (build-system go-build-system)
1512 '(#:import-path "github.com/opencontainers/runc"
1513 #:install-source? #f
1514 ;; XXX: 20/139 tests fail due to missing /var, cgroups and apparmor in
1515 ;; the build environment.
1518 (modify-phases %standard-phases
1520 (lambda* (#:key source import-path #:allow-other-keys)
1521 ;; Unpack the tarball into 'runc' instead of 'runc-1.0.0-rc5'.
1522 (let ((dest (string-append "src/" import-path)))
1524 (invoke "tar" "-C" (string-append "src/" import-path)
1525 "--strip-components=1"
1528 (lambda* (#:key import-path #:allow-other-keys)
1529 (with-directory-excursion (string-append "src/" import-path)
1530 ;; XXX: requires 'go-md2man'.
1531 ;; (invoke "make" "man")
1535 ;; (invoke "make" "localunittest")))
1537 (lambda* (#:key import-path outputs #:allow-other-keys)
1538 (with-directory-excursion (string-append "src/" import-path)
1539 (let ((out (assoc-ref outputs "out")))
1540 (invoke "make" "install" "install-bash"
1541 (string-append "PREFIX=" out)))))))))
1543 `(("pkg-config" ,pkg-config)))
1545 `(("libseccomp" ,libseccomp)))
1546 (synopsis "Open container initiative runtime")
1547 (home-page "https://www.opencontainers.org/")
1549 "@command{runc} is a command line client for running applications
1550 packaged according to the
1551 @uref{https://github.com/opencontainers/runtime-spec/blob/master/spec.md, Open
1552 Container Initiative (OCI) format} and is a compliant implementation of the
1553 Open Container Initiative specification.")
1554 (license license:asl2.0)))
1556 (define-public umoci
1564 "https://github.com/opencontainers/umoci/releases/download/v"
1565 version "/umoci.tar.xz"))
1566 (file-name (string-append "umoci-" version ".tar.xz"))
1568 (base32 "06q7xfwnqysc013hapx31jhlzmyg8qb467qfkynj673qc7p9bd6h"))))
1569 (build-system go-build-system)
1571 '(#:import-path "github.com/opencontainers/umoci"
1572 #:install-source? #f
1574 (modify-phases %standard-phases
1576 (lambda* (#:key source import-path #:allow-other-keys)
1577 ;; Unpack the tarball into 'umoci' instead of "runc-${version}".
1578 (let ((dest (string-append "src/" import-path)))
1580 (invoke "tar" "-C" (string-append "src/" import-path)
1581 "--strip-components=1"
1584 (lambda* (#:key import-path #:allow-other-keys)
1585 (with-directory-excursion (string-append "src/" import-path)
1586 ;; TODO: build manpages with 'go-md2man'.
1587 (invoke "make" "SHELL=bash"))))
1589 (lambda* (#:key import-path outputs #:allow-other-keys)
1590 (let* ((out (assoc-ref outputs "out"))
1591 (bindir (string-append out "/bin")))
1592 (install-file (string-append "src/" import-path "/umoci")
1595 (home-page "https://umo.ci/")
1596 (synopsis "Tool for modifying Open Container images")
1598 "@command{umoci} is a tool that allows for high-level modification of an
1599 Open Container Initiative (OCI) image layout and its tagged images.")
1600 (license license:asl2.0)))
1602 (define-public skopeo
1609 (url "https://github.com/containers/skopeo")
1610 (commit (string-append "v" version))))
1611 (file-name (git-file-name name version))
1614 "1v7k3ki10i6082r7zswblyirx6zck674y6bw3plssw4p1l2611rd"))))
1615 (build-system go-build-system)
1617 `(("pkg-config" ,pkg-config)
1618 ("go-github-com-go-md2man" ,go-github-com-go-md2man)))
1620 `(("btrfs-progs" ,btrfs-progs)
1622 ("libassuan" ,libassuan)
1623 ("libselinux" ,libselinux)
1624 ("libostree" ,libostree)
1629 '(#:import-path "github.com/containers/skopeo"
1630 #:install-source? #f
1631 #:tests? #f ; The tests require Docker
1633 (modify-phases %standard-phases
1635 (lambda* (#:key import-path #:allow-other-keys)
1636 (with-directory-excursion (string-append "src/" import-path)
1637 (invoke "make" "bin/skopeo"))))
1638 (add-after 'build 'build-docs
1639 (lambda* (#:key import-path #:allow-other-keys)
1640 (with-directory-excursion (string-append "src/" import-path)
1641 (invoke "make" "docs"))))
1643 (lambda* (#:key import-path outputs #:allow-other-keys)
1644 (with-directory-excursion (string-append "src/" import-path)
1645 (let ((out (assoc-ref outputs "out")))
1646 (install-file "default-policy.json"
1647 (string-append out "/etc/containers"))
1648 (invoke "make" "install-binary" "install-completions" "install-docs"
1649 (string-append "PREFIX=" out)))))))))
1650 (home-page "https://github.com/containers/skopeo")
1651 (synopsis "Interact with container images and container image registries")
1653 "@command{skopeo} is a command line utility providing various operations
1654 with container images and container image registries. It can:
1657 @item Copy container images between various containers image stores,
1658 converting them as necessary.
1660 @item Convert a Docker schema 2 or schema 1 container image to an OCI image.
1662 @item Inspect a repository on a container registry without needlessly pulling
1665 @item Sign and verify container images.
1667 @item Delete container images from a remote container registry.
1670 (license license:asl2.0)))
1672 (define-public python-vagrant
1674 (name "python-vagrant")
1679 (uri (pypi-uri "python-vagrant" version))
1682 "1ikrh6canhcxg5y7pzmkcnnydikppv7s6sm9prfx90nk0ac8m6mg"))))
1683 (build-system python-build-system)
1685 '(#:tests? #f)) ; tests involve running vagrant.
1686 (home-page "https://github.com/todddeluca/python-vagrant")
1687 (synopsis "Python bindings for Vagrant")
1689 "Python-vagrant is a Python module that provides a thin wrapper around the
1690 @code{vagrant} command line executable, allowing programmatic control of Vagrant
1692 (license license:expat)))
1694 (define-public bubblewrap
1700 (uri (string-append "https://github.com/containers/bubblewrap/"
1701 "releases/download/v" version "/bubblewrap-"
1705 "00ycgi6q2yngh06bnz50wkvar6r2jnjf3j158grhi9k13jdrpimr"))))
1706 (build-system gnu-build-system)
1709 (modify-phases %standard-phases
1710 (add-after 'unpack 'fix-test
1711 (lambda* (#:key outputs #:allow-other-keys)
1712 ;; Tests try to access /var/tmp, which is not possible in our build
1713 ;; environment. Let's give them another directory.
1714 ;; /tmp gets overriden in some tests, so we need another directory.
1715 ;; the only possibility is the output directory.
1716 (let ((tmp-dir (string-append (assoc-ref outputs "out") "/tmp")))
1718 (substitute* "tests/test-run.sh"
1719 (("/var/tmp") tmp-dir)
1720 ;; Tests create a temporary python script, so fix its shebang.
1721 (("/usr/bin/env python") (which "python"))
1722 ;; Some tests try to access /usr, but that doesn't exist.
1723 ;; Give them /gnu instead.
1725 (("--ro-bind /bin /bin") "--ro-bind /gnu /bin")
1726 (("--ro-bind /sbin /sbin") "--ro-bind /gnu /sbin")
1727 (("--ro-bind /lib /lib") "--ro-bind /gnu /lib")
1728 ((" */bin/bash") (which "bash"))
1729 (("/bin/sh") (which "sh"))
1730 (("findmnt") (which "findmnt"))))
1732 ;; Remove the directory we gave to tests to have a clean package.
1733 (add-after 'check 'remove-tmp-dir
1734 (lambda* (#:key outputs #:allow-other-keys)
1735 (delete-file-recursively (string-append (assoc-ref outputs "out") "/tmp"))
1738 `(("libcap" ,libcap)))
1740 `(("python" ,python-wrapper)
1741 ("util-linux" ,util-linux)))
1742 (home-page "https://github.com/containers/bubblewrap")
1743 (synopsis "Unprivileged sandboxing tool")
1744 (description "Bubblewrap is aimed at running applications in a sandbox,
1745 restricting their access to parts of the operating system or user data such as
1746 the home directory. Bubblewrap always creates a new mount namespace, and the
1747 user can specify exactly what parts of the file system should be made visible
1748 in the sandbox. These directories are mounted with the @code{nodev} option
1749 by default and can be made read-only.")
1750 (license license:lgpl2.0+)))
1752 (define-public bochs
1759 (uri (string-append "https://sourceforge.net/projects/bochs/files/bochs/"
1760 version "/bochs-" version ".tar.gz"))
1762 (base32 "0ql8q6y1k356li1g9gbvl21448mlxphxxi6kjb2b3pxvzd0pp2b3"))))
1763 (build-system gnu-build-system)
1765 `(#:tests? #f)) ; no tests exist
1767 `(("libxrandr" ,libxrandr)))
1768 (home-page "http://bochs.sourceforge.net/")
1769 (synopsis "Emulator for x86 PC")
1771 "Bochs is an emulator which can emulate Intel x86 CPU, common I/O
1772 devices, and a custom BIOS. It can also be compiled to emulate many different
1773 x86 CPUs, from early 386 to the most recent x86-64 Intel and AMD processors.
1774 Bochs can run most Operating Systems inside the emulation including Linux,
1775 DOS or Microsoft Windows.")
1776 (license license:lgpl2.0+)))
1785 (url "git://xenbits.xenproject.org/xen.git")
1786 (commit (string-append "RELEASE-" version))))
1787 (file-name (git-file-name name version))
1790 "0py50n995gv909i0d1lfdcj9wcp5g1d5z6m2291jqqlfyany138g"))))
1791 (build-system gnu-build-system)
1794 (list "--enable-rpath"
1795 "--disable-qemu-traditional" ; It tries to do "git clone"
1796 "--disable-rombios" ; would try to "git clone" via etherboot.
1797 ;; TODO: Re-enable stubdom (it's "more secure" to use it).
1798 "--disable-stubdom" ; tries to "git clone" old patched newlib.
1799 (string-append "--with-initddir="
1800 (assoc-ref %outputs "out")
1802 (string-append "--with-system-qemu="
1803 (assoc-ref %build-inputs "qemu")
1804 "/bin/qemu-system-i386")
1805 (string-append "--with-system-seabios="
1806 (assoc-ref %build-inputs "seabios")
1807 "/share/firmware/bios.bin")
1808 (string-append "--with-system-ovmf="
1809 (assoc-ref %build-inputs "ovmf")
1810 "/share/firmware/ovmf_ia32.bin"))
1811 #:make-flags (list "-j" "1"
1812 "XEN_BUILD_DATE=Thu Jan 1 01:00:01 CET 1970"
1813 "XEN_BUILD_TIME=01:00:01"
1816 "SMBIOS_REL_DATE=01/01/1970"
1817 "VGABIOS_REL_DATE=01 Jan 1970"
1818 ; QEMU_TRADITIONAL_LOC
1820 "SYSCONFIG_DIR=/tmp/etc/default"
1821 (string-append "BASH_COMPLETION_DIR="
1822 (assoc-ref %outputs "out")
1823 "/etc/bash_completion.d")
1824 (string-append "BOOT_DIR="
1825 (assoc-ref %outputs "out")
1827 (string-append "DEBUG_DIR="
1828 (assoc-ref %outputs "out")
1830 (string-append "EFI_DIR="
1831 (assoc-ref %outputs "out")
1832 "/lib/efi") ; TODO lib64 ?
1833 "MINIOS_UPSTREAM_URL="
1834 ;(string-append "DISTDIR="
1835 ; (assoc-ref %outputs "out"))
1837 #:test-target "test"
1839 (modify-phases %standard-phases
1840 (add-after 'unpack 'unpack-mini-os
1841 (lambda* (#:key inputs #:allow-other-keys)
1842 (copy-recursively (assoc-ref inputs "mini-os") "extras/mini-os")
1844 (add-after 'unpack-mini-os 'patch
1845 (lambda* (#:key inputs outputs #:allow-other-keys)
1846 (substitute* "tools/firmware/Rules.mk"
1847 (("override XEN_TARGET_ARCH = x86_32")
1848 (string-append "override XEN_TARGET_ARCH = x86_32
1849 override CC = " (assoc-ref inputs "cross-gcc") "/bin/i686-linux-gnu-gcc"))
1851 (string-append "CFLAGS=-I" (assoc-ref inputs "cross-libc")
1853 (substitute* "config/x86_32.mk"
1854 (("CFLAGS += -m32 -march=i686")
1855 (string-append "CFLAGS += -march=i686 -I"
1856 (assoc-ref inputs "cross-libc")
1858 ;; /var is not in /gnu/store , so don't try to create it.
1859 (substitute* '("tools/Makefile"
1860 "tools/xenstore/Makefile"
1861 "tools/xenpaging/Makefile")
1862 (("\\$\\(INSTALL_DIR\\) .*XEN_(DUMP|LOG|RUN|LIB|PAGING)_DIR.*")
1864 (("\\$\\(INSTALL_DIR\\) .*XEN_(RUN|LIB)_STORED.*")
1866 ;; Prevent xen from creating /etc .
1867 (substitute* "tools/examples/Makefile"
1868 ((" install-readmes") "")
1869 ((" install-configs") ""))
1871 (substitute* "tools/pygrub/setup.py"
1873 ; TODO: extra_link_args = ['-Wl,-rpath=/opt/foo'],
1874 (string-append "runtime_library_dirs = ['"
1875 (assoc-ref outputs "out")
1876 "/lib'],\nlibrary_dirs =")))
1878 (add-before 'configure 'patch-xen-script-directory
1879 (lambda* (#:key outputs #:allow-other-keys)
1880 (substitute* '("configure"
1883 (("XEN_SCRIPT_DIR=.*")
1884 (string-append "XEN_SCRIPT_DIR="
1885 (assoc-ref outputs "out")
1886 "/etc/xen/scripts")))
1888 (add-before 'configure 'set-environment-up
1889 (lambda* (#:key make-flags #:allow-other-keys)
1891 (string-contains x "cross-i686-linux"))
1892 (define (filter-environment! filter-predicate
1893 environment-variable-names)
1896 (let* ((env-value (getenv env-name))
1897 (search-path (search-path-as-string->list env-value))
1898 (new-search-path (filter filter-predicate
1900 (new-env-value (list->search-path-as-string
1901 new-search-path ":")))
1902 (setenv env-name new-env-value)))
1903 environment-variable-names))
1904 (setenv "CROSS_CPATH" (getenv "CPATH"))
1905 (setenv "CROSS_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
1906 (filter-environment! cross?
1908 "CROSS_LIBRARY_PATH"))
1909 (filter-environment! (lambda (e) (not (cross? e)))
1912 ;; Guix tries to be helpful and automatically adds
1913 ;; mini-os-git-checkout/include to the include path,
1914 ;; but actually we don't want it to be there (yet).
1915 (filter-environment! (lambda (e)
1918 "mini-os-git-checkout")))
1921 (setenv "EFI_VENDOR" "guix")
1924 (lambda* (#:key make-flags #:allow-other-keys)
1925 (apply invoke "make" "world" make-flags))))))
1927 `(("acpica" ,acpica) ; TODO: patch iasl invocation.
1928 ("bridge-utils" ,bridge-utils) ; TODO: patch invocations.
1930 ("iproute" ,iproute) ; TODO: patch invocations.
1933 ("libyajl" ,libyajl)
1934 ("ncurses" ,ncurses)
1935 ("openssl" ,openssl)
1938 ("qemu" ,qemu-minimal)
1939 ("seabios" ,seabios)
1940 ("util-linux" ,util-linux "lib") ; uuid
1941 ; TODO: ocaml-findlib, ocaml-nox.
1942 ("xz" ,xz) ; for liblzma
1947 ("cmake" ,cmake-minimal)
1950 ("gettext" ,gettext-minimal)
1956 (url "http://xenbits.xen.org/git-http/mini-os.git")
1957 (commit (string-append "xen-RELEASE-" version))))
1960 "1i8pcl19n60i2m9vlg79q3nknpj209c9ic5x10wxaicx45kc107f"))
1961 (file-name "mini-os-git-checkout")))
1964 ("pkg-config" ,pkg-config)
1965 ("python" ,python-2)
1967 ("cross-gcc" ,(cross-gcc "i686-linux-gnu"
1968 #:xbinutils (cross-binutils "i686-linux-gnu")
1969 #:libc (cross-libc "i686-linux-gnu")))
1970 ("cross-libc" ,(cross-libc "i686-linux-gnu")) ; header files
1971 ("cross-libc-static" ,(cross-libc "i686-linux-gnu") "static")))
1972 (home-page "https://xenproject.org/")
1973 (synopsis "Xen Virtual Machine Monitor")
1974 (description "This package provides the Xen Virtual Machine Monitor
1975 which is a hypervisor.")
1976 ;; TODO: Some files are licensed differently. List those.
1977 (license license:gpl2)
1978 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))))
1980 (define-public osinfo-db-tools
1982 (name "osinfo-db-tools")
1986 (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-tools-"
1991 "038q3gzdbkfkhpicj0755mw1q4gbvn57pslpw8n2dp3lds9im0g9"))))
1992 (build-system meson-build-system)
1994 `(("libsoup" ,libsoup)
1995 ("libxml2" ,libxml2)
1996 ("libxslt" ,libxslt)
1997 ("json-glib" ,json-glib)
1998 ("libarchive" ,libarchive)))
2001 ("gobject-introspection" ,gobject-introspection)
2002 ("gettext" ,gettext-minimal)
2003 ("pkg-config" ,pkg-config)
2006 ("pytest" ,python-pytest)
2007 ("requests" ,python-requests)))
2008 (home-page "https://gitlab.com/libosinfo/osinfo-db-tools")
2009 (synopsis "Tools for managing the osinfo database")
2010 (description "This package contains a set of tools to assist
2011 administrators and developers in managing the database.")
2012 (license license:lgpl2.0+)))
2014 (define-public osinfo-db
2017 (version "20201011")
2020 (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-"
2024 "1zzx5gsqgzg2zki6h8vl0h7kpcrk5i2s1qhz7gcb18s7g99px8aj"))))
2025 (build-system trivial-build-system)
2027 `(#:modules ((guix build utils))
2030 (use-modules (guix build utils))
2031 (let* ((out (assoc-ref %outputs "out"))
2032 (osinfo-dir (string-append out "/share/osinfo"))
2033 (source (assoc-ref %build-inputs "source"))
2035 (string-append (assoc-ref %build-inputs "osinfo-db-tools")
2036 "/bin/osinfo-db-import")))
2037 (mkdir-p osinfo-dir)
2038 (invoke osinfo-db-import "--dir" osinfo-dir source)
2041 `(("intltool" ,intltool)
2042 ("osinfo-db-tools" ,osinfo-db-tools)))
2043 (home-page "https://gitlab.com/libosinfo/osinfo-db")
2044 (synopsis "Database of information about operating systems")
2045 (description "Osinfo-db provides the database files for use with the
2046 libosinfo library. It provides information about guest operating systems for
2047 use with virtualization provisioning tools")
2048 (license license:lgpl2.0+)))