guix-commits
[Top][All Lists]
Advanced

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

03/05: gnu: python-testpath: Fix library location for python2 version.


From: Danny Milosavljevic
Subject: 03/05: gnu: python-testpath: Fix library location for python2 version.
Date: Mon, 6 Mar 2017 04:01:18 -0500 (EST)

dannym pushed a commit to branch master
in repository guix.

commit b320f7bf06213087886d4f7fb12baccbc399f3e3
Author: Thomas Danckaert <address@hidden>
Date:   Fri Feb 24 17:07:27 2017 +0100

    gnu: python-testpath: Fix library location for python2 version.
    
    * gnu/packages/python.scm (python-testpath)[arguments]: Install module in 
the proper
    "lib/pythonx.y" location for all Python versions.
    
    Signed-off-by: Danny Milosavljevic <address@hidden>
---
 gnu/packages/python.scm | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 181436e..3066c88 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -5183,20 +5183,26 @@ installing @code{kernelspec}s for use with Jupyter 
frontends.")
     (build-system python-build-system)
     (arguments
      `(#:tests? #f ; this package does not even have a setup.py
+       #:modules ((guix build python-build-system)
+                  (guix build utils)
+                  (srfi srfi-1))
+       #:imported-modules (,@%python-build-system-modules
+                           (srfi srfi-1))
        #:phases
        (modify-phases %standard-phases
          (delete 'install)
          (replace 'build
-                  (lambda* (#:key inputs outputs #:allow-other-keys)
-                    (let ((dir (string-append
-                                (assoc-ref outputs "out")
-                                "/lib/python"
-                                (string-take (string-take-right
-                                              (assoc-ref inputs "python") 5) 3)
-                                "/site-packages/testpath")))
-                      (mkdir-p dir)
-                      (copy-recursively "testpath" dir))
-                    #t)))))
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((version (last
+                              (string-split (assoc-ref inputs "python") #\-)))
+                    (x.y (string-join (take (string-split version #\.) 2)
+                                        "."))
+                    (dir (string-append
+                          (assoc-ref outputs "out")
+                          "/lib/python" x.y "/site-packages/testpath")))
+               (mkdir-p dir)
+               (copy-recursively "testpath" dir))
+             #t)))))
     (home-page "https://github.com/takluyver/testpath";)
     (synopsis "Test utilities for code working with files and commands")
     (description



reply via email to

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