summaryrefslogtreecommitdiff
path: root/guix/import/pypi.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-02-14 19:05:45 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-02-14 19:05:45 +0100
commit7edafc884c2a21258541b17a231051702c458263 (patch)
treed4202c8d6516bacd32fa55ee23c54b069ef8abd6 /guix/import/pypi.scm
parent89da127035737bdf922bc566970c5506c2e01b00 (diff)
parent64fc4f3705423c83c680a95d8dea81a39fce9a70 (diff)
downloadguix-patches-7edafc884c2a21258541b17a231051702c458263.tar
guix-patches-7edafc884c2a21258541b17a231051702c458263.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/import/pypi.scm')
-rw-r--r--guix/import/pypi.scm34
1 files changed, 24 insertions, 10 deletions
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 354cae9c4c..6897f42be3 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -363,7 +364,11 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
(receive (guix-dependencies upstream-dependencies)
(compute-inputs source-url wheel-url temp)
(match guix-dependencies
- ((required-inputs test-inputs)
+ ((required-inputs native-inputs)
+ (when (string-suffix? ".zip" source-url)
+ (set! native-inputs (cons
+ '("unzip" ,unzip)
+ native-inputs)))
(values
`(package
(name ,(python->package-name name))
@@ -371,20 +376,29 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
(source
(origin
(method url-fetch)
- ;; PyPI URL are case sensitive, but sometimes a project
- ;; named using mixed case has a URL using lower case, so
- ;; we must work around this inconsistency. For actual
- ;; examples, compare the URLs of the "Deprecated" and
- ;; "uWSGI" PyPI packages.
- (uri ,(if (string-contains source-url name)
- `(pypi-uri ,name version)
- `(pypi-uri ,(string-downcase name) version)))
+ (uri (pypi-uri
+ ;; PyPI URL are case sensitive, but sometimes
+ ;; a project named using mixed case has a URL
+ ;; using lower case, so we must work around this
+ ;; inconsistency. For actual examples, compare
+ ;; the URLs of the "Deprecated" and "uWSGI" PyPI
+ ;; packages.
+ ,(if (string-contains source-url name)
+ name
+ (string-downcase name))
+ version
+ ;; Some packages have been released as `.zip`
+ ;; instead of the more common `.tar.gz`. For
+ ;; example, see "path-and-address".
+ ,@(if (string-suffix? ".zip" source-url)
+ '(".zip")
+ '())))
(sha256
(base32
,(guix-hash-url temp)))))
(build-system python-build-system)
,@(maybe-inputs required-inputs 'propagated-inputs)
- ,@(maybe-inputs test-inputs 'native-inputs)
+ ,@(maybe-inputs native-inputs 'native-inputs)
(home-page ,home-page)
(synopsis ,synopsis)
(description ,description)