You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2025 lines
87 KiB

gnu: Separate Python core packages from the rest. * gnu/packages/python.scm: Move hundreds of package definitions from here... * gnu/packages/python-xyz.scm: ...to this new module. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/ada.scm, gnu/packages/admin.scm, gnu/packages/android.scm, gnu/packages/audio.scm, gnu/packages/backup.scm, gnu/packages/benchmark.scm, gnu/packages/bioinformatics.scm, gnu/packages/bittorrent.scm, gnu/packages/calendar.scm, gnu/packages/check.scm, gnu/packages/chemistry.scm, gnu/packages/cluster.scm, gnu/packages/compression.scm, gnu/packages/connman.scm, gnu/packages/crypto.scm, gnu/packages/cups.scm, gnu/packages/databases.scm, gnu/packages/dav.scm, gnu/packages/direct-connect.scm, gnu/packages/disk.scm, gnu/packages/django.scm, gnu/packages/dlang.scm, gnu/packages/docker.scm, gnu/packages/ebook.scm, gnu/packages/elf.scm, gnu/packages/emacs.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/enlightenment.scm, gnu/packages/finance.scm, gnu/packages/fltk.scm, gnu/packages/fontutils.scm, gnu/packages/freedesktop.scm, gnu/packages/game-development.scm, gnu/packages/games.scm, gnu/packages/geo.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnupg.scm, gnu/packages/gnuzilla.scm, gnu/packages/graph.scm, gnu/packages/graphics.scm, gnu/packages/graphviz.scm, gnu/packages/gtk.scm, gnu/packages/ham-radio.scm, gnu/packages/image-processing.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/irc.scm, gnu/packages/jrnl.scm, gnu/packages/julia.scm, gnu/packages/kde-frameworks.scm, gnu/packages/key-mon.scm, gnu/packages/libffi.scm, gnu/packages/libreoffice.scm, gnu/packages/libusb.scm, gnu/packages/lirc.scm, gnu/packages/logging.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/mate.scm, gnu/packages/maths.scm, gnu/packages/medical.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mp3.scm, gnu/packages/mpd.scm, gnu/packages/music.scm, gnu/packages/networking.scm, gnu/packages/nutrition.scm, gnu/packages/openldap.scm, gnu/packages/openstack.scm, gnu/packages/package-management.scm, gnu/packages/password-utils.scm, gnu/packages/patchutils.scm, gnu/packages/pdf.scm, gnu/packages/photo.scm, gnu/packages/polkit.scm, gnu/packages/protobuf.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/qt.scm, gnu/packages/rdf.scm, gnu/packages/ruby.scm, gnu/packages/search.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/simulation.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/storage.scm, gnu/packages/sync.scm, gnu/packages/terminals.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm, gnu/packages/tor.scm, gnu/packages/tryton.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/virtualization.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wicd.scm, gnu/packages/xdisorg.scm, gnu/packages/xorg.scm: Update module references.
3 years ago
gnu: util-linux: Move libraries to separate output. Fixes <https://bugs.gnu.org/37732>. Reported by Diego Nicola Barbato <dnbarbato@posteo.de>. * gnu/packages/linux.scm (util-linux)[outputs]: Add "lib". [arguments]: Update #:configure-flags and the "move-static-libraries" phase accordingly. Add phases "patch-build-scripts" and "adjust-pkg-config-files". (e2fsprogs, psm, mtd-utils, f2fs-tools, f2fs-tools-1.7, eudev, xfsprogs)[inputs]: Change to the "lib" output of UTIL-LINUX. (btrfs-progs)[inputs]: Remove duplicate UTIL-LINUX inputs and change to use the "lib" output. * gnu/packages/admin.scm (pam-mount)[inputs]: Add UTIL-LINUX:LIB. (testdisk)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/android.scm (abootimg)[inputs]: Likewise. * gnu/packages/audio.scm (jack-1)[propagated-inputs]: Likewise. * gnu/packages/bootloaders.scm (syslinux, vboot-utils)[inputs]: Likewise. * gnu/packages/chez.scm (chez-scheme)[inputs]: Likewise. * gnu/packages/cryptsetup.scm (cryptsetup, cryptsetup-static)[inputs]: Likewise. * gnu/packages/databases.scm (postgresql, 4store)[inputs]: Likewise. * gnu/packages/disk.scm (ndctl, gptfdisk, fdisk, gparted, rmlint, volume-key)[inputs]: Likewise. (parted)[inputs]: Likewise. [native-inputs]: Add UTIL-LINUX. * gnu/packages/efi.scm (sbsigntools)[inputs]: Add UTIL-LINUX:LIB. * gnu/packages/engineering.scm (lib3mf)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/enlightenment.scm (efl)[propagated-inputs]: Likewise. * gnu/packages/file-systems.scm (glusterfs, jfsutils, zfs)[inputs]: Likewise. * gnu/packages/firmware.scm (ovmf)[inputs]: Likewise. * gnu/packages/fontutils.scm (fontconfig)[propagated-inputs]: Likewise. * gnu/packages/freedesktop.scm (localed)[inputs]: Likewise. * gnu/packages/glib.scm (glib, appstream-glib)[propagated-inputs]: Likewise. * gnu/packages/gnome.scm (tracker, gnome-terminal)[inputs]: Likewise. * gnu/packages/jupyter.scm (xeus)[inputs]: Likewise. * gnu/packages/kde.scm (kpmcore)[inputs]: Likewise. * gnu/packages/kodi.scm (crossguid)[inputs]: Likewise. * gnu/packages/lighting.scm (ola)[inputs]: Likewise. * gnu/packages/music.scm (libgig)[inputs]: Likewise. * gnu/packages/nfs.scm (nfs-utils)[inputs]: Likewise. * gnu/packages/opencog.scm (opencog)[inputs]: Likewise. * gnu/packages/package-management.scm (msitools)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/password-utils.scm (pwsafe)[inputs]: Likewise. * gnu/packages/telephony.scm (pjproject)[propagated-inputs]: Likewise. * gnu/packages/rdf.scm (rasqal)[inputs]: Likewise. * gnu/packages/search.scm (xapian)[inputs]: Likewise. * gnu/packages/sssd.scm (sssd)[native-inputs]: Likewise. * gnu/packages/storage.scm (ceph)[inputs]: Add UTIL-LINUX:LIB. * gnu/packages/task-management.scm (taskwarrior)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/virtualization.scm (libvirt, xen)[inputs]: Likewise. * gnu/packages/xorg.scm (libsm)[inputs]: Likewise.
2 years ago
gnu: Remove ".git" from "https://github/…/….git". Until now, 'lookup-origin' and thus 'lookup-origin-revision' in (guix swh) would sometimes return #f for these because the ".git" URLs are redirects to the non-".git" URLs. Consequently, 'guix lint -c archival' would keep saying "scheduled Software Heritage archival"; likewise, the fallback download code would fail. * gnu/packages/ada.scm, gnu/packages/admin.scm, gnu/packages/aidc.scm, gnu/packages/algebra.scm, gnu/packages/android.scm, gnu/packages/animation.scm, gnu/packages/arcan.scm, gnu/packages/assembly.scm, gnu/packages/audio.scm, gnu/packages/authentication.scm, gnu/packages/avr.scm, gnu/packages/axoloti.scm, gnu/packages/backup.scm, gnu/packages/bash.scm, gnu/packages/benchmark.scm, gnu/packages/bioconductor.scm, gnu/packages/bioinformatics.scm, gnu/packages/bittorrent.scm, gnu/packages/boost.scm, gnu/packages/build-tools.scm, gnu/packages/c.scm, gnu/packages/calendar.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/chemistry.scm, gnu/packages/chez.scm, gnu/packages/clojure.scm, gnu/packages/code.scm, gnu/packages/compression.scm, gnu/packages/compton.scm, gnu/packages/coq.scm, gnu/packages/cpp.scm, gnu/packages/cran.scm, gnu/packages/crypto.scm, gnu/packages/curl.scm, gnu/packages/databases.scm, gnu/packages/datastructures.scm, gnu/packages/debug.scm, gnu/packages/disk.scm, gnu/packages/distributed.scm, gnu/packages/django.scm, gnu/packages/dlang.scm, gnu/packages/dns.scm, gnu/packages/docker.scm, gnu/packages/education.scm, gnu/packages/efi.scm, gnu/packages/elixir.scm, gnu/packages/emacs-xyz.scm, gnu/packages/embedded.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/erlang.scm, gnu/packages/fabric-management.scm, gnu/packages/file-systems.scm, gnu/packages/finance.scm, gnu/packages/firmware.scm, gnu/packages/flashing-tools.scm, gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/fpga.scm, gnu/packages/game-development.scm, gnu/packages/games.scm, gnu/packages/genealogy.scm, gnu/packages/genimage.scm, gnu/packages/geo.scm, gnu/packages/gimp.scm, gnu/packages/gl.scm, gnu/packages/gnome-xyz.scm, gnu/packages/gnome.scm, gnu/packages/gnuzilla.scm, gnu/packages/golang.scm, gnu/packages/gpodder.scm, gnu/packages/graph.scm, gnu/packages/graphics.scm, gnu/packages/graphviz.scm, gnu/packages/groff.scm, gnu/packages/groovy.scm, gnu/packages/gtk.scm, gnu/packages/guile-xyz.scm, gnu/packages/guile.scm, gnu/packages/hardware.scm, gnu/packages/haskell-apps.scm, gnu/packages/haskell-xyz.scm, gnu/packages/hexedit.scm, gnu/packages/i2p.scm, gnu/packages/ibus.scm, gnu/packages/image-processing.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/ipfs.scm, gnu/packages/java-graphics.scm, gnu/packages/java-maths.scm, gnu/packages/java.scm, gnu/packages/javascript.scm, gnu/packages/jrnl.scm, gnu/packages/julia.scm, gnu/packages/jupyter.scm, gnu/packages/kodi.scm, gnu/packages/language.scm, gnu/packages/lego.scm, gnu/packages/less.scm, gnu/packages/libusb.scm, gnu/packages/linux.scm, gnu/packages/lirc.scm, gnu/packages/lisp-xyz.scm, gnu/packages/llvm.scm, gnu/packages/logging.scm, gnu/packages/lolcode.scm, gnu/packages/lua.scm, gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/maths.scm, gnu/packages/maven.scm, gnu/packages/mes.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mpd.scm, gnu/packages/music.scm, gnu/packages/networking.scm, gnu/packages/node-xyz.scm, gnu/packages/ocaml.scm, gnu/packages/ocr.scm, gnu/packages/onc-rpc.scm, gnu/packages/opencl.scm, gnu/packages/opencog.scm, gnu/packages/pantheon.scm, gnu/packages/password-utils.scm, gnu/packages/patchutils.scm, gnu/packages/pdf.scm, gnu/packages/perl6.scm, gnu/packages/phabricator.scm, gnu/packages/popt.scm, gnu/packages/printers.scm, gnu/packages/prolog.scm, gnu/packages/protobuf.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/python-xyz.scm, gnu/packages/qt.scm, gnu/packages/radio.scm, gnu/packages/rails.scm, gnu/packages/rdf.scm, gnu/packages/rednotebook.scm, gnu/packages/rpc.scm, gnu/packages/rsync.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/security-token.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/shellutils.scm, gnu/packages/simh.scm, gnu/packages/sml.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/stenography.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/synergy.scm, gnu/packages/telephony.scm, gnu/packages/terminals.scm, gnu/packages/tex.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tmux.scm, gnu/packages/tor.scm, gnu/packages/toys.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/virtualization.scm, gnu/packages/vlang.scm, gnu/packages/vnc.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wireservice.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, tests/lint.scm: Remove trailing ".git" from 'git-reference' URL.
1 year ago
gnu: util-linux: Move libraries to separate output. Fixes <https://bugs.gnu.org/37732>. Reported by Diego Nicola Barbato <dnbarbato@posteo.de>. * gnu/packages/linux.scm (util-linux)[outputs]: Add "lib". [arguments]: Update #:configure-flags and the "move-static-libraries" phase accordingly. Add phases "patch-build-scripts" and "adjust-pkg-config-files". (e2fsprogs, psm, mtd-utils, f2fs-tools, f2fs-tools-1.7, eudev, xfsprogs)[inputs]: Change to the "lib" output of UTIL-LINUX. (btrfs-progs)[inputs]: Remove duplicate UTIL-LINUX inputs and change to use the "lib" output. * gnu/packages/admin.scm (pam-mount)[inputs]: Add UTIL-LINUX:LIB. (testdisk)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/android.scm (abootimg)[inputs]: Likewise. * gnu/packages/audio.scm (jack-1)[propagated-inputs]: Likewise. * gnu/packages/bootloaders.scm (syslinux, vboot-utils)[inputs]: Likewise. * gnu/packages/chez.scm (chez-scheme)[inputs]: Likewise. * gnu/packages/cryptsetup.scm (cryptsetup, cryptsetup-static)[inputs]: Likewise. * gnu/packages/databases.scm (postgresql, 4store)[inputs]: Likewise. * gnu/packages/disk.scm (ndctl, gptfdisk, fdisk, gparted, rmlint, volume-key)[inputs]: Likewise. (parted)[inputs]: Likewise. [native-inputs]: Add UTIL-LINUX. * gnu/packages/efi.scm (sbsigntools)[inputs]: Add UTIL-LINUX:LIB. * gnu/packages/engineering.scm (lib3mf)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/enlightenment.scm (efl)[propagated-inputs]: Likewise. * gnu/packages/file-systems.scm (glusterfs, jfsutils, zfs)[inputs]: Likewise. * gnu/packages/firmware.scm (ovmf)[inputs]: Likewise. * gnu/packages/fontutils.scm (fontconfig)[propagated-inputs]: Likewise. * gnu/packages/freedesktop.scm (localed)[inputs]: Likewise. * gnu/packages/glib.scm (glib, appstream-glib)[propagated-inputs]: Likewise. * gnu/packages/gnome.scm (tracker, gnome-terminal)[inputs]: Likewise. * gnu/packages/jupyter.scm (xeus)[inputs]: Likewise. * gnu/packages/kde.scm (kpmcore)[inputs]: Likewise. * gnu/packages/kodi.scm (crossguid)[inputs]: Likewise. * gnu/packages/lighting.scm (ola)[inputs]: Likewise. * gnu/packages/music.scm (libgig)[inputs]: Likewise. * gnu/packages/nfs.scm (nfs-utils)[inputs]: Likewise. * gnu/packages/opencog.scm (opencog)[inputs]: Likewise. * gnu/packages/package-management.scm (msitools)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/password-utils.scm (pwsafe)[inputs]: Likewise. * gnu/packages/telephony.scm (pjproject)[propagated-inputs]: Likewise. * gnu/packages/rdf.scm (rasqal)[inputs]: Likewise. * gnu/packages/search.scm (xapian)[inputs]: Likewise. * gnu/packages/sssd.scm (sssd)[native-inputs]: Likewise. * gnu/packages/storage.scm (ceph)[inputs]: Add UTIL-LINUX:LIB. * gnu/packages/task-management.scm (taskwarrior)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/virtualization.scm (libvirt, xen)[inputs]: Likewise. * gnu/packages/xorg.scm (libsm)[inputs]: Likewise.
2 years ago
  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. ;;;
  19. ;;; This file is part of GNU Guix.
  20. ;;;
  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.
  25. ;;;
  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.
  30. ;;;
  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/>.
  33. (define-module (gnu packages virtualization)
  34. #:use-module (gnu packages)
  35. #:use-module (gnu packages admin)
  36. #:use-module (gnu packages assembly)
  37. #:use-module (gnu packages attr)
  38. #:use-module (gnu packages autotools)
  39. #:use-module (gnu packages backup)
  40. #:use-module (gnu packages base)
  41. #:use-module (gnu packages bison)
  42. #:use-module (gnu packages check)
  43. #:use-module (gnu packages cmake)
  44. #:use-module (gnu packages compression)
  45. #:use-module (gnu packages cross-base)
  46. #:use-module (gnu packages curl)
  47. #:use-module (gnu packages cyrus-sasl)
  48. #:use-module (gnu packages debian)
  49. #:use-module (gnu packages disk)
  50. #:use-module (gnu packages dns)
  51. #:use-module (gnu packages docbook)
  52. #:use-module (gnu packages documentation)
  53. #:use-module (gnu packages figlet)
  54. #:use-module (gnu packages firmware)
  55. #:use-module (gnu packages flex)
  56. #:use-module (gnu packages fontutils)
  57. #:use-module (gnu packages freedesktop)
  58. #:use-module (gnu packages gettext)
  59. #:use-module (gnu packages gl)
  60. #:use-module (gnu packages glib)
  61. #:use-module (gnu packages gnome)
  62. #:use-module (gnu packages gnupg)
  63. #:use-module (gnu packages golang)
  64. #:use-module (gnu packages graphviz)
  65. #:use-module (gnu packages gtk)
  66. #:use-module (gnu packages haskell)
  67. #:use-module (gnu packages haskell-apps)
  68. #:use-module (gnu packages haskell-check)
  69. #:use-module (gnu packages haskell-crypto)
  70. #:use-module (gnu packages haskell-web)
  71. #:use-module (gnu packages haskell-xyz)
  72. #:use-module (gnu packages image)
  73. #:use-module (gnu packages libbsd)
  74. #:use-module (gnu packages libusb)
  75. #:use-module (gnu packages linux)
  76. #:use-module (gnu packages m4)
  77. #:use-module (gnu packages ncurses)
  78. #:use-module (gnu packages nettle)
  79. #:use-module (gnu packages networking)
  80. #:use-module (gnu packages onc-rpc)
  81. #:use-module (gnu packages package-management)
  82. #:use-module (gnu packages perl)
  83. #:use-module (gnu packages pkg-config)
  84. #:use-module (gnu packages polkit)
  85. #:use-module (gnu packages protobuf)
  86. #:use-module (gnu packages python)
  87. #:use-module (gnu packages python-crypto)
  88. #:use-module (gnu packages python-web)
  89. #:use-module (gnu packages python-xyz)
  90. #:use-module (gnu packages pulseaudio)
  91. #:use-module (gnu packages selinux)
  92. #:use-module (gnu packages sdl)
  93. #:use-module (gnu packages sphinx)
  94. #:use-module (gnu packages spice)
  95. #:use-module (gnu packages ssh)
  96. #:use-module (gnu packages texinfo)
  97. #:use-module (gnu packages textutils)
  98. #:use-module (gnu packages tls)
  99. #:use-module (gnu packages web)
  100. #:use-module (gnu packages wget)
  101. #:use-module (gnu packages xdisorg)
  102. #:use-module (gnu packages xml)
  103. #:use-module (gnu packages xorg)
  104. #:use-module (guix build-system cmake)
  105. #:use-module (guix build-system gnu)
  106. #:use-module (guix build-system go)
  107. #:use-module (guix build-system meson)
  108. #:use-module (guix build-system python)
  109. #:use-module (guix build-system trivial)
  110. #:use-module (guix download)
  111. #:use-module (guix git-download)
  112. #:use-module ((guix licenses) #:prefix license:)
  113. #:use-module (guix packages)
  114. #:use-module (guix utils)
  115. #:use-module (srfi srfi-1)
  116. #:use-module (ice-9 match))
  117. (define (qemu-patch commit file-name sha256-bv)
  118. "Return an origin for COMMIT."
  119. (origin
  120. (method url-fetch)
  121. (uri (string-append
  122. "http://git.qemu.org/?p=qemu.git;a=commitdiff_plain;h="
  123. commit))
  124. (hash (content-hash sha256-bv sha256))
  125. (file-name file-name)))
  126. (define-public qemu
  127. (package
  128. (name "qemu")
  129. (version "5.0.0")
  130. (source (origin
  131. (method url-fetch)
  132. (uri (string-append "https://download.qemu.org/qemu-"
  133. version ".tar.xz"))
  134. (sha256
  135. (base32
  136. "1dlcwyshdp94fwd30pddxf9bn2q8dfw5jsvry2gvdj551wmaj4rg"))))
  137. (build-system gnu-build-system)
  138. (arguments
  139. `(;; Running tests in parallel can occasionally lead to failures, like:
  140. ;; boot_sector_test: assertion failed (signature == SIGNATURE): (0x00000000 == 0x0000dead)
  141. #:parallel-tests? #f
  142. ;; FIXME: Disable tests on i686 to work around
  143. ;; <https://bugs.gnu.org/40527>.
  144. #:tests? ,(or (%current-target-system)
  145. (not (string=? "i686-linux" (%current-system))))
  146. #:configure-flags (list "--enable-usb-redir" "--enable-opengl"
  147. "--enable-docs"
  148. (string-append "--smbd="
  149. (assoc-ref %outputs "out")
  150. "/libexec/samba-wrapper")
  151. "--audio-drv-list=alsa,pa,sdl")
  152. ;; Make build and test output verbose to facilitate investigation upon failure.
  153. #:make-flags '("V=1")
  154. #:modules ((srfi srfi-1)
  155. (ice-9 match)
  156. ,@%gnu-build-system-modules)
  157. #:phases
  158. (modify-phases %standard-phases
  159. (add-after 'set-paths 'hide-glibc
  160. (lambda* (#:key inputs #:allow-other-keys)
  161. ;; Work around https://issues.guix.info/issue/36882. We need to
  162. ;; remove glibc from C_INCLUDE_PATH so that the one hardcoded in GCC,
  163. ;; at the bottom of GCC include search-path is used.
  164. (let* ((filters '("libc"))
  165. (input-directories
  166. (filter-map (lambda (input)
  167. (match input
  168. ((name . dir)
  169. (and (not (member name filters))
  170. dir))))
  171. inputs)))
  172. (set-path-environment-variable "C_INCLUDE_PATH"
  173. '("include")
  174. input-directories)
  175. #t)))
  176. (add-after 'patch-source-shebangs 'patch-/bin/sh-references
  177. (lambda _
  178. ;; Ensure the executables created by these source files reference
  179. ;; /bin/sh from the store so they work inside the build container.
  180. (substitute* '("block/cloop.c" "migration/exec.c"
  181. "net/tap.c" "tests/qtest/libqtest.c")
  182. (("/bin/sh") (which "sh")))
  183. #t))
  184. (replace 'configure
  185. (lambda* (#:key inputs outputs (configure-flags '())
  186. #:allow-other-keys)
  187. ;; The `configure' script doesn't understand some of the
  188. ;; GNU options. Thus, add a new phase that's compatible.
  189. (let ((out (assoc-ref outputs "out")))
  190. (setenv "SHELL" (which "bash"))
  191. ;; While we're at it, patch for tests.
  192. (substitute* "tests/qemu-iotests/check"
  193. (("#!/usr/bin/env python3")
  194. (string-append "#!" (which "python3"))))
  195. ;; Ensure config.status gets the correct shebang off the bat.
  196. ;; The build system gets confused if we change it later and
  197. ;; attempts to re-run the whole configury, and fails.
  198. (substitute* "configure"
  199. (("#!/bin/sh")
  200. (string-append "#!" (which "sh"))))
  201. ;; The binaries need to be linked against -lrt.
  202. (setenv "LDFLAGS" "-lrt")
  203. (apply invoke
  204. `("./configure"
  205. ,(string-append "--cc=" (which "gcc"))
  206. ;; Some architectures insist on using HOST_CC
  207. ,(string-append "--host-cc=" (which "gcc"))
  208. "--disable-debug-info" ; save build space
  209. "--enable-virtfs" ; just to be sure
  210. ,(string-append "--prefix=" out)
  211. ,(string-append "--sysconfdir=/etc")
  212. ,@configure-flags)))))
  213. (add-after 'install 'install-info
  214. (lambda* (#:key inputs outputs #:allow-other-keys)
  215. ;; Install the Info manual, unless Texinfo is missing.
  216. (when (assoc-ref inputs "texinfo")
  217. (let* ((out (assoc-ref outputs "out"))
  218. (dir (string-append out "/share/info")))
  219. (invoke "make" "info")
  220. (for-each (lambda (info)
  221. (install-file info dir))
  222. (find-files "." "\\.info"))))
  223. #t))
  224. ;; Create a wrapper for Samba. This allows QEMU to use Samba without
  225. ;; pulling it in as an input. Note that you need to explicitly install
  226. ;; Samba in your Guix profile for Samba support.
  227. (add-after 'install-info 'create-samba-wrapper
  228. (lambda* (#:key inputs outputs #:allow-other-keys)
  229. (let* ((out (assoc-ref %outputs "out"))
  230. (libexec (string-append out "/libexec")))
  231. (call-with-output-file "samba-wrapper"
  232. (lambda (port)
  233. (format port "#!/bin/sh
  234. exec smbd $@")))
  235. (chmod "samba-wrapper" #o755)
  236. (install-file "samba-wrapper" libexec))
  237. #t))
  238. (add-before 'check 'disable-unusable-tests
  239. (lambda* (#:key inputs outputs #:allow-other-keys)
  240. (substitute* "tests/Makefile.include"
  241. ;; Comment out the test-qga test, which needs /sys and
  242. ;; fails within the build environment.
  243. (("check-unit-.* tests/test-qga" all)
  244. (string-append "# " all)))
  245. (substitute* "tests/Makefile.include"
  246. ;; Comment out the test-char test, which needs networking and
  247. ;; fails within the build environment.
  248. (("check-unit-.* tests/test-char" all)
  249. (string-append "# " all)))
  250. #t)))))
  251. (inputs ; TODO: Add optional inputs.
  252. `(("alsa-lib" ,alsa-lib)
  253. ("attr" ,attr)
  254. ("glib" ,glib)
  255. ("gtk+" ,gtk+)
  256. ("libaio" ,libaio)
  257. ("libattr" ,attr)
  258. ("libcacard" ,libcacard) ; smartcard support
  259. ("libcap-ng" ,libcap-ng) ; virtfs support requires libcap-ng & libattr
  260. ("libdrm" ,libdrm)
  261. ("libepoxy" ,libepoxy)
  262. ("libjpeg" ,libjpeg-turbo)
  263. ("libpng" ,libpng)
  264. ("libseccomp" ,libseccomp)
  265. ("libusb" ,libusb) ;USB pass-through support
  266. ("mesa" ,mesa)
  267. ("ncurses" ,ncurses)
  268. ;; ("pciutils" ,pciutils)
  269. ("pixman" ,pixman)
  270. ("pulseaudio" ,pulseaudio)
  271. ("sdl2" ,sdl2)
  272. ("spice" ,spice)
  273. ("usbredir" ,usbredir)
  274. ("util-linux" ,util-linux)
  275. ("vde2" ,vde2)
  276. ("virglrenderer" ,virglrenderer)
  277. ("zlib" ,zlib)))
  278. (native-inputs `(("gettext" ,gettext-minimal)
  279. ("glib:bin" ,glib "bin") ; gtester, etc.
  280. ("perl" ,perl)
  281. ("flex" ,flex)
  282. ("bison" ,bison)
  283. ("pkg-config" ,pkg-config)
  284. ("python-wrapper" ,python-wrapper)
  285. ("python-sphinx" ,python-sphinx)
  286. ("texinfo" ,texinfo)))
  287. (home-page "https://www.qemu.org")
  288. (synopsis "Machine emulator and virtualizer")
  289. (description
  290. "QEMU is a generic machine emulator and virtualizer.
  291. When used as a machine emulator, QEMU can run OSes and programs made for one
  292. machine (e.g. an ARM board) on a different machine---e.g., your own PC. By
  293. using dynamic translation, it achieves very good performance.
  294. When used as a virtualizer, QEMU achieves near native performances by
  295. executing the guest code directly on the host CPU. QEMU supports
  296. virtualization when executing under the Xen hypervisor or using
  297. the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86,
  298. server and embedded PowerPC, and S390 guests.")
  299. ;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'.
  300. (license license:gpl2)
  301. ;; Several tests fail on MIPS; see <http://hydra.gnu.org/build/117914>.
  302. (supported-systems (fold delete %supported-systems
  303. '("mips64el-linux" "i586-gnu")))))
  304. (define-public qemu-minimal
  305. ;; QEMU without GUI support, only supporting the host's architecture
  306. (package (inherit qemu)
  307. (name "qemu-minimal")
  308. (synopsis
  309. "Machine emulator and virtualizer (without GUI) for the host architecture")
  310. (arguments
  311. (substitute-keyword-arguments (package-arguments qemu)
  312. ((#:configure-flags _ '(list))
  313. ;; Restrict to the host's architecture.
  314. (match (car (string-split (or (%current-target-system)
  315. (%current-system))
  316. #\-))
  317. ("i686"
  318. '(list "--target-list=i386-softmmu"))
  319. ("x86_64"
  320. '(list "--target-list=i386-softmmu,x86_64-softmmu"))
  321. ("mips64"
  322. '(list (string-append "--target-list=mips-softmmu,mipsel-softmmu,"
  323. "mips64-softmmu,mips64el-softmmu")))
  324. ("mips"
  325. '(list "--target-list=mips-softmmu,mipsel-softmmu"))
  326. ("aarch64"
  327. '(list "--target-list=arm-softmmu,aarch64-softmmu"))
  328. ("arm"
  329. '(list "--target-list=arm-softmmu"))
  330. ("alpha"
  331. '(list "--target-list=alpha-softmmu"))
  332. ("powerpc64"
  333. '(list "--target-list=ppc-softmmu,ppc64-softmmu"))
  334. ("powerpc"
  335. '(list "--target-list=ppc-softmmu"))
  336. ("s390"
  337. '(list "--target-list=s390x-softmmu"))
  338. ("riscv"
  339. '(list "--target-list=riscv32-softmmu,riscv64-softmmu"))
  340. (else ; An empty list actually builds all the targets.
  341. ''())))))
  342. ;; Remove dependencies on optional libraries, notably GUI libraries.
  343. (native-inputs (fold alist-delete (package-native-inputs qemu)
  344. '("gettext")))
  345. (inputs (fold alist-delete (package-inputs qemu)
  346. '("libusb" "mesa" "sdl2" "spice" "virglrenderer" "gtk+"
  347. "usbredir" "libdrm" "libepoxy" "pulseaudio" "vde2"
  348. "libcacard")))))
  349. (define (system->qemu-target system)
  350. (cond
  351. ((string-prefix? "i686" system)
  352. "qemu-system-i386")
  353. ((string-prefix? "arm" system)
  354. "qemu-system-arm")
  355. (else
  356. (string-append "qemu-system-" (match (string-split system #\-)
  357. ((arch kernel) arch)
  358. (_ system))))))
  359. (define-public ganeti
  360. (package
  361. (name "ganeti")
  362. ;; Note: we use a pre-release for Python 3 compatibility as well as many
  363. ;; other fixes.
  364. (version "3.0.0beta1-24-g024cc9fa2")
  365. (source (origin
  366. (method git-fetch)
  367. (uri (git-reference
  368. (url "https://github.com/ganeti/ganeti")
  369. (commit (string-append "v" version))))
  370. (sha256
  371. (base32 "1ll34qd2mifni3bhg7cnir3xfnkafig8ch33qndqwrsby0y5ssia"))
  372. (file-name (git-file-name name version))
  373. (patches (search-patches "ganeti-shepherd-support.patch"
  374. "ganeti-shepherd-master-failover.patch"
  375. "ganeti-deterministic-manual.patch"
  376. "ganeti-drbd-compat.patch"
  377. "ganeti-os-disk-size.patch"
  378. "ganeti-haskell-pythondir.patch"
  379. "ganeti-disable-version-symlinks.patch"
  380. "ganeti-preserve-PYTHONPATH.patch"))))
  381. (build-system gnu-build-system)
  382. (arguments
  383. `(#:imported-modules (,@%gnu-build-system-modules
  384. (guix build haskell-build-system)
  385. (guix build python-build-system))
  386. #:modules (,@%gnu-build-system-modules
  387. ((guix build haskell-build-system) #:prefix haskell:)
  388. ((guix build python-build-system) #:select (python-version))
  389. (ice-9 rdelim))
  390. ;; The default test target includes a lot of checks that are only really
  391. ;; relevant for developers such as NEWS file checking, line lengths, etc.
  392. ;; We are only interested in the "py-tests" and "hs-tests" targets: this
  393. ;; is the closest we've got even though it includes a little more.
  394. #:test-target "check-TESTS"
  395. #:configure-flags
  396. (list "--localstatedir=/var"
  397. "--sharedstatedir=/var"
  398. "--sysconfdir=/etc"
  399. "--enable-haskell-tests"
  400. ;; By default, the build system installs everything to versioned
  401. ;; directories such as $libdir/3.0 and relies on a $libdir/default
  402. ;; symlink pointed from /etc/ganeti/{lib,share} to actually function.
  403. ;; This is done to accommodate installing multiple versions in
  404. ;; parallel, but is of little use to us as Guix users can just
  405. ;; roll back and forth. Thus, disable it for simplicity.
  406. "--disable-version-links"
  407. ;; Ganeti can optionally take control over SSH host keys and
  408. ;; distribute them to nodes as they are added, and also rotate keys
  409. ;; with 'gnt-cluster renew-crypto --new-ssh-keys'. Thus it needs to
  410. ;; know how to restart the SSH daemon.
  411. "--with-sshd-restart-command='herd restart ssh-daemon'"
  412. ;; Look for OS definitions in this directory by default. It can
  413. ;; be changed in the cluster configuration.
  414. "--with-os-search-path=/run/current-system/profile/share/ganeti/os"
  415. ;; The default QEMU executable to use. We don't use the package
  416. ;; here because this entry is stored in the cluster configuration.
  417. (string-append "--with-kvm-path=/run/current-system/profile/bin/"
  418. ,(system->qemu-target (%current-system))))
  419. #:phases
  420. (modify-phases %standard-phases
  421. (add-after 'unpack 'create-vcs-version
  422. (lambda _
  423. ;; If we are building from a git checkout, we need to create a
  424. ;; 'vcs-version' file manually because the build system does
  425. ;; not have access to the git repository information.
  426. (unless (file-exists? "vcs-version")
  427. (call-with-output-file "vcs-version"
  428. (lambda (port)
  429. (format port "v~a~%" ,version))))
  430. #t))
  431. (add-after 'unpack 'patch-absolute-file-names
  432. (lambda _
  433. (substitute* '("lib/utils/process.py"
  434. "lib/utils/text.py"
  435. "src/Ganeti/Constants.hs"
  436. "src/Ganeti/HTools/CLI.hs"
  437. "test/py/ganeti.config_unittest.py"
  438. "test/py/ganeti.hooks_unittest.py"
  439. "test/py/ganeti.utils.process_unittest.py"
  440. "test/py/ganeti.utils.text_unittest.py"
  441. "test/py/ganeti.utils.wrapper_unittest.py")
  442. (("/bin/sh") (which "sh"))
  443. (("/bin/bash") (which "bash"))
  444. (("/usr/bin/env") (which "env"))
  445. (("/bin/true") (which "true")))
  446. ;; This script is called by the node daemon at startup to perform
  447. ;; sanity checks on the cluster IP addresses, and it is also used
  448. ;; in a master-failover scenario. Add absolute references to
  449. ;; avoid propagating these executables.
  450. (substitute* "tools/master-ip-setup"
  451. (("arping") (which "arping"))
  452. (("ndisc6") (which "ndisc6"))
  453. (("fping") (which "fping"))
  454. (("grep") (which "grep"))
  455. (("ip addr") (string-append (which "ip") " addr")))
  456. #t))
  457. (add-after 'unpack 'override-builtin-PATH
  458. (lambda _
  459. ;; Ganeti runs OS install scripts and similar with a built-in
  460. ;; hard coded PATH. Patch so it works on Guix System.
  461. (substitute* "src/Ganeti/Constants.hs"
  462. (("/sbin:/bin:/usr/sbin:/usr/bin")
  463. "/run/setuid-programs:/run/current-system/profile/sbin:\
  464. /run/current-system/profile/bin"))
  465. #t))
  466. (add-after 'bootstrap 'patch-sphinx-version-detection
  467. (lambda _
  468. ;; The build system runs 'sphinx-build --version' to verify that
  469. ;; the Sphinx is recent enough, but does not expect the
  470. ;; .sphinx-build-real executable name created by the Sphinx wrapper.
  471. (substitute* "configure"
  472. (("\\$SPHINX --version 2>&1")
  473. "$SPHINX --version 2>&1 | sed 's/.sphinx-build-real/sphinx-build/g'"))
  474. #t))
  475. ;; The build system invokes Cabal and GHC, which do not work with
  476. ;; GHC_PACKAGE_PATH: <https://github.com/haskell/cabal/issues/3728>.
  477. ;; Tweak the build system to do roughly what haskell-build-system does.
  478. (add-before 'configure 'configure-haskell
  479. (assoc-ref haskell:%standard-phases 'setup-compiler))
  480. (add-after 'configure 'do-not-use-GHC_PACKAGE_PATH
  481. (lambda _
  482. (unsetenv "GHC_PACKAGE_PATH")
  483. (substitute* "Makefile"
  484. (("\\$\\(CABAL\\)")
  485. "$(CABAL) --package-db=../package.conf.d")
  486. (("\\$\\(GHC\\)")
  487. "$(GHC) -package-db=../package.conf.d"))
  488. #t))
  489. (add-after 'configure 'fix-installation-directories
  490. (lambda _
  491. (substitute* "Makefile"
  492. ;; Do not attempt to create /var during install.
  493. (("\\$\\(DESTDIR\\)\\$\\{localstatedir\\}")
  494. "$(DESTDIR)${prefix}${localstatedir}")
  495. ;; Similarly, do not attempt to install the sample ifup scripts
  496. ;; to /etc/ganeti.
  497. (("\\$\\(DESTDIR\\)\\$\\(ifupdir\\)")
  498. "$(DESTDIR)${prefix}$(ifupdir)"))
  499. #t))
  500. (add-before 'build 'adjust-tests
  501. (lambda _
  502. ;; Disable tests that can not run. Do it early to prevent
  503. ;; touching the Makefile later and triggering a needless rebuild.
  504. (substitute* "Makefile"
  505. ;; These tests expect the presence of a 'root' user (via
  506. ;; ganeti/runtime.py), which fails in the build environment.
  507. (("test/py/ganeti\\.asyncnotifier_unittest\\.py") "")
  508. (("test/py/ganeti\\.backend_unittest\\.py") "")
  509. (("test/py/ganeti\\.daemon_unittest\\.py") "")
  510. (("test/py/ganeti\\.tools\\.ensure_dirs_unittest\\.py") "")
  511. (("test/py/ganeti\\.utils\\.io_unittest-runasroot\\.py") "")
  512. ;; Disable the bash_completion test, as it requires the full
  513. ;; bash instead of bash-minimal.
  514. (("test/py/bash_completion\\.bash")
  515. "")
  516. ;; This test requires networking.
  517. (("test/py/import-export_unittest\\.bash")
  518. ""))
  519. ;; Many of the Makefile targets reset PYTHONPATH before running
  520. ;; the Python interpreter, which does not work very well for us.
  521. (substitute* "Makefile"
  522. (("PYTHONPATH=")
  523. (string-append "PYTHONPATH=" (getenv "PYTHONPATH") ":")))
  524. #t))
  525. (add-after 'build 'build-bash-completions
  526. (lambda _
  527. (let ((orig-pythonpath (getenv "PYTHONPATH")))
  528. (setenv "PYTHONPATH" (string-append ".:" orig-pythonpath))
  529. (invoke "./autotools/build-bash-completion")
  530. (setenv "PYTHONPATH" orig-pythonpath)
  531. #t)))
  532. (add-before 'check 'pre-check
  533. (lambda* (#:key inputs #:allow-other-keys)
  534. ;; Set TZDIR so that time zones are found.
  535. (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
  536. "/share/zoneinfo"))
  537. ;; This test checks whether PYTHONPATH is untouched, and extends
  538. ;; it to include test directories if so. Add an else branch for
  539. ;; our modified PYTHONPATH, in order to prevent a confusing test
  540. ;; failure where expired certificates are not cleaned because
  541. ;; check-cert-expired is silently crashing.
  542. (substitute* "test/py/ganeti-cleaner_unittest.bash"
  543. (("then export PYTHONPATH=(.*)" all testpath)
  544. (string-append all "else export PYTHONPATH="
  545. (getenv "PYTHONPATH") ":" testpath "\n")))
  546. (substitute* "test/py/ganeti.utils.process_unittest.py"
  547. ;; This test attempts to run an executable with
  548. ;; RunCmd(..., reset_env=True), which fails because the default
  549. ;; PATH from Constants.hs does not exist in the build container.
  550. ((".*def testResetEnv.*" all)
  551. (string-append " @unittest.skipIf(True, "
  552. "\"cannot reset env in the build container\")\n"
  553. all))
  554. ;; XXX: Somehow this test fails in the build container, but
  555. ;; works in 'guix environment -C', even without /bin/sh?
  556. ((".*def testPidFile.*" all)
  557. (string-append " @unittest.skipIf(True, "
  558. "\"testPidFile fails in the build container\")\n"
  559. all)))
  560. ;; XXX: Why are these links not added automatically.
  561. (with-directory-excursion "test/hs"
  562. (for-each (lambda (file)
  563. (symlink "../../src/htools" file))
  564. '("hspace" "hscan" "hinfo" "hbal" "hroller"
  565. "hcheck" "hail" "hsqueeze")))
  566. #t))
  567. (add-after 'install 'install-bash-completions
  568. (lambda* (#:key outputs #:allow-other-keys)
  569. (let* ((out (assoc-ref outputs "out"))
  570. (compdir (string-append out "/etc/bash_completion.d")))
  571. (mkdir-p compdir)
  572. (copy-file "doc/examples/bash_completion"
  573. (string-append compdir "/ganeti"))
  574. ;; The one file contains completions for many different
  575. ;; executables. Create symlinks for found completions.
  576. (with-directory-excursion compdir
  577. (for-each
  578. (lambda (prog) (symlink "ganeti" prog))
  579. (call-with-input-file "ganeti"
  580. (lambda (port)
  581. (let loop ((line (read-line port))
  582. (progs '()))
  583. (if (eof-object? line)
  584. progs
  585. (if (string-prefix? "complete" line)
  586. (loop (read-line port)
  587. ;; Extract "prog" from lines of the form:
  588. ;; "complete -F _prog -o filenames prog".
  589. ;; Note that 'burnin' is listed with the
  590. ;; absolute file name, which is why we
  591. ;; run everything through 'basename'.
  592. (cons (basename (car (reverse (string-split
  593. line #\ ))))
  594. progs))
  595. (loop (read-line port) progs))))))))
  596. #t)))
  597. ;; Wrap all executables with PYTHONPATH. We can't borrow the phase
  598. ;; from python-build-system because we also need to wrap the scripts
  599. ;; in $out/lib/ganeti such as "node-daemon-setup".
  600. (add-after 'install 'wrap
  601. (lambda* (#:key inputs outputs #:allow-other-keys)
  602. (let* ((out (assoc-ref outputs "out"))
  603. (sbin (string-append out "/sbin"))
  604. (lib (string-append out "/lib"))
  605. (python (assoc-ref inputs "python"))
  606. (major+minor (python-version python))
  607. (PYTHONPATH (string-append lib "/python" major+minor
  608. "/site-packages:"
  609. (getenv "PYTHONPATH"))))
  610. (define (shell-script? file)
  611. (call-with-ascii-input-file file
  612. (lambda (port)
  613. (let ((shebang (false-if-exception (read-line port))))
  614. (and shebang
  615. (string-prefix? "#!" shebang)
  616. (or (string-contains shebang "/bin/bash")
  617. (string-contains shebang "/bin/sh")))))))
  618. (define (wrap? file)
  619. ;; Do not wrap shell scripts because some are meant to be
  620. ;; sourced, which breaks if they are wrapped. We do wrap
  621. ;; the Haskell executables because some call out to Python
  622. ;; directly.
  623. (and (executable-file? file)
  624. (not (symbolic-link? file))
  625. (not (shell-script? file))))
  626. (for-each (lambda (file)
  627. (wrap-program file
  628. `("PYTHONPATH" ":" prefix (,PYTHONPATH))))
  629. (filter wrap?
  630. (append (find-files (string-append lib "/ganeti"))
  631. (find-files sbin))))
  632. #t))))))
  633. (native-inputs
  634. `(("haskell" ,ghc)
  635. ("cabal" ,cabal-install)
  636. ("m4" ,m4)
  637. ;; These inputs are necessary to bootstrap the package, because we
  638. ;; have patched the build system.
  639. ("autoconf" ,autoconf)
  640. ("automake" ,automake)
  641. ;; For the documentation.
  642. ("python-docutils" ,python-docutils)
  643. ("sphinx" ,python-sphinx)
  644. ("pandoc" ,ghc-pandoc)
  645. ("dot" ,graphviz)
  646. ;; Test dependencies.
  647. ("fakeroot" ,fakeroot)
  648. ("ghc-temporary" ,ghc-temporary)
  649. ("ghc-test-framework" ,ghc-test-framework)
  650. ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
  651. ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
  652. ("python-mock" ,python-mock)
  653. ("python-pyyaml" ,python-pyyaml)
  654. ("openssh" ,openssh)
  655. ("procps" ,procps)
  656. ("shelltestrunner" ,shelltestrunner)
  657. ("tzdata" ,tzdata-for-tests)))
  658. (inputs
  659. `(("arping" ,iputils) ;must be the iputils version
  660. ("curl" ,curl)
  661. ("fping" ,fping)
  662. ("iproute2" ,iproute)
  663. ("ndisc6" ,ndisc6)
  664. ("socat" ,socat)
  665. ("qemu" ,qemu-minimal) ;for qemu-img
  666. ("ghc-attoparsec" ,ghc-attoparsec)
  667. ("ghc-base64-bytestring" ,ghc-base64-bytestring)
  668. ("ghc-cryptonite" ,ghc-cryptonite)
  669. ("ghc-curl" ,ghc-curl)
  670. ("ghc-hinotify" ,ghc-hinotify)
  671. ("ghc-hslogger" ,ghc-hslogger)
  672. ("ghc-json" ,ghc-json)
  673. ("ghc-lens" ,ghc-lens)
  674. ("ghc-lifted-base" ,ghc-lifted-base)
  675. ("ghc-network" ,ghc-network)
  676. ("ghc-old-time" ,ghc-old-time)
  677. ("ghc-psqueue" ,ghc-psqueue)
  678. ("ghc-regex-pcre" ,ghc-regex-pcre)
  679. ("ghc-utf8-string" ,ghc-utf8-string)
  680. ("ghc-zlib" ,ghc-zlib)
  681. ;; For the optional metadata daemon.
  682. ("ghc-snap-core" ,ghc-snap-core)
  683. ("ghc-snap-server" ,ghc-snap-server)
  684. ("python" ,python)
  685. ("python-pyopenssl" ,python-pyopenssl)
  686. ("python-simplejson" ,python-simplejson)
  687. ("python-pyparsing" ,python-pyparsing)
  688. ("python-pyinotify" ,python-pyinotify)
  689. ("python-pycurl" ,python-pycurl)
  690. ("python-bitarray" ,python-bitarray)
  691. ("python-paramiko" ,python-paramiko)
  692. ("python-psutil" ,python-psutil)))
  693. (home-page "http://www.ganeti.org/")
  694. (synopsis "Cluster-based virtual machine management system")
  695. (description
  696. "Ganeti is a virtual machine management tool built on top of existing
  697. virtualization technologies such as Xen or KVM. Ganeti controls:
  698. @itemize @bullet
  699. @item Disk creation management;
  700. @item Operating system installation for instances (in co-operation with
  701. OS-specific install scripts); and
  702. @item Startup, shutdown, and failover between physical systems.
  703. @end itemize
  704. Ganeti is designed to facilitate cluster management of virtual servers and
  705. to provide fast and simple recovery after physical failures, using
  706. commodity hardware.")
  707. (license license:bsd-2)))
  708. (define-public ganeti-instance-guix
  709. (package
  710. (name "ganeti-instance-guix")
  711. (version "0.6")
  712. (home-page "https://github.com/mbakke/ganeti-instance-guix")
  713. (source (origin
  714. (method git-fetch)
  715. (uri (git-reference (url home-page) (commit version)))
  716. (file-name (git-file-name name version))
  717. (sha256
  718. (base32
  719. "0aa08irpcpns6mhjgsplc5f0p8ab1qcr9ah1gj5z66kxgqyflzrp"))))
  720. (build-system gnu-build-system)
  721. (arguments
  722. '(#:configure-flags '("--sysconfdir=/etc" "--localstatedir=/var")))
  723. (native-inputs
  724. `(("autoconf" ,autoconf)
  725. ("automake" ,automake)))
  726. (inputs
  727. `(("util-linux" ,util-linux)
  728. ("qemu-img" ,qemu-minimal)))
  729. (synopsis "Guix OS integration for Ganeti")
  730. (description
  731. "This package provides a guest OS definition for Ganeti that uses
  732. Guix to build virtual machines.")
  733. (license license:gpl3+)))
  734. (define-public ganeti-instance-debootstrap
  735. (package
  736. (name "ganeti-instance-debootstrap")
  737. ;; We need two commits on top of the latest release for compatibility
  738. ;; with newer sfdisk, as well as gnt-network integration.
  739. (version "0.16-2-ge145396")
  740. (home-page "https://github.com/ganeti/instance-debootstrap")
  741. (source (origin
  742. (method git-fetch)
  743. (uri (git-reference (url home-page) (commit version)))
  744. (file-name (git-file-name name version))
  745. (sha256
  746. (base32
  747. "0f2isw9d8lawzj21rrq1q9xhq8xfa65rqbhqmrn59z201x9q1336"))))
  748. (build-system gnu-build-system)
  749. (arguments
  750. '(#:configure-flags '("--sysconfdir=/etc" "--localstatedir=/var")
  751. #:phases (modify-phases %standard-phases
  752. (add-after 'unpack 'add-absolute-references
  753. (lambda _
  754. (substitute* "common.sh.in"
  755. (("/sbin/blkid") (which "blkid"))
  756. (("kpartx -")
  757. (string-append (which "kpartx") " -")))
  758. (substitute* "import"
  759. (("restore -r")
  760. (string-append (which "restore") " -r")))
  761. (substitute* "export"
  762. (("dump -0")
  763. (string-append (which "dump") " -0")))
  764. (substitute* "create"
  765. (("debootstrap") (which "debootstrap"))
  766. (("`which run-parts`") (which "run-parts"))
  767. ;; Here we actually need to hard code /bin/passwd
  768. ;; because it's called via chroot, which fails if
  769. ;; "/bin" is not in PATH.
  770. (("passwd") "/bin/passwd"))
  771. #t))
  772. (add-after 'unpack 'set-dpkg-arch
  773. (lambda* (#:key system #:allow-other-keys)
  774. ;; The create script passes --arch to debootstrap,
  775. ;; and defaults to `dpkg --print-architecture` when
  776. ;; ARCH is not set in variant.conf. Hard code the
  777. ;; build-time architecture to avoid the dpkg dependency.
  778. (let ((dpkg-arch
  779. (cond ((string-prefix? "x86_64" system)
  780. "amd64")
  781. ((string-prefix? "i686" system)
  782. "i386")
  783. ((string-prefix? "aarch64" system)
  784. "arm64")
  785. (else (car (string-split system #\-))))))
  786. (substitute* "create"
  787. (("`dpkg --print-architecture`")
  788. dpkg-arch))
  789. #t)))
  790. (add-after 'configure 'adjust-Makefile
  791. (lambda _
  792. ;; Do not attempt to create /etc/ganeti/instance-debootstrap
  793. ;; and /etc/default/ganeti-instance-debootstrap during install.
  794. ;; They are created by the Ganeti service.
  795. (substitute* "Makefile"
  796. (("\\$\\(variantsdir\\)")
  797. "$(prefix)/etc/ganeti/instance-debootstrap/variants")
  798. (("\\$\\(defaultsdir\\)")
  799. "$(prefix)/etc/default/ganeti-instance-debootstrap"))
  800. #t))
  801. (add-after 'install 'make-variants.list-symlink
  802. (lambda* (#:key outputs #:allow-other-keys)
  803. ;; The Ganeti OS API mandates a variants.list file that
  804. ;; describes all supported "variants" of this OS.
  805. ;; Guix generates this file, so make the original file
  806. ;; a symlink to it.
  807. (with-directory-excursion (string-append
  808. (assoc-ref outputs "out")
  809. "/share/ganeti/os/debootstrap")
  810. (delete-file "variants.list")
  811. (symlink "/etc/ganeti/instance-debootstrap/variants/variants.list"
  812. "variants.list"))
  813. #t)))))
  814. (native-inputs
  815. `(("autoconf" ,autoconf)
  816. ("automake" ,automake)))
  817. (inputs
  818. `(("debianutils" ,debianutils)
  819. ("debootstrap" ,debootstrap)
  820. ("dump" ,dump)
  821. ("kpartx" ,multipath-tools)
  822. ("util-linux" ,util-linux)))
  823. (synopsis "Debian OS integration for Ganeti")
  824. (description
  825. "This package provides a guest OS definition for Ganeti. It installs
  826. Debian or a derivative using @command{debootstrap}.")
  827. (license license:gpl2+)))
  828. (define-public libosinfo
  829. (package
  830. (name "libosinfo")
  831. (version "1.7.1")
  832. (source
  833. (origin
  834. (method url-fetch)
  835. (uri (string-append "https://releases.pagure.org/libosinfo/libosinfo-"
  836. version ".tar.xz"))
  837. (sha256
  838. (base32
  839. "1s97sv24bybggjx6hgqba2qdqz3ivfpd4cmkh4zm5y59sim109mv"))))
  840. (build-system meson-build-system)
  841. (arguments
  842. `(#:configure-flags
  843. (list (string-append "-Dwith-usb-ids-path="
  844. (assoc-ref %build-inputs "usb.ids"))
  845. (string-append "-Dwith-pci-ids-path="
  846. (assoc-ref %build-inputs "pci.ids")))
  847. #:phases
  848. (modify-phases %standard-phases
  849. (add-after 'unpack 'patch-osinfo-path
  850. (lambda* (#:key inputs #:allow-other-keys)
  851. (substitute* "osinfo/osinfo_loader.c"
  852. (("path = DATA_DIR.*")
  853. (string-append "path = \"" (assoc-ref inputs "osinfo-db")
  854. "/share/osinfo\";")))
  855. #t)))))
  856. (inputs
  857. `(("libsoup" ,libsoup)
  858. ("libxml2" ,libxml2)
  859. ("libxslt" ,libxslt)
  860. ("osinfo-db" ,osinfo-db)))
  861. (native-inputs
  862. `(("glib" ,glib "bin") ; glib-mkenums, etc.
  863. ("gobject-introspection" ,gobject-introspection)
  864. ("gtk-doc" ,gtk-doc)
  865. ("vala" ,vala)
  866. ("intltool" ,intltool)
  867. ("pkg-config" ,pkg-config)
  868. ("pci.ids"
  869. ,(origin
  870. (method url-fetch)
  871. (uri "https://github.com/pciutils/pciids/raw/ad02084f0bc143e3c15e31a6152a3dfb1d7a3156/pci.ids")
  872. (sha256
  873. (base32
  874. "0kfhpj5rnh24hz2714qhfmxk281vwc2w50sm73ggw5d15af7zfsw"))))
  875. ("usb.ids"
  876. ,(origin
  877. (method url-fetch)
  878. (uri "https://svn.code.sf.net/p/linux-usb/repo/trunk/htdocs/usb.ids?r=2681")
  879. (file-name "usb.ids")
  880. (sha256
  881. (base32
  882. "1m6yhvz5k8aqzxgk7xj3jkk8frl1hbv0h3vgj4wbnvnx79qnvz3r"))))))
  883. (home-page "https://libosinfo.org/")
  884. (synopsis "Operating system information database")
  885. (description "libosinfo is a GObject based library API for managing
  886. information about operating systems, hypervisors and the (virtual) hardware
  887. devices they can support. It includes a database containing device metadata
  888. and provides APIs to match/identify optimal devices for deploying an operating
  889. system on a hypervisor. Via GObject Introspection, the API is available in
  890. all common programming languages. Vala bindings are also provided.")
  891. ;; The library files are released under LGPLv2.1 or later; the source
  892. ;; files in the "tools" directory are released under GPLv2+.
  893. (license (list license:lgpl2.1+ license:gpl2+))))
  894. (define-public lxc
  895. (package
  896. (name "lxc")
  897. (version "3.1.0")
  898. (source (origin
  899. (method url-fetch)
  900. (uri (string-append
  901. "https://linuxcontainers.org/downloads/lxc/lxc-"
  902. version ".tar.gz"))
  903. (sha256
  904. (base32
  905. "1igxqgx8q9cp15mcp1y8j564bl85ijw04jcmgb1s5bmfbg1751sd"))))
  906. (build-system gnu-build-system)
  907. (native-inputs
  908. `(("pkg-config" ,pkg-config)))
  909. (inputs
  910. `(("gnutls" ,gnutls)
  911. ("libcap" ,libcap)
  912. ("libseccomp" ,libseccomp)
  913. ("libselinux" ,libselinux)))
  914. (arguments
  915. `(#:configure-flags
  916. (list (string-append "--docdir=" (assoc-ref %outputs "out")
  917. "/share/doc/" ,name "-" ,version)
  918. "--sysconfdir=/etc"
  919. "--localstatedir=/var")
  920. #:phases
  921. (modify-phases %standard-phases
  922. (replace 'install
  923. (lambda* (#:key outputs #:allow-other-keys)
  924. (let* ((out (assoc-ref outputs "out"))
  925. (bashcompdir (string-append out "/etc/bash_completion.d")))
  926. (invoke "make" "install"
  927. (string-append "bashcompdir=" bashcompdir)
  928. ;; Don't install files into /var and /etc.
  929. "LXCPATH=/tmp/var/lib/lxc"
  930. "localstatedir=/tmp/var"
  931. "sysconfdir=/tmp/etc"
  932. "sysconfigdir=/tmp/etc/default")))))))
  933. (synopsis "Linux container tools")
  934. (home-page "https://linuxcontainers.org/")
  935. (description
  936. "LXC is a userspace interface for the Linux kernel containment features.
  937. Through a powerful API and simple tools, it lets Linux users easily create and
  938. manage system or application containers.")
  939. (license license:lgpl2.1+)))
  940. (define-public libvirt
  941. (package
  942. (name "libvirt")
  943. (version "5.8.0")
  944. (source
  945. (origin
  946. (method url-fetch)
  947. (uri (string-append "https://libvirt.org/sources/libvirt-"
  948. version ".tar.xz"))
  949. (sha256
  950. (base32 "0m8cqaqflvys5kaqpvb0qr4k365j09jc5xk6x70yvg8qkcl2hcz2"))
  951. (patches
  952. (search-patches "libvirt-create-machine-cgroup.patch"))))
  953. (build-system gnu-build-system)
  954. (arguments
  955. `(#:configure-flags
  956. (list "--with-qemu"
  957. "--with-qemu-user=nobody"
  958. "--with-qemu-group=kvm"
  959. "--with-polkit"
  960. (string-append "--docdir=" (assoc-ref %outputs "out") "/share/doc/"
  961. ,name "-" ,version)
  962. "--sysconfdir=/etc"
  963. "--localstatedir=/var")
  964. #:phases
  965. (modify-phases %standard-phases
  966. (add-before 'configure 'fix-BOURNE_SHELL-definition
  967. ;; BOURNE_SHELL is hard-#defined to ‘/bin/sh’, causing test failures.
  968. (lambda _
  969. (substitute* "config.h.in"
  970. (("/bin/sh") (which "sh")))
  971. #t))
  972. (add-before 'configure 'patch-libtirpc-file-names
  973. (lambda* (#:key inputs #:allow-other-keys)
  974. ;; libvirt uses an m4 macro instead of pkg-config to determine where
  975. ;; the RPC headers are located. Tell it to look in the right place.
  976. (substitute* "configure"
  977. (("/usr/include/tirpc") ;defined in m4/virt-xdr.m4
  978. (string-append (assoc-ref inputs "libtirpc")
  979. "/include/tirpc")))
  980. #t))
  981. (add-before 'configure 'disable-broken-tests
  982. (lambda _
  983. (let ((tests (list "commandtest" ; hangs idly
  984. "qemuxml2argvtest" ; fails
  985. "qemuhotplugtest" ; fails
  986. "virnetsockettest" ; tries to network
  987. "virshtest"))) ; fails
  988. (substitute* "tests/Makefile.in"
  989. (((format #f "(~a)\\$\\(EXEEXT\\)" (string-join tests "|")))
  990. ""))
  991. #t)))
  992. (replace 'install
  993. ;; Since the sysconfdir and localstatedir should be /etc and /var
  994. ;; at runtime, we must prevent writing to them at installation
  995. ;; time.
  996. (lambda* (#:key make-flags #:allow-other-keys)
  997. (apply invoke "make" "install"
  998. "sysconfdir=/tmp/etc"
  999. "localstatedir=/tmp/var"
  1000. make-flags))))))
  1001. (inputs
  1002. `(("libxml2" ,libxml2)
  1003. ("eudev" ,eudev)
  1004. ("libpciaccess" ,libpciaccess)
  1005. ("gnutls" ,gnutls)
  1006. ("dbus" ,dbus)
  1007. ("libpcap" ,libpcap)
  1008. ("libnl" ,libnl)
  1009. ("libtirpc" ,libtirpc) ;for <rpc/rpc.h>
  1010. ("libuuid" ,util-linux "lib")
  1011. ("lvm2" ,lvm2) ;for libdevmapper
  1012. ("curl" ,curl)
  1013. ("openssl" ,openssl)
  1014. ("cyrus-sasl" ,cyrus-sasl)
  1015. ("libyajl" ,libyajl)
  1016. ("audit" ,audit)
  1017. ("dmidecode" ,dmidecode)
  1018. ("dnsmasq" ,dnsmasq)
  1019. ("ebtables" ,ebtables)
  1020. ("iproute" ,iproute)
  1021. ("iptables" ,iptables)))
  1022. (native-inputs
  1023. `(("xsltproc" ,libxslt)
  1024. ("perl" ,perl)
  1025. ("pkg-config" ,pkg-config)
  1026. ("polkit" ,polkit)
  1027. ("python" ,python-wrapper)))
  1028. (home-page "https://libvirt.org")
  1029. (synopsis "Simple API for virtualization")
  1030. (description "Libvirt is a C toolkit to interact with the virtualization
  1031. capabilities of recent versions of Linux. The library aims at providing long
  1032. term stable C API initially for the Xen paravirtualization but should be able
  1033. to integrate other virtualization mechanisms if needed.")
  1034. (license license:lgpl2.1+)))
  1035. (define-public libvirt-glib
  1036. (package
  1037. (name "libvirt-glib")
  1038. (version "3.0.0")
  1039. (source (origin
  1040. (method url-fetch)
  1041. (uri (string-append "ftp://libvirt.org/libvirt/glib/"
  1042. "libvirt-glib-" version ".tar.gz"))
  1043. (sha256
  1044. (base32
  1045. "1zpbv4ninc57c9rw4zmmkvvqn7154iv1qfr20kyxn8xplalqrzvz"))))
  1046. (build-system gnu-build-system)
  1047. (inputs
  1048. `(("openssl" ,openssl)
  1049. ("cyrus-sasl" ,cyrus-sasl)
  1050. ("lvm2" ,lvm2) ; for libdevmapper
  1051. ("libyajl" ,libyajl)))
  1052. (native-inputs
  1053. `(("pkg-config" ,pkg-config)
  1054. ("intltool" ,intltool)
  1055. ("glib" ,glib "bin")
  1056. ("vala" ,vala)))
  1057. (propagated-inputs
  1058. ;; ‘Required:’ by the installed .pc files.
  1059. `(("glib" ,glib)
  1060. ("libvirt" ,libvirt)
  1061. ("libxml2" ,libxml2)
  1062. ("gobject-introspection" ,gobject-introspection)))
  1063. (home-page "https://libvirt.org")
  1064. (synopsis "GLib wrapper around libvirt")
  1065. (description "libvirt-glib wraps the libvirt library to provide a
  1066. high-level object-oriented API better suited for glib-based applications, via
  1067. three libraries:
  1068. @enumerate
  1069. @item libvirt-glib - GLib main loop integration & misc helper APIs
  1070. @item libvirt-gconfig - GObjects for manipulating libvirt XML documents
  1071. @item libvirt-gobject - GObjects for managing libvirt objects
  1072. @end enumerate
  1073. ")
  1074. (license license:lgpl2.1+)))
  1075. (define-public python-libvirt
  1076. (package
  1077. (name "python-libvirt")
  1078. (version "5.8.0")
  1079. (source
  1080. (origin
  1081. (method url-fetch)
  1082. (uri (string-append "https://libvirt.org/sources/python/libvirt-python-"
  1083. version ".tar.gz"))
  1084. (sha256
  1085. (base32 "0kyz3lx49d8p75mvbzinxc1zgs8g7adn77y9bm15b8b4ad9zl5s6"))))
  1086. (build-system python-build-system)
  1087. (arguments
  1088. `(#:phases
  1089. (modify-phases %standard-phases
  1090. (add-after 'unpack 'patch-nosetests-path
  1091. (lambda* (#:key inputs #:allow-other-keys)
  1092. (substitute* "setup.py"
  1093. (("\"/usr/bin/nosetests\"")
  1094. (string-append "\"" (which "nosetests") "\""))
  1095. (("self\\.spawn\\(\\[sys\\.executable, nose\\]\\)")
  1096. (format #f "self.spawn([\"~a\", nose])" (which "bash"))))
  1097. #t)))))
  1098. (inputs
  1099. `(("libvirt" ,libvirt)))
  1100. (propagated-inputs
  1101. `(("python-lxml" ,python-lxml)))
  1102. (native-inputs
  1103. `(("pkg-config" ,pkg-config)
  1104. ("python-nose" ,python-nose)))
  1105. (home-page "https://libvirt.org")
  1106. (synopsis "Python bindings to libvirt")
  1107. (description "This package provides Python bindings to the libvirt
  1108. virtualization library.")
  1109. (license license:lgpl2.1+)))
  1110. (define-public python2-libvirt
  1111. (package-with-python2 python-libvirt))
  1112. (define-public virt-manager
  1113. (package
  1114. (name "virt-manager")
  1115. (version "2.2.1")
  1116. (source (origin
  1117. (method url-fetch)
  1118. (uri (string-append "https://virt-manager.org/download/sources"
  1119. "/virt-manager/virt-manager-"
  1120. version ".tar.gz"))
  1121. (sha256
  1122. (base32
  1123. "06ws0agxlip6p6n3n43knsnjyd91gqhh2dadgc33wl9lx1k8vn6g"))))
  1124. (build-system python-build-system)
  1125. (arguments
  1126. `(#:use-setuptools? #f ; uses custom distutils 'install' command
  1127. #:test-target "test_ui"
  1128. #:tests? #f ; TODO The tests currently fail
  1129. ; RuntimeError: Loop condition wasn't
  1130. ; met
  1131. #:imported-modules ((guix build glib-or-gtk-build-system)
  1132. ,@%python-build-system-modules)
  1133. #:modules ((ice-9 match)
  1134. (srfi srfi-26)
  1135. (guix build python-build-system)
  1136. ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
  1137. (guix build utils))
  1138. #:phases
  1139. (modify-phases %standard-phases
  1140. (add-after 'unpack 'fix-setup
  1141. (lambda* (#:key outputs #:allow-other-keys)
  1142. (substitute* "virtinst/buildconfig.py"
  1143. (("/usr") (assoc-ref outputs "out")))
  1144. #t))
  1145. (add-after 'unpack 'fix-qemu-img-reference
  1146. (lambda* (#:key inputs #:allow-other-keys)
  1147. (substitute* "virtconv/formats.py"
  1148. (("/usr(/bin/qemu-img)" _ suffix)
  1149. (string-append (assoc-ref inputs "qemu") suffix)))
  1150. #t))
  1151. (add-after 'unpack 'fix-default-uri
  1152. (lambda* (#:key inputs #:allow-other-keys)
  1153. ;; Xen is not available for now - so only patch qemu.
  1154. (substitute* "virtManager/createconn.py"
  1155. (("/usr(/bin/qemu-system)" _ suffix)
  1156. (string-append (assoc-ref inputs "qemu") suffix)))
  1157. #t))
  1158. (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH
  1159. (lambda* (#:key inputs outputs #:allow-other-keys)
  1160. (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
  1161. (bin-files (find-files bin ".*"))
  1162. (paths (map (match-lambda
  1163. ((output . directory)
  1164. (let* ((girepodir (string-append
  1165. directory
  1166. "/lib/girepository-1.0")))
  1167. (if (file-exists? girepodir)
  1168. girepodir #f))))
  1169. inputs)))
  1170. (for-each (lambda (file)
  1171. (format #t "wrapping ~a\n" file)
  1172. (wrap-program file
  1173. `("GI_TYPELIB_PATH" ":" prefix
  1174. ,(filter identity paths))))
  1175. bin-files))
  1176. #t))
  1177. (replace 'check
  1178. (lambda* (#:key tests? #:allow-other-keys)
  1179. (when tests?
  1180. (setenv "HOME" "/tmp")
  1181. (system "Xvfb :1 &")
  1182. (setenv "DISPLAY" ":1")
  1183. ;; Dogtail requires that Assistive Technology support be enabled
  1184. (setenv "GTK_MODULES" "gail:atk-bridge")
  1185. (invoke "dbus-run-session" "--" "python" "setup.py" "test_ui"))
  1186. #t))
  1187. (add-after 'install 'glib-or-gtk-compile-schemas
  1188. (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
  1189. (add-after 'install 'glib-or-gtk-wrap
  1190. (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
  1191. (inputs
  1192. `(("dconf" ,dconf)
  1193. ("gtk+" ,gtk+)
  1194. ("gtk-vnc" ,gtk-vnc)
  1195. ("gtksourceview" ,gtksourceview)
  1196. ("libvirt" ,libvirt)
  1197. ("libvirt-glib" ,libvirt-glib)
  1198. ("libosinfo" ,libosinfo)
  1199. ("vte" ,vte)
  1200. ("python-libvirt" ,python-libvirt)
  1201. ("python-requests" ,python-requests)
  1202. ("python-pycairo" ,python-pycairo)
  1203. ("python-pygobject" ,python-pygobject)
  1204. ("python-libxml2" ,python-libxml2)
  1205. ("spice-gtk" ,spice-gtk)))
  1206. ;; virt-manager searches for qemu-img or kvm-img in the PATH.
  1207. (propagated-inputs
  1208. `(("qemu" ,qemu)))
  1209. (native-inputs
  1210. `(("glib" ,glib "bin") ; glib-compile-schemas
  1211. ("gobject-introspection" ,gobject-introspection)
  1212. ("gtk+" ,gtk+ "bin") ; gtk-update-icon-cache
  1213. ("perl" ,perl) ; pod2man
  1214. ("intltool" ,intltool)
  1215. ;; The following are required for running the tests
  1216. ;; ("python-dogtail" ,python-dogtail)
  1217. ;; ("xvfb" ,xorg-server-for-tests)
  1218. ;; ("dbus" ,dbus)
  1219. ;; ("at-spi2-core" ,at-spi2-core)
  1220. ;; ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
  1221. ))
  1222. (home-page "https://virt-manager.org/")
  1223. (synopsis "Manage virtual machines")
  1224. (description
  1225. "The virt-manager application is a desktop user interface for managing
  1226. virtual machines through libvirt. It primarily targets KVM VMs, but also
  1227. manages Xen and LXC (Linux containers). It presents a summary view of running
  1228. domains, their live performance and resource utilization statistics.")
  1229. (license license:gpl2+)))
  1230. (define-public criu
  1231. (package
  1232. (name "criu")
  1233. (version "3.14")
  1234. (source (origin
  1235. (method url-fetch)
  1236. (uri (string-append "https://download.openvz.org/criu/criu-"
  1237. version ".tar.bz2"))
  1238. (sha256
  1239. (base32
  1240. "1jrr3v99g18gc0hriz0avq6ccdvyya0j6wwz888sdsc4icc30gzn"))))
  1241. (build-system gnu-build-system)
  1242. (arguments
  1243. `(#:test-target "test"
  1244. #:tests? #f ; tests require mounting as root
  1245. #:make-flags
  1246. (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
  1247. (string-append "LIBDIR=" (assoc-ref %outputs "out")
  1248. "/lib")
  1249. (string-append "ASCIIDOC=" (assoc-ref %build-inputs "asciidoc")
  1250. "/bin/asciidoc")
  1251. (string-append "XMLTO=" (assoc-ref %build-inputs "xmlto")
  1252. "/bin/xmlto"))
  1253. #:phases
  1254. (modify-phases %standard-phases
  1255. (replace 'configure
  1256. (lambda* (#:key inputs #:allow-other-keys)
  1257. ;; The includes for libnl are located in a sub-directory.
  1258. (setenv "C_INCLUDE_PATH"
  1259. (string-append (assoc-ref inputs "libnl")
  1260. "/include/libnl3:"
  1261. (or (getenv "C_INCLUDE_PATH") "")))
  1262. #t))
  1263. (add-after 'configure 'fix-documentation
  1264. (lambda* (#:key inputs outputs #:allow-other-keys)
  1265. (substitute* "Documentation/Makefile"
  1266. (("-m custom.xsl")
  1267. (string-append
  1268. "-m custom.xsl --skip-validation -x "
  1269. (assoc-ref inputs "docbook-xsl") "/xml/xsl/"
  1270. ,(package-name docbook-xsl) "-"
  1271. ,(package-version docbook-xsl)
  1272. "/manpages/docbook.xsl")))
  1273. #t))
  1274. (add-after 'unpack 'hardcode-variables
  1275. (lambda* (#:key inputs #:allow-other-keys)
  1276. ;; Hardcode arm version detection
  1277. (substitute* "Makefile"
  1278. (("ARMV.*:=.*") "ARMV := 7\n"))
  1279. ;; We are currently using python-2
  1280. (substitute* "crit/Makefile"
  1281. (("\\$\\(PYTHON\\)") "python2"))
  1282. (substitute* "lib/Makefile"
  1283. (("\\$\\(PYTHON\\)")
  1284. (string-append (assoc-ref inputs "python")
  1285. "/bin/python")))
  1286. #t))
  1287. (add-before 'build 'fix-symlink
  1288. (lambda* (#:key inputs #:allow-other-keys)
  1289. ;; The file 'images/google/protobuf/descriptor.proto' points to
  1290. ;; /usr/include/..., which obviously does not exist.
  1291. (let* ((file "google/protobuf/descriptor.proto")
  1292. (target (string-append "images/" file))
  1293. (source (string-append (assoc-ref inputs "protobuf")
  1294. "/include/" file)))
  1295. (delete-file target)
  1296. (symlink source target)
  1297. #t)))
  1298. (add-after 'install 'wrap
  1299. (lambda* (#:key inputs outputs #:allow-other-keys)
  1300. ;; Make sure 'crit' runs with the correct PYTHONPATH.
  1301. (let* ((out (assoc-ref outputs "out"))
  1302. (path (string-append out
  1303. "/lib/python"
  1304. (string-take (string-take-right
  1305. (assoc-ref inputs "python") 5) 3)
  1306. "/site-packages:"
  1307. (getenv "PYTHONPATH"))))
  1308. (wrap-program (string-append out "/bin/crit")
  1309. `("PYTHONPATH" ":" prefix (,path))))
  1310. #t)))))
  1311. (inputs
  1312. `(("protobuf" ,protobuf)
  1313. ("python" ,python-2)
  1314. ("python2-protobuf" ,python2-protobuf)
  1315. ("python2-ipaddr" ,python2-ipaddr)
  1316. ("iproute" ,iproute)
  1317. ("libaio" ,libaio)
  1318. ("libcap" ,libcap)
  1319. ("libnet" ,libnet)
  1320. ("libnl" ,libnl)
  1321. ("libbsd" ,libbsd)))
  1322. (native-inputs
  1323. `(("pkg-config" ,pkg-config)
  1324. ("perl" ,perl)
  1325. ("protobuf-c" ,protobuf-c)
  1326. ("asciidoc" ,asciidoc)
  1327. ("xmlto" ,xmlto)
  1328. ("docbook-xml" ,docbook-xml)
  1329. ("docbook-xsl" ,docbook-xsl)))
  1330. (home-page "https://criu.org")
  1331. (synopsis "Checkpoint and restore in user space")
  1332. (description "Using this tool, you can freeze a running application (or
  1333. part of it) and checkpoint it to a hard drive as a collection of files. You
  1334. can then use the files to restore and run the application from the point it
  1335. was frozen at. The distinctive feature of the CRIU project is that it is
  1336. mainly implemented in user space.")
  1337. ;; The project is licensed under GPLv2; files in the lib/ directory are
  1338. ;; LGPLv2.1.
  1339. (license (list license:gpl2 license:lgpl2.1))))
  1340. (define-public qmpbackup
  1341. (package
  1342. (name "qmpbackup")
  1343. (version "0.2")
  1344. (source (origin
  1345. (method git-fetch)
  1346. (uri (git-reference
  1347. (url "https://github.com/abbbi/qmpbackup")
  1348. (commit version)))
  1349. (file-name (git-file-name name version))
  1350. (sha256
  1351. (base32
  1352. "0swhp5byz44brhyis1a39p11fyn9q84xz5q6v2fah29r7d71kmmx"))))
  1353. (build-system python-build-system)
  1354. (arguments
  1355. `(#:python ,python-2))
  1356. (home-page "https://github.com/abbbi/qmpbackup")
  1357. (synopsis "Backup and restore QEMU machines")
  1358. (description "qmpbackup is designed to create and restore full and
  1359. incremental backups of running QEMU virtual machines via QMP, the QEMU
  1360. Machine Protocol.")
  1361. (license license:gpl3+)))
  1362. (define-public looking-glass-client
  1363. (let ((commit "182c4752d57690da7f99d5e788de9b8baea33895"))
  1364. (package
  1365. (name "looking-glass-client")
  1366. (version (string-append "a12-" (string-take commit 7)))
  1367. (source
  1368. (origin
  1369. (method git-fetch)
  1370. (uri (git-reference (url "https://github.com/gnif/LookingGlass")
  1371. (commit commit)))
  1372. (file-name (git-file-name name version))
  1373. (sha256
  1374. (base32
  1375. "02bq46ndmzq9cihazzn7xq1x7q5nzm7iw4l9lqzihxcxp9famkhw"))
  1376. (modules '((guix build utils)))
  1377. (snippet
  1378. '(begin
  1379. ;; Do not create binaries optimized for the CPU of the build machine,
  1380. ;; for reproducibility and compatibility. TODO: in the next version
  1381. ;; of looking glass, this is exposed as a CMake configure option.
  1382. (substitute* "client/CMakeLists.txt"
  1383. (("-march=native")
  1384. ""))
  1385. #t))))
  1386. (build-system cmake-build-system)
  1387. (inputs `(("fontconfig" ,fontconfig)
  1388. ("glu" ,glu)
  1389. ("mesa" ,mesa)
  1390. ("openssl" ,openssl)
  1391. ("sdl2" ,sdl2)
  1392. ("sdl2-ttf" ,sdl2-ttf)
  1393. ("spice-protocol" ,spice-protocol)
  1394. ("wayland" ,wayland)))
  1395. (native-inputs `(("libconfig" ,libconfig)
  1396. ("nettle" ,nettle)
  1397. ("pkg-config" ,pkg-config)))
  1398. (arguments
  1399. `(#:tests? #f ;; No tests are available.
  1400. #:make-flags '("CC=gcc")
  1401. #:phases (modify-phases %standard-phases
  1402. (add-before 'configure 'chdir-to-client
  1403. (lambda* (#:key outputs #:allow-other-keys)
  1404. (chdir "client")
  1405. #t))
  1406. (add-after 'chdir-to-client 'add-missing-include
  1407. (lambda _
  1408. ;; Mimic upstream commit b9797529893, required since the
  1409. ;; update to Mesa 19.2.
  1410. (substitute* "renderers/egl/shader.h"
  1411. (("#include <stdbool\\.h>")
  1412. "#include <stdbool.h>\n#include <stddef.h>"))
  1413. #t))
  1414. (replace 'install
  1415. (lambda* (#:key outputs #:allow-other-keys)
  1416. (install-file "looking-glass-client"
  1417. (string-append (assoc-ref outputs "out")
  1418. "/bin"))
  1419. #t)))))
  1420. (home-page "https://looking-glass.hostfission.com")
  1421. (synopsis "KVM Frame Relay (KVMFR) implementation")
  1422. (description "Looking Glass allows the use of a KVM (Kernel-based Virtual
  1423. Machine) configured for VGA PCI Pass-through without an attached physical
  1424. monitor, keyboard or mouse. It displays the VM's rendered contents on your main
  1425. monitor/GPU.")
  1426. ;; This package requires SSE instructions.
  1427. (supported-systems '("i686-linux" "x86_64-linux"))
  1428. (license license:gpl2+))))
  1429. (define-public runc
  1430. (package
  1431. (name "runc")
  1432. (version "1.0.0-rc6")
  1433. (source (origin
  1434. (method url-fetch)
  1435. (uri (string-append
  1436. "https://github.com/opencontainers/runc/releases/"
  1437. "download/v" version "/runc.tar.xz"))
  1438. (file-name (string-append name "-" version ".tar.xz"))
  1439. (patches (search-patches "runc-CVE-2019-5736.patch"))
  1440. (sha256
  1441. (base32
  1442. "1c7832dq70slkjh8qp2civ1wxhhdd2hrx84pq7db1mmqc9fdr3cc"))))
  1443. (build-system go-build-system)
  1444. (arguments
  1445. '(#:import-path "github.com/opencontainers/runc"
  1446. #:install-source? #f
  1447. ;; XXX: 20/139 tests fail due to missing /var, cgroups and apparmor in
  1448. ;; the build environment.
  1449. #:tests? #f
  1450. #:phases
  1451. (modify-phases %standard-phases
  1452. (replace 'unpack
  1453. (lambda* (#:key source import-path #:allow-other-keys)
  1454. ;; Unpack the tarball into 'runc' instead of 'runc-1.0.0-rc5'.
  1455. (let ((dest (string-append "src/" import-path)))
  1456. (mkdir-p dest)
  1457. (invoke "tar" "-C" (string-append "src/" import-path)
  1458. "--strip-components=1"
  1459. "-xvf" source))))
  1460. (replace 'build
  1461. (lambda* (#:key import-path #:allow-other-keys)
  1462. (chdir (string-append "src/" import-path))
  1463. ;; XXX: requires 'go-md2man'.
  1464. ;; (invoke "make" "man")
  1465. (invoke "make")))
  1466. ;; (replace 'check
  1467. ;; (lambda _
  1468. ;; (invoke "make" "localunittest")))
  1469. (replace 'install
  1470. (lambda* (#:key outputs #:allow-other-keys)
  1471. (let ((out (assoc-ref outputs "out")))
  1472. (invoke "make" "install" "install-bash"
  1473. (string-append "PREFIX=" out))))))))
  1474. (native-inputs
  1475. `(("pkg-config" ,pkg-config)))
  1476. (inputs
  1477. `(("libseccomp" ,libseccomp)))
  1478. (synopsis "Open container initiative runtime")
  1479. (home-page "https://www.opencontainers.org/")
  1480. (description
  1481. "@command{runc} is a command line client for running applications
  1482. packaged according to the
  1483. @uref{https://github.com/opencontainers/runtime-spec/blob/master/spec.md, Open
  1484. Container Initiative (OCI) format} and is a compliant implementation of the
  1485. Open Container Initiative specification.")
  1486. (license license:asl2.0)))
  1487. (define-public umoci
  1488. (package
  1489. (name "umoci")
  1490. (version "0.4.6")
  1491. (source
  1492. (origin
  1493. (method url-fetch)
  1494. (uri (string-append
  1495. "https://github.com/opencontainers/umoci/releases/download/v"
  1496. version "/umoci.tar.xz"))
  1497. (file-name (string-append "umoci-" version ".tar.xz"))
  1498. (sha256
  1499. (base32 "06q7xfwnqysc013hapx31jhlzmyg8qb467qfkynj673qc7p9bd6h"))))
  1500. (build-system go-build-system)
  1501. (arguments
  1502. '(#:import-path "github.com/opencontainers/umoci"
  1503. #:install-source? #f
  1504. #:phases
  1505. (modify-phases %standard-phases
  1506. (replace 'unpack
  1507. (lambda* (#:key source import-path #:allow-other-keys)
  1508. ;; Unpack the tarball into 'umoci' instead of "runc-${version}".
  1509. (let ((dest (string-append "src/" import-path)))
  1510. (mkdir-p dest)
  1511. (invoke "tar" "-C" (string-append "src/" import-path)
  1512. "--strip-components=1"
  1513. "-xvf" source))))
  1514. (replace 'build
  1515. (lambda* (#:key import-path #:allow-other-keys)
  1516. (chdir (string-append "src/" import-path))
  1517. ;; TODO: build manpages with 'go-md2man'.
  1518. (invoke "make" "SHELL=bash")))
  1519. (replace 'install
  1520. (lambda* (#:key outputs #:allow-other-keys)
  1521. (let* ((out (assoc-ref outputs "out"))
  1522. (bindir (string-append out "/bin")))
  1523. (install-file "umoci" bindir)
  1524. #t))))))
  1525. (home-page "https://umo.ci/")
  1526. (synopsis "Tool for modifying Open Container images")
  1527. (description
  1528. "@command{umoci} is a tool that allows for high-level modification of an
  1529. Open Container Initiative (OCI) image layout and its tagged images.")
  1530. (license license:asl2.0)))
  1531. (define-public skopeo
  1532. (package
  1533. (name "skopeo")
  1534. (version "0.1.40")
  1535. (source (origin
  1536. (method git-fetch)
  1537. (uri (git-reference
  1538. (url "https://github.com/projectatomic/skopeo")
  1539. (commit (string-append "v" version))))
  1540. (file-name (git-file-name name version))
  1541. (sha256
  1542. (base32
  1543. "1bagirzdzjhicn5dr691092ac3q6lhz3xngjzgqiqkxnvpz7p6cn"))))
  1544. (build-system go-build-system)
  1545. (native-inputs
  1546. `(("pkg-config" ,pkg-config)))
  1547. (inputs
  1548. `(("btrfs-progs" ,btrfs-progs)
  1549. ("eudev" ,eudev)
  1550. ("libassuan" ,libassuan)
  1551. ("libselinux" ,libselinux)
  1552. ("libostree" ,libostree)
  1553. ("lvm2" ,lvm2)
  1554. ("glib" ,glib)
  1555. ("gpgme" ,gpgme)))
  1556. (arguments
  1557. '(#:import-path "github.com/projectatomic/skopeo"
  1558. #:install-source? #f
  1559. #:tests? #f ; The tests require Docker
  1560. #:phases
  1561. (modify-phases %standard-phases
  1562. (replace 'build
  1563. (lambda* (#:key import-path #:allow-other-keys)
  1564. (chdir (string-append "src/" import-path))
  1565. ;; TODO: build manpages with 'go-md2man'.
  1566. (invoke "make" "binary-local")))
  1567. (replace 'install
  1568. (lambda* (#:key outputs #:allow-other-keys)
  1569. (let ((out (assoc-ref outputs "out")))
  1570. (invoke "make" "install-binary" "install-completions"
  1571. (string-append "PREFIX=" out))))))))
  1572. (home-page "https://github.com/projectatomic/skopeo")
  1573. (synopsis "Interact with container images and container image registries")
  1574. (description
  1575. "@command{skopeo} is a command line utility providing various operations
  1576. with container images and container image registries. It can:
  1577. @enumerate
  1578. @item Copy container images between various containers image stores,
  1579. converting them as necessary.
  1580. @item Convert a Docker schema 2 or schema 1 container image to an OCI image.
  1581. @item Inspect a repository on a container registry without needlessly pulling
  1582. the image.
  1583. @item Sign and verify container images.
  1584. @item Delete container images from a remote container registry.
  1585. @end enumerate")
  1586. (license license:asl2.0)))
  1587. (define-public python-vagrant
  1588. (package
  1589. (name "python-vagrant")
  1590. (version "0.5.15")
  1591. (source
  1592. (origin
  1593. (method url-fetch)
  1594. (uri (pypi-uri "python-vagrant" version))
  1595. (sha256
  1596. (base32
  1597. "1ikrh6canhcxg5y7pzmkcnnydikppv7s6sm9prfx90nk0ac8m6mg"))))
  1598. (build-system python-build-system)
  1599. (arguments
  1600. '(#:tests? #f)) ; tests involve running vagrant.
  1601. (home-page "https://github.com/todddeluca/python-vagrant")
  1602. (synopsis "Python bindings for Vagrant")
  1603. (description
  1604. "Python-vagrant is a Python module that provides a thin wrapper around the
  1605. @code{vagrant} command line executable, allowing programmatic control of Vagrant
  1606. virtual machines.")
  1607. (license license:expat)))
  1608. (define-public bubblewrap
  1609. (package
  1610. (name "bubblewrap")
  1611. (version "0.4.1")
  1612. (source (origin
  1613. (method url-fetch)
  1614. (uri (string-append "https://github.com/containers/bubblewrap/"
  1615. "releases/download/v" version "/bubblewrap-"
  1616. version ".tar.xz"))
  1617. (sha256
  1618. (base32
  1619. "00ycgi6q2yngh06bnz50wkvar6r2jnjf3j158grhi9k13jdrpimr"))))
  1620. (build-system gnu-build-system)
  1621. (arguments
  1622. `(#:phases
  1623. (modify-phases %standard-phases
  1624. (add-after 'unpack 'fix-test
  1625. (lambda* (#:key outputs #:allow-other-keys)
  1626. ;; Tests try to access /var/tmp, which is not possible in our build
  1627. ;; environment. Let's give them another directory.
  1628. ;; /tmp gets overriden in some tests, so we need another directory.
  1629. ;; the only possibility is the output directory.
  1630. (let ((tmp-dir (string-append (assoc-ref outputs "out") "/tmp")))
  1631. (mkdir-p tmp-dir)
  1632. (substitute* "tests/test-run.sh"
  1633. (("/var/tmp") tmp-dir)
  1634. ;; Tests create a temporary python script, so fix its shebang.
  1635. (("/usr/bin/env python") (which "python"))
  1636. ;; Some tests try to access /usr, but that doesn't exist.
  1637. ;; Give them /gnu instead.
  1638. (("/usr") "/gnu")
  1639. (("--ro-bind /bin /bin") "--ro-bind /gnu /bin")
  1640. (("--ro-bind /sbin /sbin") "--ro-bind /gnu /sbin")
  1641. (("--ro-bind /lib /lib") "--ro-bind /gnu /lib")
  1642. ((" */bin/bash") (which "bash"))
  1643. (("/bin/sh") (which "sh"))
  1644. (("findmnt") (which "findmnt"))))
  1645. #t))
  1646. ;; Remove the directory we gave to tests to have a clean package.
  1647. (add-after 'check 'remove-tmp-dir
  1648. (lambda* (#:key outputs #:allow-other-keys)
  1649. (delete-file-recursively (string-append (assoc-ref outputs "out") "/tmp"))
  1650. #t)))))
  1651. (inputs
  1652. `(("libcap" ,libcap)))
  1653. (native-inputs
  1654. `(("python" ,python-wrapper)
  1655. ("util-linux" ,util-linux)))
  1656. (home-page "https://github.com/containers/bubblewrap")
  1657. (synopsis "Unprivileged sandboxing tool")
  1658. (description "Bubblewrap is aimed at running applications in a sandbox,
  1659. restricting their access to parts of the operating system or user data such as
  1660. the home directory. Bubblewrap always creates a new mount namespace, and the
  1661. user can specify exactly what parts of the file system should be made visible
  1662. in the sandbox. These directories are mounted with the @code{nodev} option
  1663. by default and can be made read-only.")
  1664. (license license:lgpl2.0+)))
  1665. (define-public bochs
  1666. (package
  1667. (name "bochs")
  1668. (version "2.6.11")
  1669. (source
  1670. (origin
  1671. (method url-fetch)
  1672. (uri (string-append "https://sourceforge.net/projects/bochs/files/bochs/"
  1673. version "/bochs-" version ".tar.gz"))
  1674. (sha256
  1675. (base32 "0ql8q6y1k356li1g9gbvl21448mlxphxxi6kjb2b3pxvzd0pp2b3"))))
  1676. (build-system gnu-build-system)
  1677. (arguments
  1678. `(#:tests? #f)) ; no tests exist
  1679. (inputs
  1680. `(("libxrandr" ,libxrandr)))
  1681. (home-page "http://bochs.sourceforge.net/")
  1682. (synopsis "Emulator for x86 PC")
  1683. (description
  1684. "Bochs is an emulator which can emulate Intel x86 CPU, common I/O
  1685. devices, and a custom BIOS. It can also be compiled to emulate many different
  1686. x86 CPUs, from early 386 to the most recent x86-64 Intel and AMD processors.
  1687. Bochs can run most Operating Systems inside the emulation including Linux,
  1688. DOS or Microsoft Windows.")
  1689. (license license:lgpl2.0+)))
  1690. (define-public xen
  1691. (package
  1692. (name "xen")
  1693. (version "4.13.0")
  1694. (source (origin
  1695. (method git-fetch)
  1696. (uri (git-reference
  1697. (url "git://xenbits.xenproject.org/xen.git")
  1698. (commit (string-append "RELEASE-" version))))
  1699. (file-name (git-file-name name version))
  1700. (sha256
  1701. (base32
  1702. "0py50n995gv909i0d1lfdcj9wcp5g1d5z6m2291jqqlfyany138g"))))
  1703. (build-system gnu-build-system)
  1704. (arguments
  1705. `(#:configure-flags
  1706. (list "--enable-rpath"
  1707. "--disable-qemu-traditional" ; It tries to do "git clone"
  1708. "--disable-rombios" ; would try to "git clone" via etherboot.
  1709. ;; TODO: Re-enable stubdom (it's "more secure" to use it).
  1710. "--disable-stubdom" ; tries to "git clone" old patched newlib.
  1711. (string-append "--with-initddir="
  1712. (assoc-ref %outputs "out")
  1713. "/etc/init.d")
  1714. (string-append "--with-system-qemu="
  1715. (assoc-ref %build-inputs "qemu")
  1716. "/bin/qemu-system-i386")
  1717. (string-append "--with-system-seabios="
  1718. (assoc-ref %build-inputs "seabios")
  1719. "/share/firmware/bios.bin")
  1720. (string-append "--with-system-ovmf="
  1721. (assoc-ref %build-inputs "ovmf")
  1722. "/share/firmware/ovmf_ia32.bin"))
  1723. #:make-flags (list "-j" "1"
  1724. "XEN_BUILD_DATE=Thu Jan 1 01:00:01 CET 1970"
  1725. "XEN_BUILD_TIME=01:00:01"
  1726. "XEN_BUILD_HOST="
  1727. "ETHERBOOT_NICS="
  1728. "SMBIOS_REL_DATE=01/01/1970"
  1729. "VGABIOS_REL_DATE=01 Jan 1970"
  1730. ; QEMU_TRADITIONAL_LOC
  1731. ; QEMU_UPSTREAM_LOC
  1732. "SYSCONFIG_DIR=/tmp/etc/default"
  1733. (string-append "BASH_COMPLETION_DIR="
  1734. (assoc-ref %outputs "out")
  1735. "/etc/bash_completion.d")
  1736. (string-append "BOOT_DIR="
  1737. (assoc-ref %outputs "out")
  1738. "/boot")
  1739. (string-append "DEBUG_DIR="
  1740. (assoc-ref %outputs "out")
  1741. "/lib/debug")
  1742. (string-append "EFI_DIR="
  1743. (assoc-ref %outputs "out")
  1744. "/lib/efi") ; TODO lib64 ?
  1745. "MINIOS_UPSTREAM_URL="
  1746. ;(string-append "DISTDIR="
  1747. ; (assoc-ref %outputs "out"))
  1748. )
  1749. #:test-target "test"
  1750. #:phases
  1751. (modify-phases %standard-phases
  1752. (add-after 'unpack 'unpack-mini-os
  1753. (lambda* (#:key inputs #:allow-other-keys)
  1754. (copy-recursively (assoc-ref inputs "mini-os") "extras/mini-os")
  1755. #t))
  1756. (add-after 'unpack-mini-os 'patch
  1757. (lambda* (#:key inputs outputs #:allow-other-keys)
  1758. (substitute* "tools/firmware/Rules.mk"
  1759. (("override XEN_TARGET_ARCH = x86_32")
  1760. (string-append "override XEN_TARGET_ARCH = x86_32
  1761. override CC = " (assoc-ref inputs "cross-gcc") "/bin/i686-linux-gnu-gcc"))
  1762. (("^CFLAGS =$")
  1763. (string-append "CFLAGS=-I" (assoc-ref inputs "cross-libc")
  1764. "/include\n")))
  1765. (substitute* "config/x86_32.mk"
  1766. (("CFLAGS += -m32 -march=i686")
  1767. (string-append "CFLAGS += -march=i686 -I"
  1768. (assoc-ref inputs "cross-libc")
  1769. "/include")))
  1770. ;; /var is not in /gnu/store , so don't try to create it.
  1771. (substitute* '("tools/Makefile"
  1772. "tools/xenstore/Makefile"
  1773. "tools/xenpaging/Makefile")
  1774. (("\\$\\(INSTALL_DIR\\) .*XEN_(DUMP|LOG|RUN|LIB|PAGING)_DIR.*")
  1775. "\n")
  1776. (("\\$\\(INSTALL_DIR\\) .*XEN_(RUN|LIB)_STORED.*")
  1777. "\n"))
  1778. ;; Prevent xen from creating /etc .
  1779. (substitute* "tools/examples/Makefile"
  1780. ((" install-readmes") "")
  1781. ((" install-configs") ""))
  1782. ;; Set rpath.
  1783. (substitute* "tools/pygrub/setup.py"
  1784. (("library_dirs =")
  1785. ; TODO: extra_link_args = ['-Wl,-rpath=/opt/foo'],
  1786. (string-append "runtime_library_dirs = ['"
  1787. (assoc-ref outputs "out")
  1788. "/lib'],\nlibrary_dirs =")))
  1789. #t))
  1790. (add-before 'configure 'patch-xen-script-directory
  1791. (lambda* (#:key outputs #:allow-other-keys)
  1792. (substitute* '("configure"
  1793. "tools/configure"
  1794. "docs/configure")
  1795. (("XEN_SCRIPT_DIR=.*")
  1796. (string-append "XEN_SCRIPT_DIR="
  1797. (assoc-ref outputs "out")
  1798. "/etc/xen/scripts")))
  1799. #t))
  1800. (add-before 'configure 'set-environment-up
  1801. (lambda* (#:key make-flags #:allow-other-keys)
  1802. (define (cross? x)
  1803. (string-contains x "cross-i686-linux"))
  1804. (define (filter-environment! filter-predicate
  1805. environment-variable-names)
  1806. (for-each
  1807. (lambda (env-name)
  1808. (let* ((env-value (getenv env-name))
  1809. (search-path (search-path-as-string->list env-value))
  1810. (new-search-path (filter filter-predicate
  1811. search-path))
  1812. (new-env-value (list->search-path-as-string
  1813. new-search-path ":")))
  1814. (setenv env-name new-env-value)))
  1815. environment-variable-names))
  1816. (setenv "CROSS_CPATH" (getenv "CPATH"))
  1817. (setenv "CROSS_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
  1818. (filter-environment! cross?
  1819. '("CROSS_CPATH"
  1820. "CROSS_LIBRARY_PATH"))
  1821. (filter-environment! (lambda (e) (not (cross? e)))
  1822. '("CPATH"
  1823. "LIBRARY_PATH"))
  1824. ;; Guix tries to be helpful and automatically adds
  1825. ;; mini-os-git-checkout/include to the include path,
  1826. ;; but actually we don't want it to be there (yet).
  1827. (filter-environment! (lambda (e)
  1828. (not
  1829. (string-contains e
  1830. "mini-os-git-checkout")))
  1831. '("CPATH"
  1832. "LIBRARY_PATH"))
  1833. (setenv "EFI_VENDOR" "guix")
  1834. #t))
  1835. (replace 'build
  1836. (lambda* (#:key make-flags #:allow-other-keys)
  1837. (apply invoke "make" "world" make-flags))))))
  1838. (inputs
  1839. `(("acpica" ,acpica) ; TODO: patch iasl invocation.
  1840. ("bridge-utils" ,bridge-utils) ; TODO: patch invocations.
  1841. ("glib" ,glib)
  1842. ("iproute" ,iproute) ; TODO: patch invocations.
  1843. ("libaio" ,libaio)
  1844. ("libx11" ,libx11)
  1845. ("libyajl" ,libyajl)
  1846. ("ncurses" ,ncurses)
  1847. ("openssl" ,openssl)
  1848. ("ovmf" ,ovmf)
  1849. ("pixman" ,pixman)
  1850. ("qemu" ,qemu-minimal)
  1851. ("seabios" ,seabios)
  1852. ("util-linux" ,util-linux "lib") ; uuid
  1853. ; TODO: ocaml-findlib, ocaml-nox.
  1854. ("xz" ,xz) ; for liblzma
  1855. ("zlib" ,zlib)))
  1856. (native-inputs
  1857. `(("dev86" ,dev86)
  1858. ("bison" ,bison)
  1859. ("cmake" ,cmake-minimal)
  1860. ("figlet" ,figlet)
  1861. ("flex" ,flex)
  1862. ("gettext" ,gettext-minimal)
  1863. ("libnl" ,libnl)
  1864. ("mini-os"
  1865. ,(origin
  1866. (method git-fetch)
  1867. (uri (git-reference
  1868. (url "http://xenbits.xen.org/git-http/mini-os.git")
  1869. (commit (string-append "xen-RELEASE-" version))))
  1870. (sha256
  1871. (base32
  1872. "1i8pcl19n60i2m9vlg79q3nknpj209c9ic5x10wxaicx45kc107f"))
  1873. (file-name "mini-os-git-checkout")))
  1874. ("perl" ,perl)
  1875. ; TODO: markdown
  1876. ("pkg-config" ,pkg-config)
  1877. ("python" ,python-2)
  1878. ("wget" ,wget)
  1879. ("cross-gcc" ,(cross-gcc "i686-linux-gnu"
  1880. #:xbinutils (cross-binutils "i686-linux-gnu")
  1881. #:libc (cross-libc "i686-linux-gnu")))
  1882. ("cross-libc" ,(cross-libc "i686-linux-gnu")) ; header files
  1883. ("cross-libc-static" ,(cross-libc "i686-linux-gnu") "static")))
  1884. (home-page "https://xenproject.org/")
  1885. (synopsis "Xen Virtual Machine Monitor")
  1886. (description "This package provides the Xen Virtual Machine Monitor
  1887. which is a hypervisor.")
  1888. ;; TODO: Some files are licensed differently. List those.
  1889. (license license:gpl2)
  1890. (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))))
  1891. (define-public osinfo-db-tools
  1892. (package
  1893. (name "osinfo-db-tools")
  1894. (version "1.8.0")
  1895. (source (origin
  1896. (method url-fetch)
  1897. (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-tools-"
  1898. version ".tar.xz"))
  1899. (sha256
  1900. (base32
  1901. "038q3gzdbkfkhpicj0755mw1q4gbvn57pslpw8n2dp3lds9im0g9"))))
  1902. (build-system meson-build-system)
  1903. (inputs
  1904. `(("libsoup" ,libsoup)
  1905. ("libxml2" ,libxml2)
  1906. ("libxslt" ,libxslt)
  1907. ("json-glib" ,json-glib)
  1908. ("libarchive" ,libarchive)))
  1909. (native-inputs
  1910. `(("perl" ,perl)
  1911. ("gobject-introspection" ,gobject-introspection)
  1912. ("gettext" ,gettext-minimal)
  1913. ("pkg-config" ,pkg-config)
  1914. ;; Tests
  1915. ("python" ,python)
  1916. ("pytest" ,python-pytest)
  1917. ("requests" ,python-requests)))
  1918. (home-page "https://gitlab.com/libosinfo/osinfo-db-tools")
  1919. (synopsis "Tools for managing the osinfo database")
  1920. (description "This package contains a set of tools to assist
  1921. administrators and developers in managing the database.")
  1922. (license license:lgpl2.0+)))
  1923. (define-public osinfo-db
  1924. (package
  1925. (name "osinfo-db")
  1926. (version "20200529")
  1927. (source (origin
  1928. (method url-fetch)
  1929. (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-"