Mirror of GNU Guix
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.

1469 lines
61 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
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
  4. ;;; Copyright © 2016, 2017, 2018. 2019 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. ;;;
  17. ;;; This file is part of GNU Guix.
  18. ;;;
  19. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  20. ;;; under the terms of the GNU General Public License as published by
  21. ;;; the Free Software Foundation; either version 3 of the License, or (at
  22. ;;; your option) any later version.
  23. ;;;
  24. ;;; GNU Guix is distributed in the hope that it will be useful, but
  25. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  26. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. ;;; GNU General Public License for more details.
  28. ;;;
  29. ;;; You should have received a copy of the GNU General Public License
  30. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  31. (define-module (gnu packages virtualization)
  32. #:use-module (gnu packages)
  33. #:use-module (gnu packages admin)
  34. #:use-module (gnu packages assembly)
  35. #:use-module (gnu packages attr)
  36. #:use-module (gnu packages autotools)
  37. #:use-module (gnu packages backup)
  38. #:use-module (gnu packages bison)
  39. #:use-module (gnu packages check)
  40. #:use-module (gnu packages cmake)
  41. #:use-module (gnu packages compression)
  42. #:use-module (gnu packages cross-base)
  43. #:use-module (gnu packages curl)
  44. #:use-module (gnu packages cyrus-sasl)
  45. #:use-module (gnu packages disk)
  46. #:use-module (gnu packages dns)
  47. #:use-module (gnu packages docbook)
  48. #:use-module (gnu packages documentation)
  49. #:use-module (gnu packages figlet)
  50. #:use-module (gnu packages firmware)
  51. #:use-module (gnu packages flex)
  52. #:use-module (gnu packages fontutils)
  53. #:use-module (gnu packages freedesktop)
  54. #:use-module (gnu packages gettext)
  55. #:use-module (gnu packages gl)
  56. #:use-module (gnu packages glib)
  57. #:use-module (gnu packages gnome)
  58. #:use-module (gnu packages gnupg)
  59. #:use-module (gnu packages golang)
  60. #:use-module (gnu packages gtk)
  61. #:use-module (gnu packages image)
  62. #:use-module (gnu packages libbsd)
  63. #:use-module (gnu packages libusb)
  64. #:use-module (gnu packages linux)
  65. #:use-module (gnu packages ncurses)
  66. #:use-module (gnu packages nettle)
  67. #:use-module (gnu packages networking)
  68. #:use-module (gnu packages onc-rpc)
  69. #:use-module (gnu packages package-management)
  70. #:use-module (gnu packages perl)
  71. #:use-module (gnu packages pkg-config)
  72. #:use-module (gnu packages polkit)
  73. #:use-module (gnu packages protobuf)
  74. #:use-module (gnu packages python)
  75. #:use-module (gnu packages python-web)
  76. #:use-module (gnu packages python-xyz)
  77. #:use-module (gnu packages pulseaudio)
  78. #:use-module (gnu packages selinux)
  79. #:use-module (gnu packages sdl)
  80. #:use-module (gnu packages sphinx)
  81. #:use-module (gnu packages spice)
  82. #:use-module (gnu packages texinfo)
  83. #:use-module (gnu packages textutils)
  84. #:use-module (gnu packages tls)
  85. #:use-module (gnu packages web)
  86. #:use-module (gnu packages wget)
  87. #:use-module (gnu packages xdisorg)
  88. #:use-module (gnu packages xml)
  89. #:use-module (gnu packages xorg)
  90. #:use-module (guix build-system cmake)
  91. #:use-module (guix build-system gnu)
  92. #:use-module (guix build-system go)
  93. #:use-module (guix build-system meson)
  94. #:use-module (guix build-system python)
  95. #:use-module (guix build-system trivial)
  96. #:use-module (guix download)
  97. #:use-module (guix git-download)
  98. #:use-module ((guix licenses) #:prefix license:)
  99. #:use-module (guix packages)
  100. #:use-module (guix utils)
  101. #:use-module (srfi srfi-1))
  102. (define (qemu-patch commit file-name sha256)
  103. "Return an origin for COMMIT."
  104. (origin
  105. (method url-fetch)
  106. (uri (string-append
  107. "http://git.qemu.org/?p=qemu.git;a=commitdiff_plain;h="
  108. commit))
  109. (sha256 sha256)
  110. (file-name file-name)))
  111. (define-public qemu
  112. (package
  113. (name "qemu")
  114. (version "4.2.0")
  115. (source (origin
  116. (method url-fetch)
  117. (uri (string-append "https://download.qemu.org/qemu-"
  118. version ".tar.xz"))
  119. (patches (search-patches "qemu-CVE-2020-1711.patch"
  120. "qemu-CVE-2020-7039.patch"
  121. "qemu-CVE-2020-7211.patch"
  122. "qemu-CVE-2020-8608.patch"
  123. "qemu-fix-documentation-build-failure.patch"))
  124. (sha256
  125. (base32
  126. "1w38hzlw7xp05gcq1nhga7hxvndxy6dfcnzi7q2il8ff110isj6k"))))
  127. (build-system gnu-build-system)
  128. (arguments
  129. '(;; Running tests in parallel can occasionally lead to failures, like:
  130. ;; boot_sector_test: assertion failed (signature == SIGNATURE): (0x00000000 == 0x0000dead)
  131. #:parallel-tests? #f
  132. #:configure-flags (list "--enable-usb-redir" "--enable-opengl"
  133. "--enable-docs"
  134. (string-append "--smbd="
  135. (assoc-ref %outputs "out")
  136. "/libexec/samba-wrapper")
  137. "--audio-drv-list=alsa,pa,sdl")
  138. ;; Make build and test output verbose to facilitate investigation upon failure.
  139. #:make-flags '("V=1")
  140. #:phases
  141. (modify-phases %standard-phases
  142. (replace 'configure
  143. (lambda* (#:key inputs outputs (configure-flags '())
  144. #:allow-other-keys)
  145. ;; The `configure' script doesn't understand some of the
  146. ;; GNU options. Thus, add a new phase that's compatible.
  147. (let ((out (assoc-ref outputs "out")))
  148. (setenv "SHELL" (which "bash"))
  149. ;; While we're at it, patch for tests.
  150. (substitute* "tests/libqtest.c"
  151. (("/bin/sh") (which "sh")))
  152. ;; The binaries need to be linked against -lrt.
  153. (setenv "LDFLAGS" "-lrt")
  154. (apply invoke
  155. `("./configure"
  156. ,(string-append "--cc=" (which "gcc"))
  157. ;; Some architectures insist on using HOST_CC
  158. ,(string-append "--host-cc=" (which "gcc"))
  159. "--disable-debug-info" ; save build space
  160. "--enable-virtfs" ; just to be sure
  161. ,(string-append "--prefix=" out)
  162. ,(string-append "--sysconfdir=/etc")
  163. ,@configure-flags)))))
  164. (add-after 'install 'install-info
  165. (lambda* (#:key inputs outputs #:allow-other-keys)
  166. ;; Install the Info manual, unless Texinfo is missing.
  167. (when (assoc-ref inputs "texinfo")
  168. (let* ((out (assoc-ref outputs "out"))
  169. (dir (string-append out "/share/info")))
  170. (invoke "make" "info")
  171. (for-each (lambda (info)
  172. (install-file info dir))
  173. (find-files "." "\\.info"))))
  174. #t))
  175. ;; Create a wrapper for Samba. This allows QEMU to use Samba without
  176. ;; pulling it in as an input. Note that you need to explicitly install
  177. ;; Samba in your Guix profile for Samba support.
  178. (add-after 'install-info 'create-samba-wrapper
  179. (lambda* (#:key inputs outputs #:allow-other-keys)
  180. (let* ((out (assoc-ref %outputs "out"))
  181. (libexec (string-append out "/libexec")))
  182. (call-with-output-file "samba-wrapper"
  183. (lambda (port)
  184. (format port "#!/bin/sh
  185. exec smbd $@")))
  186. (chmod "samba-wrapper" #o755)
  187. (install-file "samba-wrapper" libexec))
  188. #t))
  189. (add-before 'configure 'prevent-network-configuration
  190. (lambda _
  191. ;; Prevent the build from trying to use git to fetch from the net.
  192. (substitute* "Makefile"
  193. (("@./config.status")
  194. "")) #t))
  195. (add-before 'check 'disable-unusable-tests
  196. (lambda* (#:key inputs outputs #:allow-other-keys)
  197. (substitute* "tests/Makefile.include"
  198. ;; Comment out the test-qga test, which needs /sys and
  199. ;; fails within the build environment.
  200. (("check-unit-.* tests/test-qga" all)
  201. (string-append "# " all)))
  202. (substitute* "tests/Makefile.include"
  203. ;; Comment out the test-char test, which needs networking and
  204. ;; fails within the build environment.
  205. (("check-unit-.* tests/test-char" all)
  206. (string-append "# " all)))
  207. #t)))))
  208. (inputs ; TODO: Add optional inputs.
  209. `(("alsa-lib" ,alsa-lib)
  210. ("attr" ,attr)
  211. ("glib" ,glib)
  212. ("gtk+" ,gtk+)
  213. ("libaio" ,libaio)
  214. ("libattr" ,attr)
  215. ("libcap" ,libcap) ; virtfs support requires libcap & libattr
  216. ("libdrm" ,libdrm)
  217. ("libepoxy" ,libepoxy)
  218. ("libjpeg" ,libjpeg-turbo)
  219. ("libpng" ,libpng)
  220. ("libseccomp" ,libseccomp)
  221. ("libusb" ,libusb) ;USB pass-through support
  222. ("mesa" ,mesa)
  223. ("ncurses" ,ncurses)
  224. ;; ("pciutils" ,pciutils)
  225. ("pixman" ,pixman)
  226. ("pulseaudio" ,pulseaudio)
  227. ("sdl2" ,sdl2)
  228. ("spice" ,spice)
  229. ("usbredir" ,usbredir)
  230. ("util-linux" ,util-linux)
  231. ("vde2" ,vde2)
  232. ("virglrenderer" ,virglrenderer)
  233. ("zlib" ,zlib)))
  234. (native-inputs `(("gettext" ,gettext-minimal)
  235. ("glib:bin" ,glib "bin") ; gtester, etc.
  236. ("perl" ,perl)
  237. ("flex" ,flex)
  238. ("bison" ,bison)
  239. ("pkg-config" ,pkg-config)
  240. ("python-wrapper" ,python-wrapper)
  241. ("python-sphinx" ,python-sphinx)
  242. ("texinfo" ,texinfo)))
  243. (home-page "https://www.qemu.org")
  244. (synopsis "Machine emulator and virtualizer")
  245. (description
  246. "QEMU is a generic machine emulator and virtualizer.
  247. When used as a machine emulator, QEMU can run OSes and programs made for one
  248. machine (e.g. an ARM board) on a different machine---e.g., your own PC. By
  249. using dynamic translation, it achieves very good performance.
  250. When used as a virtualizer, QEMU achieves near native performances by
  251. executing the guest code directly on the host CPU. QEMU supports
  252. virtualization when executing under the Xen hypervisor or using
  253. the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86,
  254. server and embedded PowerPC, and S390 guests.")
  255. ;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'.
  256. (license license:gpl2)
  257. ;; Several tests fail on MIPS; see <http://hydra.gnu.org/build/117914>.
  258. (supported-systems (delete "mips64el-linux" %supported-systems))))
  259. (define-public qemu-minimal
  260. ;; QEMU without GUI support.
  261. (package (inherit qemu)
  262. (name "qemu-minimal")
  263. (synopsis "Machine emulator and virtualizer (without GUI)")
  264. (arguments
  265. (substitute-keyword-arguments (package-arguments qemu)
  266. ((#:configure-flags _ '(list))
  267. ;; Restrict to the targets supported by Guix.
  268. ''("--target-list=i386-softmmu,x86_64-softmmu,mips64el-softmmu,arm-softmmu,aarch64-softmmu"))))
  269. ;; Remove dependencies on optional libraries, notably GUI libraries.
  270. (native-inputs (fold alist-delete (package-native-inputs qemu)
  271. '("gettext")))
  272. (inputs (fold alist-delete (package-inputs qemu)
  273. '("libusb" "mesa" "sdl2" "spice" "virglrenderer" "gtk+"
  274. "usbredir" "libdrm" "libepoxy" "pulseaudio" "vde2")))))
  275. ;; The GRUB test suite fails with later versions of Qemu, so we
  276. ;; keep it at 2.10 for now. See
  277. ;; <https://lists.gnu.org/archive/html/bug-grub/2018-02/msg00004.html>.
  278. ;; This package is hidden since we do not backport updates to it.
  279. (define-public qemu-minimal-2.10
  280. (hidden-package
  281. (package
  282. (inherit qemu-minimal)
  283. (version "2.10.2")
  284. (source (origin
  285. (method url-fetch)
  286. (uri (string-append "https://download.qemu.org/qemu-"
  287. version ".tar.xz"))
  288. (sha256
  289. (base32
  290. "17w21spvaxaidi2am5lpsln8yjpyp2zi3s3gc6nsxj5arlgamzgw"))
  291. (patches
  292. (search-patches "qemu-glibc-2.27.patch"))))
  293. ;; qemu-minimal-2.10 needs Python 2. Remove below once no longer necessary.
  294. (native-inputs `(("python-2" ,python-2)
  295. ,@(fold alist-delete (package-native-inputs qemu-minimal)
  296. '("python-wrapper" "python-sphinx"))))
  297. (inputs
  298. (fold alist-delete (package-inputs qemu-minimal)
  299. ;; Disable seccomp support, because it's not required for the GRUB
  300. ;; test suite, and because it fails with libseccomp 2.4.2 and later.
  301. '("libseccomp"))))))
  302. (define-public libosinfo
  303. (package
  304. (name "libosinfo")
  305. (version "1.7.1")
  306. (source
  307. (origin
  308. (method url-fetch)
  309. (uri (string-append "https://releases.pagure.org/libosinfo/libosinfo-"
  310. version ".tar.xz"))
  311. (sha256
  312. (base32
  313. "1s97sv24bybggjx6hgqba2qdqz3ivfpd4cmkh4zm5y59sim109mv"))))
  314. (build-system meson-build-system)
  315. (arguments
  316. `(#:configure-flags
  317. (list (string-append "-Dwith-usb-ids-path="
  318. (assoc-ref %build-inputs "usb.ids"))
  319. (string-append "-Dwith-pci-ids-path="
  320. (assoc-ref %build-inputs "pci.ids")))
  321. #:phases
  322. (modify-phases %standard-phases
  323. (add-after 'unpack 'patch-osinfo-path
  324. (lambda* (#:key inputs #:allow-other-keys)
  325. (substitute* "osinfo/osinfo_loader.c"
  326. (("path = DATA_DIR.*")
  327. (string-append "path = \"" (assoc-ref inputs "osinfo-db")
  328. "/share/osinfo\";")))
  329. #t)))))
  330. (inputs
  331. `(("libsoup" ,libsoup)
  332. ("libxml2" ,libxml2)
  333. ("libxslt" ,libxslt)
  334. ("osinfo-db" ,osinfo-db)))
  335. (native-inputs
  336. `(("glib" ,glib "bin") ; glib-mkenums, etc.
  337. ("gobject-introspection" ,gobject-introspection)
  338. ("gtk-doc" ,gtk-doc)
  339. ("vala" ,vala)
  340. ("intltool" ,intltool)
  341. ("pkg-config" ,pkg-config)
  342. ("pci.ids"
  343. ,(origin
  344. (method url-fetch)
  345. (uri "https://github.com/pciutils/pciids/raw/ad02084f0bc143e3c15e31a6152a3dfb1d7a3156/pci.ids")
  346. (sha256
  347. (base32
  348. "0kfhpj5rnh24hz2714qhfmxk281vwc2w50sm73ggw5d15af7zfsw"))))
  349. ("usb.ids"
  350. ,(origin
  351. (method url-fetch)
  352. (uri "https://svn.code.sf.net/p/linux-usb/repo/trunk/htdocs/usb.ids?r=2681")
  353. (file-name "usb.ids")
  354. (sha256
  355. (base32
  356. "1m6yhvz5k8aqzxgk7xj3jkk8frl1hbv0h3vgj4wbnvnx79qnvz3r"))))))
  357. (home-page "https://libosinfo.org/")
  358. (synopsis "Operating system information database")
  359. (description "libosinfo is a GObject based library API for managing
  360. information about operating systems, hypervisors and the (virtual) hardware
  361. devices they can support. It includes a database containing device metadata
  362. and provides APIs to match/identify optimal devices for deploying an operating
  363. system on a hypervisor. Via GObject Introspection, the API is available in
  364. all common programming languages. Vala bindings are also provided.")
  365. ;; The library files are released under LGPLv2.1 or later; the source
  366. ;; files in the "tools" directory are released under GPLv2+.
  367. (license (list license:lgpl2.1+ license:gpl2+))))
  368. (define-public lxc
  369. (package
  370. (name "lxc")
  371. (version "3.1.0")
  372. (source (origin
  373. (method url-fetch)
  374. (uri (string-append
  375. "https://linuxcontainers.org/downloads/lxc/lxc-"
  376. version ".tar.gz"))
  377. (sha256
  378. (base32
  379. "1igxqgx8q9cp15mcp1y8j564bl85ijw04jcmgb1s5bmfbg1751sd"))))
  380. (build-system gnu-build-system)
  381. (native-inputs
  382. `(("pkg-config" ,pkg-config)))
  383. (inputs
  384. `(("gnutls" ,gnutls)
  385. ("libcap" ,libcap)
  386. ("libseccomp" ,libseccomp)
  387. ("libselinux" ,libselinux)))
  388. (arguments
  389. `(#:configure-flags
  390. (list (string-append "--docdir=" (assoc-ref %outputs "out")
  391. "/share/doc/" ,name "-" ,version)
  392. "--sysconfdir=/etc"
  393. "--localstatedir=/var")
  394. #:make-flags
  395. ;; Treat the kernel headers as system headers to silence
  396. ;; compiler warnings from those.
  397. (list (string-append "C_INCLUDE_PATH="
  398. (assoc-ref %build-inputs "kernel-headers")
  399. "/include"))
  400. #:phases
  401. (modify-phases %standard-phases
  402. (replace 'install
  403. (lambda* (#:key outputs #:allow-other-keys)
  404. (let* ((out (assoc-ref outputs "out"))
  405. (bashcompdir (string-append out "/etc/bash_completion.d")))
  406. (invoke "make" "install"
  407. (string-append "bashcompdir=" bashcompdir)
  408. ;; Don't install files into /var and /etc.
  409. "LXCPATH=/tmp/var/lib/lxc"
  410. "localstatedir=/tmp/var"
  411. "sysconfdir=/tmp/etc"
  412. "sysconfigdir=/tmp/etc/default")))))))
  413. (synopsis "Linux container tools")
  414. (home-page "https://linuxcontainers.org/")
  415. (description
  416. "LXC is a userspace interface for the Linux kernel containment features.
  417. Through a powerful API and simple tools, it lets Linux users easily create and
  418. manage system or application containers.")
  419. (license license:lgpl2.1+)))
  420. (define-public libvirt
  421. (package
  422. (name "libvirt")
  423. (version "5.8.0")
  424. (source
  425. (origin
  426. (method url-fetch)
  427. (uri (string-append "https://libvirt.org/sources/libvirt-"
  428. version ".tar.xz"))
  429. (sha256
  430. (base32 "0m8cqaqflvys5kaqpvb0qr4k365j09jc5xk6x70yvg8qkcl2hcz2"))
  431. (patches
  432. (search-patches "libvirt-create-machine-cgroup.patch"))))
  433. (build-system gnu-build-system)
  434. (arguments
  435. `(#:configure-flags
  436. (list "--with-qemu"
  437. "--with-qemu-user=nobody"
  438. "--with-qemu-group=kvm"
  439. "--with-polkit"
  440. (string-append "--docdir=" (assoc-ref %outputs "out") "/share/doc/"
  441. ,name "-" ,version)
  442. "--sysconfdir=/etc"
  443. "--localstatedir=/var")
  444. #:phases
  445. (modify-phases %standard-phases
  446. (add-before 'configure 'fix-BOURNE_SHELL-definition
  447. ;; BOURNE_SHELL is hard-#defined to ‘/bin/sh’, causing test failures.
  448. (lambda _
  449. (substitute* "config.h.in"
  450. (("/bin/sh") (which "sh")))
  451. #t))
  452. (add-before 'configure 'patch-libtirpc-file-names
  453. (lambda* (#:key inputs #:allow-other-keys)
  454. ;; libvirt uses an m4 macro instead of pkg-config to determine where
  455. ;; the RPC headers are located. Tell it to look in the right place.
  456. (substitute* "configure"
  457. (("/usr/include/tirpc") ;defined in m4/virt-xdr.m4
  458. (string-append (assoc-ref inputs "libtirpc")
  459. "/include/tirpc")))
  460. #t))
  461. (add-before 'configure 'disable-broken-tests
  462. (lambda _
  463. (let ((tests (list "commandtest" ; hangs idly
  464. "qemuxml2argvtest" ; fails
  465. "qemuhotplugtest" ; fails
  466. "virnetsockettest" ; tries to network
  467. "virshtest"))) ; fails
  468. (substitute* "tests/Makefile.in"
  469. (((format #f "(~a)\\$\\(EXEEXT\\)" (string-join tests "|")))
  470. ""))
  471. #t)))
  472. (replace 'install
  473. ;; Since the sysconfdir and localstatedir should be /etc and /var
  474. ;; at runtime, we must prevent writing to them at installation
  475. ;; time.
  476. (lambda* (#:key make-flags #:allow-other-keys)
  477. (apply invoke "make" "install"
  478. "sysconfdir=/tmp/etc"
  479. "localstatedir=/tmp/var"
  480. make-flags))))))
  481. (inputs
  482. `(("libxml2" ,libxml2)
  483. ("eudev" ,eudev)
  484. ("libpciaccess" ,libpciaccess)
  485. ("gnutls" ,gnutls)
  486. ("dbus" ,dbus)
  487. ("libpcap" ,libpcap)
  488. ("libnl" ,libnl)
  489. ("libtirpc" ,libtirpc) ;for <rpc/rpc.h>
  490. ("libuuid" ,util-linux)
  491. ("lvm2" ,lvm2) ;for libdevmapper
  492. ("curl" ,curl)
  493. ("openssl" ,openssl)
  494. ("cyrus-sasl" ,cyrus-sasl)
  495. ("libyajl" ,libyajl)
  496. ("audit" ,audit)
  497. ("dmidecode" ,dmidecode)
  498. ("dnsmasq" ,dnsmasq)
  499. ("ebtables" ,ebtables)
  500. ("iproute" ,iproute)
  501. ("iptables" ,iptables)))
  502. (native-inputs
  503. `(("xsltproc" ,libxslt)
  504. ("perl" ,perl)
  505. ("pkg-config" ,pkg-config)
  506. ("polkit" ,polkit)
  507. ("python" ,python-wrapper)))
  508. (home-page "https://libvirt.org")
  509. (synopsis "Simple API for virtualization")
  510. (description "Libvirt is a C toolkit to interact with the virtualization
  511. capabilities of recent versions of Linux. The library aims at providing long
  512. term stable C API initially for the Xen paravirtualization but should be able
  513. to integrate other virtualization mechanisms if needed.")
  514. (license license:lgpl2.1+)))
  515. (define-public libvirt-glib
  516. (package
  517. (name "libvirt-glib")
  518. (version "3.0.0")
  519. (source (origin
  520. (method url-fetch)
  521. (uri (string-append "ftp://libvirt.org/libvirt/glib/"
  522. "libvirt-glib-" version ".tar.gz"))
  523. (sha256
  524. (base32
  525. "1zpbv4ninc57c9rw4zmmkvvqn7154iv1qfr20kyxn8xplalqrzvz"))))
  526. (build-system gnu-build-system)
  527. (inputs
  528. `(("openssl" ,openssl)
  529. ("cyrus-sasl" ,cyrus-sasl)
  530. ("lvm2" ,lvm2) ; for libdevmapper
  531. ("libyajl" ,libyajl)))
  532. (native-inputs
  533. `(("pkg-config" ,pkg-config)
  534. ("intltool" ,intltool)
  535. ("glib" ,glib "bin")
  536. ("vala" ,vala)))
  537. (propagated-inputs
  538. ;; ‘Required:’ by the installed .pc files.
  539. `(("glib" ,glib)
  540. ("libvirt" ,libvirt)
  541. ("libxml2" ,libxml2)
  542. ("gobject-introspection" ,gobject-introspection)))
  543. (home-page "https://libvirt.org")
  544. (synopsis "GLib wrapper around libvirt")
  545. (description "libvirt-glib wraps the libvirt library to provide a
  546. high-level object-oriented API better suited for glib-based applications, via
  547. three libraries:
  548. @enumerate
  549. @item libvirt-glib - GLib main loop integration & misc helper APIs
  550. @item libvirt-gconfig - GObjects for manipulating libvirt XML documents
  551. @item libvirt-gobject - GObjects for managing libvirt objects
  552. @end enumerate
  553. ")
  554. (license license:lgpl2.1+)))
  555. (define-public python-libvirt
  556. (package
  557. (name "python-libvirt")
  558. (version "5.8.0")
  559. (source
  560. (origin
  561. (method url-fetch)
  562. (uri (string-append "https://libvirt.org/sources/python/libvirt-python-"
  563. version ".tar.gz"))
  564. (sha256
  565. (base32 "0kyz3lx49d8p75mvbzinxc1zgs8g7adn77y9bm15b8b4ad9zl5s6"))))
  566. (build-system python-build-system)
  567. (arguments
  568. `(#:phases
  569. (modify-phases %standard-phases
  570. (add-after 'unpack 'patch-nosetests-path
  571. (lambda* (#:key inputs #:allow-other-keys)
  572. (substitute* "setup.py"
  573. (("\"/usr/bin/nosetests\"")
  574. (string-append "\"" (which "nosetests") "\""))
  575. (("self\\.spawn\\(\\[sys\\.executable, nose\\]\\)")
  576. (format #f "self.spawn([\"~a\", nose])" (which "bash"))))
  577. #t)))))
  578. (inputs
  579. `(("libvirt" ,libvirt)))
  580. (propagated-inputs
  581. `(("python-lxml" ,python-lxml)))
  582. (native-inputs
  583. `(("pkg-config" ,pkg-config)
  584. ("python-nose" ,python-nose)))
  585. (home-page "https://libvirt.org")
  586. (synopsis "Python bindings to libvirt")
  587. (description "This package provides Python bindings to the libvirt
  588. virtualization library.")
  589. (license license:lgpl2.1+)))
  590. (define-public python2-libvirt
  591. (package-with-python2 python-libvirt))
  592. (define-public virt-manager
  593. (package
  594. (name "virt-manager")
  595. (version "2.2.1")
  596. (source (origin
  597. (method url-fetch)
  598. (uri (string-append "https://virt-manager.org/download/sources"
  599. "/virt-manager/virt-manager-"
  600. version ".tar.gz"))
  601. (sha256
  602. (base32
  603. "06ws0agxlip6p6n3n43knsnjyd91gqhh2dadgc33wl9lx1k8vn6g"))))
  604. (build-system python-build-system)
  605. (arguments
  606. `(#:use-setuptools? #f ; uses custom distutils 'install' command
  607. ;; Some of the tests seem to require network access to install virtual
  608. ;; machines.
  609. #:tests? #f
  610. #:imported-modules ((guix build glib-or-gtk-build-system)
  611. ,@%python-build-system-modules)
  612. #:modules ((ice-9 match)
  613. (srfi srfi-26)
  614. (guix build python-build-system)
  615. ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
  616. (guix build utils))
  617. #:phases
  618. (modify-phases %standard-phases
  619. (add-after 'unpack 'fix-setup
  620. (lambda* (#:key outputs #:allow-other-keys)
  621. (substitute* "virtinst/buildconfig.py"
  622. (("/usr") (assoc-ref outputs "out")))
  623. #t))
  624. (add-after 'unpack 'fix-qemu-img-reference
  625. (lambda* (#:key inputs #:allow-other-keys)
  626. (substitute* "virtconv/formats.py"
  627. (("/usr(/bin/qemu-img)" _ suffix)
  628. (string-append (assoc-ref inputs "qemu") suffix)))
  629. #t))
  630. (add-after 'unpack 'fix-default-uri
  631. (lambda* (#:key inputs #:allow-other-keys)
  632. ;; Xen is not available for now - so only patch qemu.
  633. (substitute* "virtManager/createconn.py"
  634. (("/usr(/bin/qemu-system)" _ suffix)
  635. (string-append (assoc-ref inputs "qemu") suffix)))
  636. #t))
  637. (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH
  638. (lambda* (#:key inputs outputs #:allow-other-keys)
  639. (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
  640. (bin-files (find-files bin ".*"))
  641. (paths (map (match-lambda
  642. ((output . directory)
  643. (let* ((girepodir (string-append
  644. directory
  645. "/lib/girepository-1.0")))
  646. (if (file-exists? girepodir)
  647. girepodir #f))))
  648. inputs)))
  649. (for-each (lambda (file)
  650. (format #t "wrapping ~a\n" file)
  651. (wrap-program file
  652. `("GI_TYPELIB_PATH" ":" prefix
  653. ,(filter identity paths))))
  654. bin-files))
  655. #t))
  656. (add-after 'install 'glib-or-gtk-compile-schemas
  657. (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
  658. (add-after 'install 'glib-or-gtk-wrap
  659. (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
  660. (inputs
  661. `(("dconf" ,dconf)
  662. ("gtk+" ,gtk+)
  663. ("gtk-vnc" ,gtk-vnc)
  664. ("gtksourceview" ,gtksourceview)
  665. ("libvirt" ,libvirt)
  666. ("libvirt-glib" ,libvirt-glib)
  667. ("libosinfo" ,libosinfo)
  668. ("vte" ,vte)
  669. ("python-libvirt" ,python-libvirt)
  670. ("python-requests" ,python-requests)
  671. ("python-ipaddress" ,python-ipaddress)
  672. ("python-pycairo" ,python-pycairo)
  673. ("python-pygobject" ,python-pygobject)
  674. ("python-libxml2" ,python-libxml2)
  675. ("spice-gtk" ,spice-gtk)))
  676. ;; virt-manager searches for qemu-img or kvm-img in the PATH.
  677. (propagated-inputs
  678. `(("qemu" ,qemu)))
  679. (native-inputs
  680. `(("glib" ,glib "bin") ; glib-compile-schemas
  681. ("gobject-introspection" ,gobject-introspection)
  682. ("gtk+" ,gtk+ "bin") ; gtk-update-icon-cache
  683. ("perl" ,perl) ; pod2man
  684. ("intltool" ,intltool)))
  685. (home-page "https://virt-manager.org/")
  686. (synopsis "Manage virtual machines")
  687. (description
  688. "The virt-manager application is a desktop user interface for managing
  689. virtual machines through libvirt. It primarily targets KVM VMs, but also
  690. manages Xen and LXC (Linux containers). It presents a summary view of running
  691. domains, their live performance and resource utilization statistics.")
  692. (license license:gpl2+)))
  693. (define-public criu
  694. (package
  695. (name "criu")
  696. (version "3.13")
  697. (source (origin
  698. (method url-fetch)
  699. (uri (string-append "http://download.openvz.org/criu/criu-"
  700. version ".tar.bz2"))
  701. (sha256
  702. (base32
  703. "1yn9ix9lqvqvjrs3a3g6g1wqfniyf9n7giy0mr3jvijmrcm7y0pa"))))
  704. (build-system gnu-build-system)
  705. (arguments
  706. `(#:test-target "test"
  707. #:tests? #f ; tests require mounting as root
  708. #:make-flags
  709. (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
  710. (string-append "LIBDIR=" (assoc-ref %outputs "out")
  711. "/lib")
  712. (string-append "ASCIIDOC=" (assoc-ref %build-inputs "asciidoc")
  713. "/bin/asciidoc")
  714. (string-append "XMLTO=" (assoc-ref %build-inputs "xmlto")
  715. "/bin/xmlto"))
  716. #:phases
  717. (modify-phases %standard-phases
  718. (replace 'configure
  719. (lambda* (#:key inputs #:allow-other-keys)
  720. ;; The includes for libnl are located in a sub-directory.
  721. (setenv "C_INCLUDE_PATH"
  722. (string-append (assoc-ref inputs "libnl")
  723. "/include/libnl3:"
  724. ;; Also add the kernel headers here so that GCC
  725. ;; treats them as "system headers". Otherwise
  726. ;; the build fails with -Werror because parasite.c
  727. ;; includes both <linux/fs.h> and <sys/mount.h>,
  728. ;; which define some of the same constants.
  729. (assoc-ref inputs "kernel-headers")
  730. "/include"))
  731. #t))
  732. (add-after 'configure 'fix-documentation
  733. (lambda* (#:key inputs outputs #:allow-other-keys)
  734. (substitute* "Documentation/Makefile"
  735. (("-m custom.xsl")
  736. (string-append
  737. "-m custom.xsl --skip-validation -x "
  738. (assoc-ref inputs "docbook-xsl") "/xml/xsl/"
  739. ,(package-name docbook-xsl) "-"
  740. ,(package-version docbook-xsl)
  741. "/manpages/docbook.xsl")))
  742. #t))
  743. (add-after 'unpack 'hardcode-variables
  744. (lambda* (#:key inputs #:allow-other-keys)
  745. ;; Hardcode arm version detection
  746. (substitute* "Makefile"
  747. (("ARMV.*:=.*") "ARMV := 7\n"))
  748. ;; We are currently using python-2
  749. (substitute* "crit/Makefile"
  750. (("\\$\\(PYTHON\\)") "python2"))
  751. (substitute* "lib/Makefile"
  752. (("\\$\\(PYTHON\\)")
  753. (string-append (assoc-ref inputs "python")
  754. "/bin/python")))
  755. #t))
  756. (add-before 'build 'fix-symlink
  757. (lambda* (#:key inputs #:allow-other-keys)
  758. ;; The file 'images/google/protobuf/descriptor.proto' points to
  759. ;; /usr/include/..., which obviously does not exist.
  760. (let* ((file "google/protobuf/descriptor.proto")
  761. (target (string-append "images/" file))
  762. (source (string-append (assoc-ref inputs "protobuf")
  763. "/include/" file)))
  764. (delete-file target)
  765. (symlink source target)
  766. #t)))
  767. (add-after 'install 'wrap
  768. (lambda* (#:key inputs outputs #:allow-other-keys)
  769. ;; Make sure 'crit' runs with the correct PYTHONPATH.
  770. (let* ((out (assoc-ref outputs "out"))
  771. (path (string-append out
  772. "/lib/python"
  773. (string-take (string-take-right
  774. (assoc-ref inputs "python") 5) 3)
  775. "/site-packages:"
  776. (getenv "PYTHONPATH"))))
  777. (wrap-program (string-append out "/bin/crit")
  778. `("PYTHONPATH" ":" prefix (,path))))
  779. #t)))))
  780. (inputs
  781. `(("protobuf" ,protobuf)
  782. ("python" ,python-2)
  783. ("python2-protobuf" ,python2-protobuf)
  784. ("python2-ipaddr" ,python2-ipaddr)
  785. ("iproute" ,iproute)
  786. ("libaio" ,libaio)
  787. ("libcap" ,libcap)
  788. ("libnet" ,libnet)
  789. ("libnl" ,libnl)
  790. ("libbsd" ,libbsd)))
  791. (native-inputs
  792. `(("pkg-config" ,pkg-config)
  793. ("perl" ,perl)
  794. ("protobuf-c" ,protobuf-c)
  795. ("asciidoc" ,asciidoc)
  796. ("xmlto" ,xmlto)
  797. ("docbook-xml" ,docbook-xml)
  798. ("docbook-xsl" ,docbook-xsl)))
  799. (home-page "https://criu.org")
  800. (synopsis "Checkpoint and restore in user space")
  801. (description "Using this tool, you can freeze a running application (or
  802. part of it) and checkpoint it to a hard drive as a collection of files. You
  803. can then use the files to restore and run the application from the point it
  804. was frozen at. The distinctive feature of the CRIU project is that it is
  805. mainly implemented in user space.")
  806. ;; The project is licensed under GPLv2; files in the lib/ directory are
  807. ;; LGPLv2.1.
  808. (license (list license:gpl2 license:lgpl2.1))))
  809. (define-public qmpbackup
  810. (package
  811. (name "qmpbackup")
  812. (version "0.2")
  813. (source (origin
  814. (method git-fetch)
  815. (uri (git-reference
  816. (url "https://github.com/abbbi/qmpbackup.git")
  817. (commit version)))
  818. (file-name (git-file-name name version))
  819. (sha256
  820. (base32
  821. "0swhp5byz44brhyis1a39p11fyn9q84xz5q6v2fah29r7d71kmmx"))))
  822. (build-system python-build-system)
  823. (arguments
  824. `(#:python ,python-2))
  825. (home-page "https://github.com/abbbi/qmpbackup")
  826. (synopsis "Backup and restore QEMU machines")
  827. (description "qmpbackup is designed to create and restore full and
  828. incremental backups of running QEMU virtual machines via QMP, the QEMU
  829. Machine Protocol.")
  830. (license license:gpl3+)))
  831. (define-public looking-glass-client
  832. (let ((commit "182c4752d57690da7f99d5e788de9b8baea33895"))
  833. (package
  834. (name "looking-glass-client")
  835. (version (string-append "a12-" (string-take commit 7)))
  836. (source
  837. (origin
  838. (method git-fetch)
  839. (uri (git-reference (url "https://github.com/gnif/LookingGlass")
  840. (commit commit)))
  841. (file-name (git-file-name name version))
  842. (sha256
  843. (base32
  844. "02bq46ndmzq9cihazzn7xq1x7q5nzm7iw4l9lqzihxcxp9famkhw"))
  845. (modules '((guix build utils)))
  846. (snippet
  847. '(begin
  848. ;; Do not create binaries optimized for the CPU of the build machine,
  849. ;; for reproducibility and compatibility. TODO: in the next version
  850. ;; of looking glass, this is exposed as a CMake configure option.
  851. (substitute* "client/CMakeLists.txt"
  852. (("-march=native")
  853. ""))
  854. #t))))
  855. (build-system cmake-build-system)
  856. (inputs `(("fontconfig" ,fontconfig)
  857. ("glu" ,glu)
  858. ("mesa" ,mesa)
  859. ("openssl" ,openssl)
  860. ("sdl2" ,sdl2)
  861. ("sdl2-ttf" ,sdl2-ttf)
  862. ("spice-protocol" ,spice-protocol)
  863. ("wayland" ,wayland)))
  864. (native-inputs `(("libconfig" ,libconfig)
  865. ("nettle" ,nettle)
  866. ("pkg-config" ,pkg-config)))
  867. (arguments
  868. `(#:tests? #f ;; No tests are available.
  869. #:make-flags '("CC=gcc")
  870. #:phases (modify-phases %standard-phases
  871. (add-before 'configure 'chdir-to-client
  872. (lambda* (#:key outputs #:allow-other-keys)
  873. (chdir "client")
  874. #t))
  875. (add-after 'chdir-to-client 'add-missing-include
  876. (lambda _
  877. ;; Mimic upstream commit b9797529893, required since the
  878. ;; update to Mesa 19.2.
  879. (substitute* "renderers/egl/shader.h"
  880. (("#include <stdbool\\.h>")
  881. "#include <stdbool.h>\n#include <stddef.h>"))
  882. #t))
  883. (replace 'install
  884. (lambda* (#:key outputs #:allow-other-keys)
  885. (install-file "looking-glass-client"
  886. (string-append (assoc-ref outputs "out")
  887. "/bin"))
  888. #t)))))
  889. (home-page "https://looking-glass.hostfission.com")
  890. (synopsis "KVM Frame Relay (KVMFR) implementation")
  891. (description "Looking Glass allows the use of a KVM (Kernel-based Virtual
  892. Machine) configured for VGA PCI Pass-through without an attached physical
  893. monitor, keyboard or mouse. It displays the VM's rendered contents on your main
  894. monitor/GPU.")
  895. ;; This package requires SSE instructions.
  896. (supported-systems '("i686-linux" "x86_64-linux"))
  897. (license license:gpl2+))))
  898. (define-public lookingglass
  899. (deprecated-package "lookingglass" looking-glass-client))
  900. (define-public runc
  901. (package
  902. (name "runc")
  903. (version "1.0.0-rc6")
  904. (source (origin
  905. (method url-fetch)
  906. (uri (string-append
  907. "https://github.com/opencontainers/runc/releases/"
  908. "download/v" version "/runc.tar.xz"))
  909. (file-name (string-append name "-" version ".tar.xz"))
  910. (patches (search-patches "runc-CVE-2019-5736.patch"))
  911. (sha256
  912. (base32
  913. "1c7832dq70slkjh8qp2civ1wxhhdd2hrx84pq7db1mmqc9fdr3cc"))))
  914. (build-system go-build-system)
  915. (arguments
  916. '(#:import-path "github.com/opencontainers/runc"
  917. #:install-source? #f
  918. ;; XXX: 20/139 tests fail due to missing /var, cgroups and apparmor in
  919. ;; the build environment.
  920. #:tests? #f
  921. #:phases
  922. (modify-phases %standard-phases
  923. (replace 'unpack
  924. (lambda* (#:key source import-path #:allow-other-keys)
  925. ;; Unpack the tarball into 'runc' instead of 'runc-1.0.0-rc5'.
  926. (let ((dest (string-append "src/" import-path)))
  927. (mkdir-p dest)
  928. (invoke "tar" "-C" (string-append "src/" import-path)
  929. "--strip-components=1"
  930. "-xvf" source))))
  931. (replace 'build
  932. (lambda* (#:key import-path #:allow-other-keys)
  933. (chdir (string-append "src/" import-path))
  934. ;; XXX: requires 'go-md2man'.
  935. ;; (invoke "make" "man")
  936. (invoke "make")))
  937. ;; (replace 'check
  938. ;; (lambda _
  939. ;; (invoke "make" "localunittest")))
  940. (replace 'install
  941. (lambda* (#:key outputs #:allow-other-keys)
  942. (let ((out (assoc-ref outputs "out")))
  943. (invoke "make" "install" "install-bash"
  944. (string-append "PREFIX=" out))))))))
  945. (native-inputs
  946. `(("pkg-config" ,pkg-config)))
  947. (inputs
  948. `(("libseccomp" ,libseccomp)))
  949. (synopsis "Open container initiative runtime")
  950. (home-page "https://www.opencontainers.org/")
  951. (description
  952. "@command{runc} is a command line client for running applications
  953. packaged according to the
  954. @uref{https://github.com/opencontainers/runtime-spec/blob/master/spec.md, Open
  955. Container Initiative (OCI) format} and is a compliant implementation of the
  956. Open Container Initiative specification.")
  957. (license license:asl2.0)))
  958. (define-public umoci
  959. (package
  960. (name "umoci")
  961. (version "0.4.5")
  962. (source (origin
  963. (method url-fetch)
  964. (uri (string-append
  965. "https://github.com/openSUSE/umoci/releases/download/v"
  966. version "/umoci.tar.xz"))
  967. (file-name (string-append "umoci-" version ".tar.xz"))
  968. (sha256
  969. (base32
  970. "0x1yyvpllz6fyy9xip6f7b6c94v984n3faf8p50fr9y4ygkgi15a"))))
  971. (build-system go-build-system)
  972. (arguments
  973. '(#:import-path "github.com/openSUSE/umoci"
  974. #:install-source? #f
  975. #:phases
  976. (modify-phases %standard-phases
  977. (replace 'unpack
  978. (lambda* (#:key source import-path #:allow-other-keys)
  979. ;; Unpack the tarball into 'umoci' instead of "runc-${version}".
  980. (let ((dest (string-append "src/" import-path)))
  981. (mkdir-p dest)
  982. (invoke "tar" "-C" (string-append "src/" import-path)
  983. "--strip-components=1"
  984. "-xvf" source))))
  985. (replace 'build
  986. (lambda* (#:key import-path #:allow-other-keys)
  987. (chdir (string-append "src/" import-path))
  988. ;; TODO: build manpages with 'go-md2man'.
  989. (invoke "make" "SHELL=bash")))
  990. (replace 'install
  991. (lambda* (#:key outputs #:allow-other-keys)
  992. (let* ((out (assoc-ref outputs "out"))
  993. (bindir (string-append out "/bin")))
  994. (install-file "umoci" bindir)
  995. #t))))))
  996. (home-page "https://umo.ci/")
  997. (synopsis "Tool for modifying Open Container images")
  998. (description
  999. "@command{umoci} is a tool that allows for high-level modification of an
  1000. Open Container Initiative (OCI) image layout and its tagged images.")
  1001. (license license:asl2.0)))
  1002. (define-public skopeo
  1003. (package
  1004. (name "skopeo")
  1005. (version "0.1.40")
  1006. (source (origin
  1007. (method git-fetch)
  1008. (uri (git-reference
  1009. (url "https://github.com/projectatomic/skopeo")
  1010. (commit (string-append "v" version))))
  1011. (file-name (git-file-name name version))
  1012. (sha256
  1013. (base32
  1014. "1bagirzdzjhicn5dr691092ac3q6lhz3xngjzgqiqkxnvpz7p6cn"))))
  1015. (build-system go-build-system)
  1016. (native-inputs
  1017. `(("pkg-config" ,pkg-config)))
  1018. (inputs
  1019. `(("btrfs-progs" ,btrfs-progs)
  1020. ("eudev" ,eudev)
  1021. ("libassuan" ,libassuan)
  1022. ("libselinux" ,libselinux)
  1023. ("libostree" ,libostree)
  1024. ("lvm2" ,lvm2)
  1025. ("glib" ,glib)
  1026. ("gpgme" ,gpgme)))
  1027. (arguments
  1028. '(#:import-path "github.com/projectatomic/skopeo"
  1029. #:install-source? #f
  1030. #:tests? #f ; The tests require Docker
  1031. #:phases
  1032. (modify-phases %standard-phases
  1033. (replace 'build
  1034. (lambda* (#:key import-path #:allow-other-keys)
  1035. (chdir (string-append "src/" import-path))
  1036. ;; TODO: build manpages with 'go-md2man'.
  1037. (invoke "make" "binary-local")))
  1038. (replace 'install
  1039. (lambda* (#:key outputs #:allow-other-keys)
  1040. (let ((out (assoc-ref outputs "out")))
  1041. (invoke "make" "install-binary" "install-completions"
  1042. (string-append "PREFIX=" out))))))))
  1043. (home-page "https://github.com/projectatomic/skopeo")
  1044. (synopsis "Interact with container images and container image registries")
  1045. (description
  1046. "@command{skopeo} is a command line utility providing various operations
  1047. with container images and container image registries. It can:
  1048. @enumerate
  1049. @item Copy container images between various containers image stores,
  1050. converting them as necessary.
  1051. @item Convert a Docker schema 2 or schema 1 container image to an OCI image.
  1052. @item Inspect a repository on a container registry without needlessly pulling
  1053. the image.
  1054. @item Sign and verify container images.
  1055. @item Delete container images from a remote container registry.
  1056. @end enumerate")
  1057. (license license:asl2.0)))
  1058. (define-public python-vagrant
  1059. (package
  1060. (name "python-vagrant")
  1061. (version "0.5.15")
  1062. (source
  1063. (origin
  1064. (method url-fetch)
  1065. (uri (pypi-uri "python-vagrant" version))
  1066. (sha256
  1067. (base32
  1068. "1ikrh6canhcxg5y7pzmkcnnydikppv7s6sm9prfx90nk0ac8m6mg"))))
  1069. (build-system python-build-system)
  1070. (arguments
  1071. '(#:tests? #f)) ; tests involve running vagrant.
  1072. (home-page "https://github.com/todddeluca/python-vagrant")
  1073. (synopsis "Python bindings for Vagrant")
  1074. (description
  1075. "Python-vagrant is a Python module that provides a thin wrapper around the
  1076. @code{vagrant} command line executable, allowing programmatic control of Vagrant
  1077. virtual machines.")
  1078. (license license:expat)))
  1079. (define-public bubblewrap
  1080. (package
  1081. (name "bubblewrap")
  1082. (version "0.4.0")
  1083. (source (origin
  1084. (method url-fetch)
  1085. (uri (string-append "https://github.com/containers/bubblewrap/"
  1086. "releases/download/v" version "/bubblewrap-"
  1087. version ".tar.xz"))
  1088. (sha256
  1089. (base32
  1090. "08r0f4c3fjkb4zjrb4kkax1zfcgcgic702vb62sjjw5xfhppvzp5"))))
  1091. (build-system gnu-build-system)
  1092. (arguments
  1093. `(#:phases
  1094. (modify-phases %standard-phases
  1095. (add-after 'unpack 'fix-test
  1096. (lambda* (#:key outputs #:allow-other-keys)
  1097. ;; Tests try to access /var/tmp, which is not possible in our build
  1098. ;; environment. Let's give them another directory.
  1099. ;; /tmp gets overriden in some tests, so we need another directory.
  1100. ;; the only possibility is the output directory.
  1101. (let ((tmp-dir (string-append (assoc-ref outputs "out") "/tmp")))
  1102. (mkdir-p tmp-dir)
  1103. (substitute* "tests/test-run.sh"
  1104. (("/var/tmp") tmp-dir)
  1105. ;; Tests create a temporary python script, so fix its shebang.
  1106. (("/usr/bin/env python") (which "python"))
  1107. ;; Some tests try to access /usr, but that doesn't exist.
  1108. ;; Give them /gnu instead.
  1109. (("/usr") "/gnu")
  1110. (("--ro-bind /bin /bin") "--ro-bind /gnu /bin")
  1111. (("--ro-bind /sbin /sbin") "--ro-bind /gnu /sbin")
  1112. (("--ro-bind /lib /lib") "--ro-bind /gnu /lib")
  1113. ((" */bin/bash") (which "bash"))
  1114. (("/bin/sh") (which "sh"))
  1115. (("findmnt") (which "findmnt"))))
  1116. #t))
  1117. ;; Remove the directory we gave to tests to have a clean package.
  1118. (add-after 'check 'remove-tmp-dir
  1119. (lambda* (#:key outputs #:allow-other-keys)
  1120. (delete-file-recursively (string-append (assoc-ref outputs "out") "/tmp"))
  1121. #t)))))
  1122. (inputs
  1123. `(("libcap" ,libcap)))
  1124. (native-inputs
  1125. `(("python-2" ,python-2)
  1126. ("util-linux" ,util-linux)))
  1127. (home-page "https://github.com/containers/bubblewrap")
  1128. (synopsis "Unprivileged sandboxing tool")
  1129. (description "Bubblewrap is aimed at running applications in a sandbox,
  1130. restricting their access to parts of the operating system or user data such as
  1131. the home directory. Bubblewrap always creates a new mount namespace, and the
  1132. user can specify exactly what parts of the file system should be made visible
  1133. in the sandbox. These directories are mounted with the @code{nodev} option
  1134. by default and can be made read-only.")
  1135. (license license:lgpl2.0+)))
  1136. (define-public bochs
  1137. (package
  1138. (name "bochs")
  1139. (version "2.6.11")
  1140. (source
  1141. (origin
  1142. (method url-fetch)
  1143. (uri (string-append "https://sourceforge.net/projects/bochs/files/bochs/"
  1144. version "/bochs-" version ".tar.gz"))
  1145. (sha256
  1146. (base32 "0ql8q6y1k356li1g9gbvl21448mlxphxxi6kjb2b3pxvzd0pp2b3"))))
  1147. (build-system gnu-build-system)
  1148. (arguments
  1149. `(#:tests? #f)) ; no tests exist
  1150. (inputs
  1151. `(("libxrandr" ,libxrandr)))
  1152. (home-page "http://bochs.sourceforge.net/")
  1153. (synopsis "Emulator for x86 PC")
  1154. (description
  1155. "Bochs is an emulator which can emulate Intel x86 CPU, common I/O
  1156. devices, and a custom BIOS. It can also be compiled to emulate many different
  1157. x86 CPUs, from early 386 to the most recent x86-64 Intel and AMD processors.
  1158. Bochs can run most Operating Systems inside the emulation including Linux,
  1159. DOS or Microsoft Windows.")
  1160. (license license:lgpl2.0+)))
  1161. (define-public xen
  1162. (package
  1163. (name "xen")
  1164. (version "4.11.1")
  1165. (source (origin
  1166. (method git-fetch)
  1167. (uri (git-reference
  1168. (url "git://xenbits.xenproject.org/xen.git")
  1169. (commit (string-append "RELEASE-" version))))
  1170. (file-name (git-file-name name version))
  1171. (sha256
  1172. (base32
  1173. "1wv1hyfii14vi9lfjmnv07h2gpm3b7kvh2p55f4yy2b40simksgk"))))
  1174. (build-system gnu-build-system)
  1175. (arguments
  1176. `(#:configure-flags
  1177. (list "--enable-rpath"
  1178. "--disable-qemu-traditional" ; It tries to do "git clone"
  1179. "--disable-rombios" ; would try to "git clone" via etherboot.
  1180. ;; TODO: Re-enable stubdom (it's "more secure" to use it).
  1181. "--disable-stubdom" ; tries to "git clone" old patched newlib.
  1182. (string-append "--with-initddir="
  1183. (assoc-ref %outputs "out")
  1184. "/etc/init.d")
  1185. (string-append "--with-system-qemu="
  1186. (assoc-ref %build-inputs "qemu")
  1187. "/bin/qemu-system-i386")
  1188. (string-append "--with-system-seabios="
  1189. (assoc-ref %build-inputs "seabios")
  1190. "/share/firmware/bios.bin")
  1191. (string-append "--with-system-ovmf="
  1192. (assoc-ref %build-inputs "ovmf")
  1193. "/share/firmware/ovmf_ia32.bin"))
  1194. #:make-flags (list "-j" "1"
  1195. "XEN_BUILD_DATE=Thu Jan 1 01:00:01 CET 1970"
  1196. "XEN_BUILD_TIME=01:00:01"
  1197. "XEN_BUILD_HOST="
  1198. "ETHERBOOT_NICS="
  1199. "SMBIOS_REL_DATE=01/01/1970"
  1200. "VGABIOS_REL_DATE=01 Jan 1970"
  1201. ; QEMU_TRADITIONAL_LOC
  1202. ; QEMU_UPSTREAM_LOC
  1203. "SYSCONFIG_DIR=/tmp/etc/default"
  1204. (string-append "BASH_COMPLETION_DIR="
  1205. (assoc-ref %outputs "out")
  1206. "/etc/bash_completion.d")
  1207. (string-append "BOOT_DIR="
  1208. (assoc-ref %outputs "out")
  1209. "/boot")
  1210. (string-append "DEBUG_DIR="
  1211. (assoc-ref %outputs "out")
  1212. "/lib/debug")
  1213. (string-append "EFI_DIR="
  1214. (assoc-ref %outputs "out")
  1215. "/lib/efi") ; TODO lib64 ?
  1216. "MINIOS_UPSTREAM_URL="
  1217. ;(string-append "DISTDIR="
  1218. ; (assoc-ref %outputs "out"))
  1219. )
  1220. #:test-target "test"
  1221. #:phases
  1222. (modify-phases %standard-phases
  1223. (add-after 'unpack 'unpack-mini-os
  1224. (lambda* (#:key inputs #:allow-other-keys)
  1225. (copy-recursively (assoc-ref inputs "mini-os") "extras/mini-os")
  1226. #t))
  1227. (add-after 'unpack-mini-os 'patch
  1228. (lambda* (#:key inputs outputs #:allow-other-keys)
  1229. (substitute* "tools/firmware/Rules.mk"
  1230. (("override XEN_TARGET_ARCH = x86_32")
  1231. (string-append "override XEN_TARGET_ARCH = x86_32
  1232. override CC = " (assoc-ref inputs "cross-gcc") "/bin/i686-linux-gnu-gcc"))
  1233. (("^CFLAGS =$")
  1234. (string-append "CFLAGS=-I" (assoc-ref inputs "cross-libc")
  1235. "/include\n")))
  1236. (substitute* "config/x86_32.mk"
  1237. (("CFLAGS += -m32 -march=i686")
  1238. (string-append "CFLAGS += -march=i686 -I"
  1239. (assoc-ref inputs "cross-libc")
  1240. "/include")))
  1241. ;; /var is not in /gnu/store , so don't try to create it.
  1242. (substitute* '("tools/Makefile"
  1243. "tools/xenstore/Makefile"
  1244. "tools/xenpaging/Makefile")
  1245. (("\\$\\(INSTALL_DIR\\) .*XEN_(DUMP|LOG|RUN|LIB|PAGING)_DIR.*")
  1246. "\n")
  1247. (("\\$\\(INSTALL_DIR\\) .*XEN_(RUN|LIB)_STORED.*")
  1248. "\n"))
  1249. ;; Prevent xen from creating /etc .
  1250. (substitute* "tools/examples/Makefile"
  1251. ((" install-readmes") "")
  1252. ((" install-configs") ""))
  1253. ;; Set rpath.
  1254. (substitute* "tools/pygrub/setup.py"
  1255. (("library_dirs =")
  1256. ; TODO: extra_link_args = ['-Wl,-rpath=/opt/foo'],
  1257. (string-append "runtime_library_dirs = ['"
  1258. (assoc-ref outputs "out")
  1259. "/lib'],\nlibrary_dirs =")))
  1260. #t))
  1261. (add-before 'configure 'patch-xen-script-directory
  1262. (lambda* (#:key outputs #:allow-other-keys)
  1263. (substitute* '("configure"
  1264. "tools/configure"
  1265. "docs/configure")
  1266. (("XEN_SCRIPT_DIR=.*")
  1267. (string-append "XEN_SCRIPT_DIR="
  1268. (assoc-ref outputs "out")
  1269. "/etc/xen/scripts")))
  1270. #t))
  1271. (add-before 'configure 'set-environment-up
  1272. (lambda* (#:key make-flags #:allow-other-keys)
  1273. (define (cross? x)
  1274. (string-contains x "cross-i686-linux"))
  1275. (define (filter-environment! filter-predicate
  1276. environment-variable-names)
  1277. (for-each
  1278. (lambda (env-name)
  1279. (let* ((env-value (getenv env-name))
  1280. (search-path (search-path-as-string->list env-value))
  1281. (new-search-path (filter filter-predicate
  1282. search-path))
  1283. (new-env-value (list->search-path-as-string
  1284. new-search-path ":")))
  1285. (setenv env-name new-env-value)))
  1286. environment-variable-names))
  1287. (setenv "CROSS_C_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))
  1288. (setenv "CROSS_CPLUS_INCLUDE_PATH" (getenv "CPLUS_INCLUDE_PATH"))
  1289. (setenv "CROSS_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
  1290. (filter-environment! cross?
  1291. '("CROSS_C_INCLUDE_PATH" "CROSS_CPLUS_INCLUDE_PATH"
  1292. "CROSS_LIBRARY_PATH"))
  1293. (filter-environment! (lambda (e) (not (cross? e)))
  1294. '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH"
  1295. "LIBRARY_PATH"))
  1296. ;; Guix tries to be helpful and automatically adds
  1297. ;; mini-os-git-checkout/include to the include path,
  1298. ;; but actually we don't want it to be there (yet).
  1299. (filter-environment! (lambda (e)
  1300. (not
  1301. (string-contains e
  1302. "mini-os-git-checkout")))
  1303. '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH"
  1304. "LIBRARY_PATH"))
  1305. (setenv "EFI_VENDOR" "guix")
  1306. #t))
  1307. (replace 'build
  1308. (lambda* (#:key make-flags #:allow-other-keys)
  1309. (apply invoke "make" "world" make-flags))))))
  1310. (inputs
  1311. `(("acpica" ,acpica) ; TODO: patch iasl invocation.
  1312. ("bridge-utils" ,bridge-utils) ; TODO: patch invocations.
  1313. ("glib" ,glib)
  1314. ("iproute" ,iproute) ; TODO: patch invocations.
  1315. ("libaio" ,libaio)
  1316. ("libx11" ,libx11)
  1317. ("libyajl" ,libyajl)
  1318. ("ncurses" ,ncurses)
  1319. ("openssl" ,openssl)
  1320. ("ovmf" ,ovmf)
  1321. ("pixman" ,pixman)
  1322. ("qemu" ,qemu-minimal)
  1323. ("seabios" ,seabios)
  1324. ("util-linux" ,util-linux) ; uuid
  1325. ; TODO: ocaml-findlib, ocaml-nox.
  1326. ("xz" ,xz) ; for liblzma
  1327. ("zlib" ,zlib)))
  1328. (native-inputs
  1329. `(("dev86" ,dev86)
  1330. ("bison" ,bison)
  1331. ("cmake" ,cmake-minimal)
  1332. ("figlet" ,figlet)
  1333. ("flex" ,flex)
  1334. ("gettext" ,gettext-minimal)
  1335. ("libnl" ,libnl)
  1336. ("mini-os"
  1337. ,(origin
  1338. (method git-fetch)
  1339. (uri (git-reference
  1340. (url "http://xenbits.xen.org/git-http/mini-os.git")
  1341. (commit (string-append "xen-RELEASE-" version))))
  1342. (sha256
  1343. (base32
  1344. "1i8pcl19n60i2m9vlg79q3nknpj209c9ic5x10wxaicx45kc107f"))
  1345. (file-name "mini-os-git-checkout")))
  1346. ("perl" ,perl)
  1347. ; TODO: markdown
  1348. ("pkg-config" ,pkg-config)
  1349. ("python" ,python-2)
  1350. ("wget" ,wget)
  1351. ("cross-gcc" ,(cross-gcc "i686-linux-gnu"
  1352. #:xbinutils (cross-binutils "i686-linux-gnu")
  1353. #:libc (cross-libc "i686-linux-gnu")))
  1354. ("cross-libc" ,(cross-libc "i686-linux-gnu")) ; header files
  1355. ("cross-libc-static" ,(cross-libc "i686-linux-gnu") "static")))
  1356. (home-page "https://xenproject.org/")
  1357. (synopsis "Xen Virtual Machine Monitor")
  1358. (description "This package provides the Xen Virtual Machine Monitor
  1359. which is a hypervisor.")
  1360. ;; TODO: Some files are licensed differently. List those.
  1361. (license license:gpl2)
  1362. (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))))
  1363. (define-public osinfo-db-tools
  1364. (package
  1365. (name "osinfo-db-tools")
  1366. (version "1.7.0")
  1367. (source (origin
  1368. (method url-fetch)
  1369. (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-tools-"
  1370. version ".tar.xz"))
  1371. (sha256
  1372. (base32
  1373. "08x8mrafphyll0d35xdc143rip3ahrz6bmzhc85nwhq7yk2vxpab"))))
  1374. (build-system meson-build-system)
  1375. (inputs
  1376. `(("libsoup" ,libsoup)
  1377. ("libxml2" ,libxml2)
  1378. ("libxslt" ,libxslt)
  1379. ("json-glib" ,json-glib)
  1380. ("libarchive" ,libarchive)))
  1381. (native-inputs
  1382. `(("perl" ,perl)
  1383. ("gobject-introspection" ,gobject-introspection)
  1384. ("gettext" ,gettext-minimal)
  1385. ("pkg-config" ,pkg-config)
  1386. ;; Tests
  1387. ("python" ,python)
  1388. ("pytest" ,python-pytest)
  1389. ("requests" ,python-requests)))
  1390. (home-page "https://gitlab.com/libosinfo/osinfo-db-tools")
  1391. (synopsis "Tools for managing the osinfo database")
  1392. (description "This package contains a set of tools to assist
  1393. administrators and developers in managing the database.")
  1394. (license license:lgpl2.0+)))
  1395. (define-public osinfo-db
  1396. (package
  1397. (name "osinfo-db")
  1398. (version "20200203")
  1399. (source (origin
  1400. (method url-fetch)
  1401. (uri (string-append "https://releases.pagure.org/libosinfo/osinfo-db-"
  1402. version ".tar.xz"))
  1403. (sha256
  1404. (base32
  1405. "1zjq1dhlci00j17dij7s3l30hybzmaykpk5b6bd5xbllp745njn5"))))
  1406. (build-system trivial-build-system)
  1407. (arguments
  1408. `(#:modules ((guix build utils))
  1409. #:builder
  1410. (begin
  1411. (use-modules (guix build utils))
  1412. (let* ((out (assoc-ref %outputs "out"))
  1413. (osinfo-dir (string-append out "/share/osinfo"))
  1414. (source (assoc-ref %build-inputs "source"))
  1415. (osinfo-db-import
  1416. (string-append (assoc-ref %build-inputs "osinfo-db-tools")
  1417. "/bin/osinfo-db-import")))
  1418. (mkdir-p osinfo-dir)
  1419. (invoke osinfo-db-import "--dir" osinfo-dir source)
  1420. #t))))
  1421. (native-inputs
  1422. `(("intltool" ,intltool)
  1423. ("osinfo-db-tools" ,osinfo-db-tools)))
  1424. (home-page "https://gitlab.com/libosinfo/osinfo-db")
  1425. (synopsis "Database of information about operating systems")
  1426. (description "Osinfo-db provides the database files for use with the
  1427. libosinfo library. It provides information about guest operating systems for
  1428. use with virtualization provisioning tools")
  1429. (license license:lgpl2.0+)))