From mboxrd@z Thu Jan 1 00:00:00 1970 From: swedebugia@riseup.net Subject: Re: [PATCH] guix pypi importer: Add ending as an optional argument to pypi-uri. Date: Sun, 03 Jan 2016 22:53:47 +0100 Message-ID: <799c3ce9640d27cd7e6e471801e06f04@riseup.net> References: <1451856997-13507-1-git-send-email-swedebugia@riseup.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFqb5-0006Q8-Ch for guix-devel@gnu.org; Sun, 03 Jan 2016 16:53:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFqb4-0007BI-Bm for guix-devel@gnu.org; Sun, 03 Jan 2016 16:53:55 -0500 In-Reply-To: <1451856997-13507-1-git-send-email-swedebugia@riseup.net> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org Cc: guix-devel-bounces+swedebugia=riseup.net@gnu.org 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))))