guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] guix pypi importer: Add ending as an optional argument to py


From: swedebugia
Subject: Re: [PATCH] guix pypi importer: Add ending as an optional argument to pypi-uri.
Date: Sun, 03 Jan 2016 22:53:47 +0100
User-agent: Riseup mail

On 2016-01-03 22:36, swedebugia wrote:
---
 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)

Was this an acceptable output of git send-email?
I have yet to test this patch, but it compiled fine.

Those interested can test the code with this unfinished package-def:

(define-public python-twisted
(package
  (name "python-twisted")
  (version "15.5.0")
  (source
    (origin
      (method url-fetch)
      (ending "tar.bz2")
      (uri (pypi-uri "Twisted" version ending))
      (sha256
        (base32
         "0zy18lcrris4aaslil5k12i13k56c32hzfdv6h10kbnzl026h158")
        ))
  (build-system python-build-system)
  (inputs
    `(("python-setuptools" ,python-setuptools)))
  (home-page "http://twistedmatrix.com/";)
  (synopsis
    "Asynchronous networking framework written in Python")
  (description
"Asynchronous networking framework written in Python which implements a
wide range of popular network protocols.")
  (license license:expat))))




reply via email to

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