guix-devel
[Top][All Lists]
Advanced

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

[PATCH] guix pypi importer: Add ending as an optional argument to pypi-u


From: swedebugia
Subject: [PATCH] guix pypi importer: Add ending as an optional argument to pypi-uri.
Date: Sun, 3 Jan 2016 22:36:37 +0100

---
 guix/build-system/python.scm | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm
index 2532210..09074ce 100644
--- a/guix/build-system/python.scm
+++ b/guix/build-system/python.scm
@@ -41,13 +41,20 @@
 ;;
 ;; Code:
 
-(define (pypi-uri name version)
+(define* (pypi-uri name version
+                  #:optional
+                  ending)
   "Return a URI string for the Python package hosted on the Python Package
-Index (PyPI) corresponding to NAME and VERSION."
-  (string-append "https://pypi.python.org/packages/source/";
+Index (PyPI) corresponding to NAME, VERSION and optionally ENDING."
+  (when (null? ending)
+      (string-append "https://pypi.python.org/packages/source/";
                  (string-take name 1) "/" name "/"
-                 name "-" version ".tar.gz"))
-
+                 name "-" version ".tar.gz")
+  ;; Ending is set -> use it.
+      (string-append "https://pypi.python.org/packages/source/";
+                 (string-take name 1) "/" name "/"
+                 name "-" version "." ending)))
+   
 (define %python-build-system-modules
   ;; Build-side modules imported by default.
   `((guix build python-build-system)
-- 
2.6.3




reply via email to

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