From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Woodcroft Subject: [PATCH 1/3] build-system/python: Add pypi-origin. Date: Sat, 18 Jun 2016 08:33:30 +1000 Message-ID: <1466202812-18604-2-git-send-email-donttrustben@gmail.com> References: <87oa8v2q7x.fsf@gnu.org> <1466202812-18604-1-git-send-email-donttrustben@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE2Ks-0005su-7I for guix-devel@gnu.org; Fri, 17 Jun 2016 18:34:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bE2Kr-0008Cm-8r for guix-devel@gnu.org; Fri, 17 Jun 2016 18:33:58 -0400 In-Reply-To: <1466202812-18604-1-git-send-email-donttrustben@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" To: ludo@gnu.org, guix-devel@gnu.org * guix/build-system/python.scm (pypi-origin): New macro. --- guix/build-system/python.scm | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm index c3d6c62..c40fd03 100644 --- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2013 Nikita Karetnikov +;;; Copyright © 2016 Ben Woodcroft ;;; ;;; This file is part of GNU Guix. ;;; @@ -35,7 +36,8 @@ strip-python2-variant python-build python-build-system - pypi-uri)) + pypi-uri + pypi-origin)) ;; Commentary: ;; @@ -52,6 +54,25 @@ extension, such as '.tar.gz'." (string-take name 1) "/" name "/" name "-" version extension)) +(define-syntax-rule + (pypi-origin name version extension blake2 sha256-string ...) + (origin + (method url-fetch) + (uri (string-append + "https://pypi.python.org/packages/" + (substring blake2 0 2) + "/" + (substring blake2 2 4) + "/" + (substring blake2 4) + "/" + name + "-" + version + extension)) + (sha256 (base32 sha256-string)) + ...)) + (define %python-build-system-modules ;; Build-side modules imported by default. `((guix build python-build-system) -- 2.7.4