guix-commits
[Top][All Lists]
Advanced

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

02/02: build-system/python: Export 'python-version'.


From: guix-commits
Subject: 02/02: build-system/python: Export 'python-version'.
Date: Fri, 21 Jun 2019 12:20:28 -0400 (EDT)

civodul pushed a commit to branch core-updates
in repository guix.

commit 9c2563a80b6f1d8fb8677f5314e6180ea9916aa5
Author: Ludovic Courtès <address@hidden>
Date:   Fri Jun 21 18:11:25 2019 +0200

    build-system/python: Export 'python-version'.
    
    * guix/build/python-build-system.scm (get-python-version): Rename to...
    (python-version): ... this.  Update callers.  Make public.
    * gnu/packages/gstreamer.scm (python-gst)[arguments]: Adjust accordingly.
    * gnu/packages/machine-learning.scm (ghmm)[arguments]: Likewise.
    * gnu/packages/openldap.scm (389-ds-base)[arguments]: Import (guix
    build python-build-system).  Use 'python-version'.
    * gnu/packages/package-management.scm (conda)[arguments]: Use
    'python-version'.
---
 gnu/packages/gstreamer.scm          |  4 +---
 gnu/packages/machine-learning.scm   |  3 +--
 gnu/packages/openldap.scm           | 13 +++++--------
 gnu/packages/package-management.scm |  3 +--
 guix/build/python-build-system.scm  | 11 ++++++-----
 5 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm
index 2a818e0..39a4eb5 100644
--- a/gnu/packages/gstreamer.scm
+++ b/gnu/packages/gstreamer.scm
@@ -447,9 +447,7 @@ compression formats through the use of the libav library.")
                            (guix build python-build-system))
        #:configure-flags
        (let* ((python (assoc-ref %build-inputs "python"))
-              (python-version ((@@ (guix build python-build-system)
-                                   get-python-version)
-                               python))
+              (python-version (python-version python))
               (python-sitedir (string-append
                                "lib/python" python-version "/site-packages")))
          (list (string-append
diff --git a/gnu/packages/machine-learning.scm 
b/gnu/packages/machine-learning.scm
index ba7772f..e216b94 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -210,8 +210,7 @@ classification.")
              (assoc-ref %standard-phases 'check))
            (add-before 'check 'fix-PYTHONPATH
              (lambda* (#:key inputs outputs #:allow-other-keys)
-               (let ((python-version ((@@ (guix build python-build-system)
-                                           get-python-version)
+               (let ((python-version (python-version
                                       (assoc-ref inputs "python"))))
                  (setenv "PYTHONPATH"
                          (string-append (getenv "PYTHONPATH")
diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm
index 43f111c..2f80920 100644
--- a/gnu/packages/openldap.scm
+++ b/gnu/packages/openldap.scm
@@ -211,7 +211,11 @@ servers from Python programs.")
     (arguments
      `(#:modules ((srfi srfi-1)
                   (guix build gnu-build-system)
+                  ((guix build python-build-system)
+                   #:select (python-version))
                   (guix build utils))
+       #:imported-modules ((guix build python-build-system)
+                           ,@%gnu-build-system-modules)
        #:configure-flags
        (list (string-append "--with-db="
                             (assoc-ref %build-inputs "bdb"))
@@ -263,16 +267,9 @@ servers from Python programs.")
          (add-after 'unpack 'fix-install-location-of-python-tools
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
-                    (get-python-version
-                     ;; FIXME: copied from python-build-system
-                     (lambda (python)
-                       (let* ((version     (last (string-split python #\-)))
-                              (components  (string-split version #\.))
-                              (major+minor (take components 2)))
-                         (string-join major+minor "."))))
                     (pythondir (string-append
                                 out "/lib/python"
-                                (get-python-version (assoc-ref inputs 
"python"))
+                                (python-version (assoc-ref inputs "python"))
                                 "/site-packages/")))
                ;; Install directory must be on PYTHONPATH.
                (setenv "PYTHONPATH"
diff --git a/gnu/packages/package-management.scm 
b/gnu/packages/package-management.scm
index e1e7d6a..81b3c32 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -831,8 +831,7 @@ This package provides Conda as a library.")
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (let* ((out (assoc-ref outputs "out"))
                       (target (string-append out "/lib/python"
-                                             ((@@ (guix build 
python-build-system)
-                                                  get-python-version)
+                                             (python-version
                                               (assoc-ref inputs "python"))
                                              "/site-packages/")))
                  ;; The installer aborts if the target directory is not on
diff --git a/guix/build/python-build-system.scm 
b/guix/build/python-build-system.scm
index 7c00306..09bd846 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2015, 2016, 2018 Ludovic Courtès <address@hidden>
+;;; Copyright © 2013, 2015, 2016, 2018, 2019 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2013 Andreas Enge <address@hidden>
 ;;; Copyright © 2013 Nikita Karetnikov <address@hidden>
 ;;; Copyright © 2015, 2018 Mark H Weaver <address@hidden>
@@ -32,6 +32,7 @@
   #:export (%standard-phases
             add-installed-pythonpath
             site-packages
+            python-version
             python-build))
 
 ;; Commentary:
@@ -147,7 +148,7 @@
       (format #t "test suite not run~%"))
   #t)
 
-(define (get-python-version python)
+(define (python-version python)
   (let* ((version     (last (string-split python #\-)))
          (components  (string-split version #\.))
          (major+minor (take components 2)))
@@ -158,7 +159,7 @@
   (let* ((out (assoc-ref outputs "out"))
          (python (assoc-ref inputs "python")))
     (string-append out "/lib/python"
-                   (get-python-version python)
+                   (python-version python)
                    "/site-packages/")))
 
 (define (add-installed-pythonpath inputs outputs)
@@ -202,7 +203,7 @@ when running checks after installing the package."
          (python (assoc-ref inputs "python"))
          (var `("PYTHONPATH" prefix
                 ,(cons (string-append out "/lib/python"
-                                      (get-python-version python)
+                                      (python-version python)
                                       "/site-packages")
                        (search-path-as-string->list
                         (or (getenv "PYTHONPATH") ""))))))
@@ -222,7 +223,7 @@ installed with setuptools."
   (let* ((out (assoc-ref outputs "out"))
          (python (assoc-ref inputs "python"))
          (site-packages (string-append out "/lib/python"
-                                       (get-python-version python)
+                                       (python-version python)
                                        "/site-packages"))
          (easy-install-pth (string-append site-packages "/easy-install.pth"))
          (new-pth (string-append site-packages "/" name ".pth")))



reply via email to

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