guix-commits
[Top][All Lists]
Advanced

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

01/01: gnu: wrap-python3: Use a bash wrapper for 'python3-config'.


From: ???
Subject: 01/01: gnu: wrap-python3: Use a bash wrapper for 'python3-config'.
Date: Mon, 17 Oct 2016 10:57:58 +0000 (UTC)

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

commit 3969ca548c3230815242e95d07eee05d45b2947d
Author: 宋文武 <address@hidden>
Date:   Sun Oct 16 10:44:29 2016 +0800

    gnu: wrap-python3:  Use a bash wrapper for 'python3-config'.
    
    See <http://lists.gnu.org/archive/html/guix-devel/2016-07/msg00008.html>
    for details.
    
    * gnu/packages/python.scm (wrap-python3)[arguments]: Use a bash wrapper
    instead of a symlink for python3-config.
---
 gnu/packages/python.scm |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 032530c..e49d336 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -52,6 +52,7 @@
   #:use-module (gnu packages adns)
   #:use-module (gnu packages attr)
   #:use-module (gnu packages backup)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages django)
@@ -379,6 +380,7 @@ data types.")
     (source #f)
     (build-system trivial-build-system)
     (outputs '("out"))
+    (inputs `(("bash" ,bash)))
     (propagated-inputs `(("python" ,python)))
     (arguments
      `(#:modules ((guix build utils))
@@ -392,8 +394,20 @@ data types.")
                   (lambda (old new)
                     (symlink (string-append python old)
                              (string-append bin "/" new)))
-                  `("python3" ,"pydoc3" ,"idle3" ,"pip3" ,"python3-config")
-                  `("python"  ,"pydoc"  ,"idle"  ,"pip"  ,"python-config"))))))
+                  `("python3" ,"pydoc3" ,"idle3" ,"pip3")
+                  `("python"  ,"pydoc"  ,"idle"  ,"pip"))
+                ;; python-config outputs search paths based upon its location,
+                ;; use a bash wrapper to avoid changing its outputs.
+                (let ((bash (string-append (assoc-ref %build-inputs "bash")
+                                           "/bin/bash"))
+                      (old  (string-append python "python3-config"))
+                      (new  (string-append bin "/python-config")))
+                  (with-output-to-file new
+                    (lambda ()
+                      (format #t "#!~a~%" bash)
+                      (format #t "exec \"~a\" \"address@hidden"~%" old)
+                      (chmod new #o755)
+                      #t)))))))
     (synopsis "Wrapper for the Python 3 commands")
     (description
      "This package provides wrappers for the commands of address@hidden such



reply via email to

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