summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorAndreas Enge <andreas@enge.fr>2013-09-03 21:27:40 +0200
committerAndreas Enge <andreas@enge.fr>2013-09-03 21:27:40 +0200
commit898238b9f5199aaebffa508f62a2a00854370048 (patch)
treec9e9ff486737314cae54e619bc800dc7cefce0d4 /gnu
parentb24d1cfc85cba1024d7396f3ad625c5fc3cf926b (diff)
downloadguix-898238b9f5199aaebffa508f62a2a00854370048.tar.gz
gnu: python: Add package python-wrapper.
* gnu/packages/python.scm (python-wrapper): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/python.scm28
1 files changed, 27 insertions, 1 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 0a3977aabb..33082a6d94 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -29,7 +29,8 @@
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
-  #:use-module (guix build-system python))
+  #:use-module (guix build-system python)
+  #:use-module (guix build-system trivial))
 
 (define-public python-2
   (package
@@ -167,6 +168,31 @@ data types.")
             (variable "PYTHONPATH")
             (directories '("lib/python3.3/site-packages")))))))
 
+(define-public python-wrapper
+  (package (inherit python)
+    (name "python-wrapper")
+    (source #f)
+    (build-system trivial-build-system)
+    (inputs `(("python" ,python)))
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+         (begin
+           (use-modules (guix build utils))
+           (let ((bin (string-append (assoc-ref %outputs "out") "/bin"))
+                 (python (string-append (assoc-ref %build-inputs "python") "/bin/")))
+                (mkdir-p bin)
+                (for-each
+                  (lambda (old new)
+                    (symlink (string-append python old)
+                             (string-append bin "/" new)))
+                  `("python3", "pydoc3", "idle3")
+                  `("python",  "pydoc",  "idle"))))))
+    (description (string-append (package-description python)
+     "\n\nThis wrapper package provides symbolic links to the python binaries
+      without version suffix."))))
+
+
 (define-public pytz
   (package
     (name "pytz")