[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] build-system/python: Add pypi-origin.
From: |
Ben Woodcroft |
Subject: |
[PATCH 1/3] build-system/python: Add pypi-origin. |
Date: |
Sat, 18 Jun 2016 08:33:30 +1000 |
* 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 <address@hidden>
;;; Copyright © 2013 Andreas Enge <address@hidden>
;;; Copyright © 2013 Nikita Karetnikov <address@hidden>
+;;; Copyright © 2016 Ben Woodcroft <address@hidden>
;;;
;;; 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