summary refs log tree commit diff
path: root/gnu/packages/virtualization.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/virtualization.scm')
-rw-r--r--gnu/packages/virtualization.scm119
1 files changed, 39 insertions, 80 deletions
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 34700211d9..f769596331 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2016, 2017, 2018. 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2018. 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2017 Andy Patterson <ajpatter@uwaterloo.ca>
@@ -247,7 +247,7 @@
          ;; Configure, build and install QEMU user-emulation static binaries.
          (add-after 'configure 'configure-user-static
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((gcc (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
+             (let* ((gcc (search-input-file inputs "/bin/gcc"))
                     (static (assoc-ref outputs "static"))
                     ;; This is the common set of configure flags; it is
                     ;; duplicated here to isolate this phase from manipulations
@@ -333,8 +333,7 @@ exec smbd $@")))
                      ("perl" ,perl)
                      ("flex" ,flex)
                      ("bison" ,bison)
-                     ;; Using meson 0.57.1 enables reproducible QEMU builds.
-                     ("meson" ,meson-next)
+                     ("meson" ,meson)
                      ("ninja" ,ninja)
                      ("pkg-config" ,pkg-config)
                      ("python-wrapper" ,python-wrapper)
@@ -342,7 +341,7 @@ exec smbd $@")))
                      ("texinfo" ,texinfo)
                      ;; The following static libraries are required to build
                      ;; the static output of QEMU.
-                     ("glib-static" ,glib-static)
+                     ("glib:static" ,glib "static")
                      ("pcre:static" ,pcre "static")
                      ("zlib:static" ,zlib "static")))
     (home-page "https://www.qemu.org")
@@ -448,8 +447,7 @@ server and embedded PowerPC, and S390 guests.")
                                        "ganeti-drbd-compat.patch"
                                        "ganeti-os-disk-size.patch"
                                        "ganeti-haskell-pythondir.patch"
-                                       "ganeti-disable-version-symlinks.patch"
-                                       "ganeti-preserve-PYTHONPATH.patch"))))
+                                       "ganeti-disable-version-symlinks.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:imported-modules (,@%gnu-build-system-modules
@@ -457,7 +455,6 @@ server and embedded PowerPC, and S390 guests.")
                            (guix build python-build-system))
        #:modules (,@%gnu-build-system-modules
                   ((guix build haskell-build-system) #:prefix haskell:)
-                  ((guix build python-build-system) #:select (python-version))
                   (ice-9 rdelim))
 
        ;; The default test target includes a lot of checks that are only really
@@ -504,8 +501,7 @@ server and embedded PowerPC, and S390 guests.")
              (unless (file-exists? "vcs-version")
                (call-with-output-file "vcs-version"
                  (lambda (port)
-                   (format port "v~a~%" ,version))))
-             #t))
+                   (format port "v~a~%" ,version))))))
          (add-after 'unpack 'patch-absolute-file-names
            (lambda _
              (substitute* '("lib/utils/process.py"
@@ -531,8 +527,7 @@ server and embedded PowerPC, and S390 guests.")
                (("ndisc6") (which "ndisc6"))
                (("fping") (which "fping"))
                (("grep") (which "grep"))
-               (("ip addr") (string-append (which "ip") " addr")))
-             #t))
+               (("ip addr") (string-append (which "ip") " addr")))))
          (add-after 'unpack 'override-builtin-PATH
            (lambda _
              ;; Ganeti runs OS install scripts and similar with a built-in
@@ -540,8 +535,7 @@ server and embedded PowerPC, and S390 guests.")
              (substitute* "src/Ganeti/Constants.hs"
                (("/sbin:/bin:/usr/sbin:/usr/bin")
                 "/run/setuid-programs:/run/current-system/profile/sbin:\
-/run/current-system/profile/bin"))
-             #t))
+/run/current-system/profile/bin"))))
          (add-after 'bootstrap 'patch-sphinx-version-detection
            (lambda _
              ;; The build system runs 'sphinx-build --version' to verify that
@@ -549,8 +543,8 @@ server and embedded PowerPC, and S390 guests.")
              ;; .sphinx-build-real executable name created by the Sphinx wrapper.
              (substitute* "configure"
                (("\\$SPHINX --version 2>&1")
-                "$SPHINX --version 2>&1 | sed 's/.sphinx-build-real/sphinx-build/g'"))
-             #t))
+                "$SPHINX --version 2>&1 \
+| sed 's/.sphinx-build-real/sphinx-build/g'"))))
 
          ;; The build system invokes Cabal and GHC, which do not work with
          ;; GHC_PACKAGE_PATH: <https://github.com/haskell/cabal/issues/3728>.
