guix-commits
[Top][All Lists]
Advanced

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

07/163: build/python: Adjust wrap phase to use the new GUIX_PYTHONPATH.


From: guix-commits
Subject: 07/163: build/python: Adjust wrap phase to use the new GUIX_PYTHONPATH.
Date: Mon, 25 Jan 2021 02:01:15 -0500 (EST)

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

commit b46f35785bb03b8da7983fb8ced0f4f46c9a524c
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Fri Jan 22 11:08:57 2021 -0500

    build/python: Adjust wrap phase to use the new GUIX_PYTHONPATH.
    
    * guix/build/python-build-system.scm (wrap): Adjust to use the new computed
    Guix-specific PYTHONPATH.  Remove trailing #t.
---
 guix/build/python-build-system.scm | 40 +++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/guix/build/python-build-system.scm 
b/guix/build/python-build-system.scm
index 19bd3c9..7fef0b2 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -229,28 +229,28 @@ useful when running checks after installing the package."
     #t))
 
 (define* (wrap #:key inputs outputs #:allow-other-keys)
-  (define (list-of-files dir)
-    (find-files dir (lambda (file stat)
-                      (and (eq? 'regular (stat:type stat))
-                           (not (wrapper? file))))))
+  (let ((pythonpath (guix-pythonpath inputs)))
+    (define (list-of-files dir)
+      (find-files dir (lambda (file stat)
+                        (and (eq? 'regular (stat:type stat))
+                             (not (wrapper? file))))))
 
-  (define bindirs
-    (append-map (match-lambda
-                 ((_ . dir)
-                  (list (string-append dir "/bin")
-                        (string-append dir "/sbin"))))
-                outputs))
+    (define bindirs
+      (append-map (match-lambda
+                    ((_ . dir)
+                     (list (string-append dir "/bin")
+                           (string-append dir "/sbin"))))
+                  outputs))
 
-  (let* ((var `("PYTHONPATH" prefix
-                ,(cons (site-packages inputs outputs)
-                       (search-path-as-string->list
-                        (or (getenv "PYTHONPATH") ""))))))
-    (for-each (lambda (dir)
-                (let ((files (list-of-files dir)))
-                  (for-each (cut wrap-program <> var)
-                            files)))
-              bindirs)
-    #t))
+    (let* ((var (list pythonpath 'prefix
+                      (cons (site-packages inputs outputs)
+                            (search-path-as-string->list
+                             (or (getenv pythonpath) ""))))))
+      (for-each (lambda (dir)
+                  (let ((files (list-of-files dir)))
+                    (for-each (cut wrap-program <> var)
+                              files)))
+                bindirs))))
 
 (define* (rename-pth-file #:key name inputs outputs #:allow-other-keys)
   "Rename easy-install.pth to NAME.pth to avoid conflicts between packages



reply via email to

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