guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

47/163: gnu: ceph: Wrap with the new Guix PYTHONPATH.


From: guix-commits
Subject: 47/163: gnu: ceph: Wrap with the new Guix PYTHONPATH.
Date: Mon, 25 Jan 2021 02:01:27 -0500 (EST)

apteryx pushed a commit to branch cu/farewell-to-pythonpath
in repository guix.

commit 778ff2976117bebcb9336b233723f3ab2140a8e9
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Fri Jan 22 23:39:40 2021 -0500

    gnu: ceph: Wrap with the new Guix PYTHONPATH.
    
    * gnu/packages/storage.scm (ceph): Delete trailing #t.
    [phases]{set-install-environment}: Streamline.
    {wrap-python-scripts}: Use the new Guix PYTHONPATH.
---
 gnu/packages/storage.scm | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/storage.scm b/gnu/packages/storage.scm
index d53327d..61dc435 100644
--- a/gnu/packages/storage.scm
+++ b/gnu/packages/storage.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -82,11 +83,15 @@
                               "src/rapidjson"
                               "src/spdk"
                               "src/rocksdb"
-                              "src/boost"))
-                  #t))))
+                              "src/boost"))))))
     (build-system cmake-build-system)
     (arguments
      `(#:configure-flags
+       #:imported-modules ,(cons '(guix build python-build-system)
+                                 %cmake-build-system-modules)
+       #:modules ((guix build cmake-build-system)
+                  ((guix build python-build-system) #:select (guix-pythonpath))
+                  (guix build utils))
        (let* ((out (assoc-ref %outputs "out"))
               (lib (assoc-ref %outputs "lib"))
               (libdir (string-append lib "/lib")))
@@ -159,22 +164,14 @@
                   (string-append out "/bin/ceph-rbdnamer")))
                #t)))
          (add-before 'install 'set-install-environment
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (py3sitedir
-                     (string-append out "/lib/python"
-                                    ,(version-major+minor
-                                      (package-version python))
-                                    "/site-packages")))
-               ;; The Python install scripts refuses to function if
-               ;; the install directory is not on PYTHONPATH.
-               (setenv "PYTHONPATH"
-                       (string-append py3sitedir ":"
-                                      (getenv "PYTHONPATH")))
-               #t)))
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; The Python install scripts refuses to function if
+             ;; the install directory is not on PYTHONPATH.
+             (setenv "PYTHONPATH" (site-packages inputs outputs))))
          (add-after 'install 'wrap-python-scripts
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
+                    (pythonpath (guix-pythonpath inputs))
                     (scripts '("ceph" "ceph-mgr" "ceph-volume"))
                     (prettytable (assoc-ref inputs "python-prettytable"))
                     (six (assoc-ref inputs "python-six"))
@@ -190,9 +187,8 @@
                                  (sitedir prettytable))))
                (for-each (lambda (executable)
                            (wrap-program (string-append out "/bin/" executable)
-                             `("PYTHONPATH" ":" prefix (,PYTHONPATH))))
-                         scripts)
-               #t))))))
+                             `(,pythonpath ":" prefix (,PYTHONPATH))))
+                         scripts)))))))
     (outputs
      '("out" "lib"))
     (native-inputs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]