@@ -564,13 +558,11 @@ server and embedded PowerPC, and S390 guests.")
                (("\\$\\(CABAL\\)")
                 "$(CABAL) --package-db=../package.conf.d")
                (("\\$\\(GHC\\)")
-                "$(GHC) -package-db=../package.conf.d"))
-             #t))
+                "$(GHC) -package-db=../package.conf.d"))))
          (add-after 'configure 'make-ghc-use-shared-libraries
            (lambda _
              (substitute* "Makefile"
-               (("HFLAGS =") "HFLAGS = -dynamic -fPIC"))
-             #t))
+               (("HFLAGS =") "HFLAGS = -dynamic -fPIC"))))
          (add-after 'configure 'fix-installation-directories
            (lambda _
              (substitute* "Makefile"
@@ -580,8 +572,7 @@ server and embedded PowerPC, and S390 guests.")
                ;; Similarly, do not attempt to install the sample ifup scripts
                ;; to /etc/ganeti.
                (("\\$\\(DESTDIR\\)\\$\\(ifupdir\\)")
-                "$(DESTDIR)${prefix}$(ifupdir)"))
-             #t))
+                "$(DESTDIR)${prefix}$(ifupdir)"))))
          (add-before 'build 'adjust-tests
            (lambda _
              ;; Disable tests that can not run.  Do it early to prevent
@@ -600,36 +591,14 @@ server and embedded PowerPC, and S390 guests.")
                 "")
                ;; This test requires networking.
                (("test/py/import-export_unittest\\.bash")
-                ""))
-
-             ;; Many of the Makefile targets reset PYTHONPATH before running
-             ;; the Python interpreter, which does not work very well for us.
-             (substitute* "Makefile"
-               (("PYTHONPATH=")
-                (string-append "PYTHONPATH=" (getenv "PYTHONPATH") ":")))
-             #t))
+                ""))))
          (add-after 'build 'build-bash-completions
            (lambda _
-             (let ((orig-pythonpath (getenv "PYTHONPATH")))
-               (setenv "PYTHONPATH" (string-append ".:" orig-pythonpath))
-               (invoke "./autotools/build-bash-completion")
-               (setenv "PYTHONPATH" orig-pythonpath)
-               #t)))
+             (invoke "python" "-m" "./autotools/build-bash-completion")))
          (add-before 'check 'pre-check
            (lambda* (#:key inputs #:allow-other-keys)
              ;; Set TZDIR so that time zones are found.
-             (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
-                                            "/share/zoneinfo"))
-
-             ;; This test checks whether PYTHONPATH is untouched, and extends
-             ;; it to include test directories if so.  Add an else branch for
-             ;; our modified PYTHONPATH, in order to prevent a confusing test
-             ;; failure where expired certificates are not cleaned because
-             ;; check-cert-expired is silently crashing.
-             (substitute* "test/py/ganeti-cleaner_unittest.bash"
-               (("then export PYTHONPATH=(.*)" all testpath)
-                (string-append all "else export PYTHONPATH="
-                               (getenv "PYTHONPATH") ":" testpath "\n")))
+             (setenv "TZDIR" (search-input-directory inputs "share/zoneinfo"))
 
              (substitute* "test/py/ganeti.utils.process_unittest.py"
                ;; This test attempts to run an executable with
@@ -652,8 +621,7 @@ server and embedded PowerPC, and S390 guests.")
                (for-each (lambda (file)
                            (symlink "../../src/htools" file))
                          '("hspace" "hscan" "hinfo" "hbal" "hroller"
-                           "hcheck" "hail" "hsqueeze")))
-             #t))
+                           "hcheck" "hail" "hsqueeze")))))
          (add-after 'install 'install-bash-completions
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
@@ -682,21 +650,15 @@ server and embedded PowerPC, and S390 guests.")
                                       (cons (basename (car (reverse (string-split
                                                                      line #\ ))))
                                             progs))
-                                (loop (read-line port) progs))))))))
-               #t)))
-         ;; Wrap all executables with PYTHONPATH.  We can't borrow the phase
-         ;; from python-build-system because we also need to wrap the scripts
-         ;; in $out/lib/ganeti such as "node-daemon-setup".
+                                (loop (read-line port) progs)))))))))))
+         ;; Wrap all executables with GUIX_PYTHONPATH.  We can't borrow
+         ;; the phase from python-build-system because we also need to wrap
+         ;; the scripts in $out/lib/ganeti such as "node-daemon-setup".
          (add-after 'install 'wrap
-           (lambda* (#:key inputs outputs #:allow-other-keys)
+           (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (sbin (string-append out "/sbin"))
-                    (lib (string-append out "/lib"))
-                    (python (assoc-ref inputs "python"))
-                    (major+minor (python-version python))
-                    (PYTHONPATH (string-append lib "/python" major+minor
-                                               "/site-packages:"
-                                               (getenv "PYTHONPATH"))))
+                    (lib (string-append out "/lib")))
                (define (shell-script? file)
                  (call-with-ascii-input-file file
                    (lambda (port)
@@ -717,11 +679,11 @@ server and embedded PowerPC, and S390 guests.")
 
                (for-each (lambda (file)
                            (wrap-program file
-                             `("PYTHONPATH" ":" prefix (,PYTHONPATH))))
+                             `("GUIX_PYTHONPATH" ":" prefix
+                               (,(getenv "GUIX_PYTHONPATH")))))
                          (filter wrap?
                                  (append (find-files (string-append lib "/ganeti"))
-                                         (find-files sbin))))
-               #t))))))
+                                         (find-files sbin))))))))))
     (native-inputs
      `(("haskell" ,ghc)
        ("cabal" ,cabal-install)
@@ -1101,7 +1063,6 @@ It started as a side project of LXC but can be used by any run-time.")
              (string-append "-Dinstall_prefix=" (assoc-ref %outputs "out"))
              "--sysconfdir=/etc"
              "--localstatedir=/var")
-       #:meson ,meson-0.55
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'skip-directory-confusion
@@ -1278,8 +1239,8 @@ virtualization library.")
            (lambda* (#:key inputs #:allow-other-keys)
              ;; Xen is not available for now - so only patch qemu.
              (substitute* "virtManager/createconn.py"
-               (("/usr(/bin/qemu-system)" _ suffix)
-                (string-append (assoc-ref inputs "qemu") suffix)))
+               (("/usr(/bin/qemu-system-[a-zA-Z0-9_-]+)" _ suffix)
+                (search-input-file inputs suffix)))
              #t))
          (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH
            (lambda* (#:key inputs outputs #:allow-other-keys)
@@ -1313,7 +1274,7 @@ virtualization library.")
              #t))
          (add-after 'install 'glib-or-gtk-compile-schemas
            (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
-         (add-after 'install 'glib-or-gtk-wrap
+         (add-after 'wrap 'glib-or-gtk-wrap
            (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
     (inputs
      `(("dconf" ,dconf)
@@ -1386,10 +1347,9 @@ domains, their live performance and resource utilization statistics.")
            (lambda* (#:key inputs #:allow-other-keys)
              ;; The includes for libnl are located in a sub-directory.
              (setenv "C_INCLUDE_PATH"
-                     (string-append (assoc-ref inputs "libnl")
-                                    "/include/libnl3:"
-                                    (or (getenv "C_INCLUDE_PATH") "")))
-             #t))
+                     (string-append
+                      (search-input-directory inputs "/include/libnl3")
+                      ":" (or (getenv "C_INCLUDE_PATH") "")))))
          (add-after 'configure 'fix-documentation
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (substitute* "Documentation/Makefile"
@@ -1411,17 +1371,16 @@ domains, their live performance and resource utilization statistics.")
                (("\\$\\(PYTHON\\)") "python2"))
              (substitute* "lib/Makefile"
                (("\\$\\(PYTHON\\)")
-                (string-append (assoc-ref inputs "python")
-                               "/bin/python")))
-             #t))
+                (search-input-file inputs "/bin/python")))))
          (add-before 'build 'fix-symlink
            (lambda* (#:key inputs #:allow-other-keys)
              ;; The file 'images/google/protobuf/descriptor.proto' points to
              ;; /usr/include/..., which obviously does not exist.
              (let* ((file "google/protobuf/descriptor.proto")
                     (target (string-append "images/" file))
-                    (source (string-append (assoc-ref inputs "protobuf")
-                                           "/include/" file)))
+                    (source (search-input-file
+                             inputs
+                             (string-append "include/" file))))
                (delete-file target)
                (symlink source target)
                #t)))
@@ -1434,9 +1393,9 @@ domains, their live performance and resource utilization statistics.")
                                          (string-take (string-take-right
                                                        (assoc-ref inputs "python") 5) 3)
                                          "/site-packages:"
-                                         (getenv "PYTHONPATH"))))
+                                         (or (getenv "GUIX_PYTHONPATH") ""))))
                (wrap-program (string-append out "/bin/crit")
-                 `("PYTHONPATH" ":" prefix (,path))))
+                 `("GUIX_PYTHONPATH" ":" prefix (,path))))
              #t)))))
     (inputs
      `(("protobuf" ,protobuf)