From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyril Roelandt Subject: [PATCH 02/12] guix: Add a "pypi-uri" helper method. Date: Mon, 12 Oct 2015 23:40:58 +0200 Message-ID: <1444686068-7668-3-git-send-email-tipecaml@gmail.com> References: <1444686068-7668-1-git-send-email-tipecaml@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlkqQ-0003ZA-2n for guix-devel@gnu.org; Mon, 12 Oct 2015 17:41:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlkqO-0006xF-G6 for guix-devel@gnu.org; Mon, 12 Oct 2015 17:41:22 -0400 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:33985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlkqO-0006wm-9d for guix-devel@gnu.org; Mon, 12 Oct 2015 17:41:20 -0400 Received: by wicgb1 with SMTP id gb1so65628940wic.1 for ; Mon, 12 Oct 2015 14:41:19 -0700 (PDT) In-Reply-To: <1444686068-7668-1-git-send-email-tipecaml@gmail.com> 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 * guix/download.scm (mirrors): New "pypi" mirror. * guix/build-system/python.scm (pypi-uri): New method. --- guix/build-system/python.scm | 10 +++++++++- guix/download.scm | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm index e9fffcc..01525f4 100644 --- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm @@ -31,7 +31,8 @@ #:export (%python-build-system-modules package-with-python2 python-build - python-build-system)) + python-build-system + pypi-uri)) ;; Commentary: ;; @@ -40,6 +41,13 @@ ;; ;; Code: +(define (pypi-uri name version) + "Return a URI string for the Python package hosted on the Python Package +Index (PyPI) corresponding to NAME and VERSION." + (string-append "mirror://pypi/packages/source/" + (string-take name 1) "/" name "/" + name "-" version ".tar.gz")) + (define %python-build-system-modules ;; Build-side modules imported by default. `((guix build python-build-system) diff --git a/guix/download.scm b/guix/download.scm index 8ec47ce..53b28be 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -200,7 +200,9 @@ (debian "http://ftp.de.debian.org/debian/" "http://ftp.fr.debian.org/debian/" - "http://ftp.debian.org/debian/")))) + "http://ftp.debian.org/debian/") + (pypi + "https://pypi.python.org/")))) (define %mirror-file ;; Copy of the list of mirrors to a file. This allows us to keep a single -- 2.1.4