unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ben Woodcroft <donttrustben@gmail.com>
To: ludo@gnu.org, guix-devel@gnu.org
Subject: [PATCH 1/3] build-system/python: Add pypi-origin.
Date: Sat, 18 Jun 2016 08:33:30 +1000	[thread overview]
Message-ID: <1466202812-18604-2-git-send-email-donttrustben@gmail.com> (raw)
In-Reply-To: <1466202812-18604-1-git-send-email-donttrustben@gmail.com>

* 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 <ludo@gnu.org>
 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
+;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
 ;;;
 ;;; 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

  reply	other threads:[~2016-06-17 22:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-24  7:27 pypi URL change Ben Woodcroft
2016-04-24 22:26 ` Cyril Roelandt
2016-04-24 23:21   ` Ben Woodcroft
2016-04-25  0:13     ` Cyril Roelandt
2016-04-25  1:44       ` Ben Woodcroft
2016-04-25  7:54       ` Ludovic Courtès
2016-04-26 11:46         ` Ben Woodcroft
2016-04-27 12:25           ` Ludovic Courtès
2016-06-17 22:33             ` Ben Woodcroft
2016-06-17 22:33               ` Ben Woodcroft [this message]
2016-06-17 22:33               ` [PATCH 2/3] gnu: Add python-screed Ben Woodcroft
2016-06-25 17:44                 ` Leo Famulari
2016-06-17 22:33               ` [PATCH 3/3] not a real patch Ben Woodcroft

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466202812-18604-2-git-send-email-donttrustben@gmail.com \
    --to=donttrustben@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).