[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/4] import: cpan: Sort inputs, use mirror url, adjust licenses.
From: |
Eric Bavier |
Subject: |
[PATCH 4/4] import: cpan: Sort inputs, use mirror url, adjust licenses. |
Date: |
Thu, 12 Feb 2015 09:58:15 -0600 |
* guix/import/cpan.scm (string->license): Add artistic2.0. Use
'(package-license perl) for "perl_5" as in our convention.
(cpan-module->sexp)[convert-inputs]: Sort returned list of inputs.
[source-url]: Substitute cpan mirror url.
---
guix/import/cpan.scm | 35 +++++++++++++++++++++--------------
1 file changed, 21 insertions(+), 14 deletions(-)
diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index c1b0006..3dc6eda 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -49,7 +49,7 @@
;; apache_1_1
("apache_2_0" 'asl2.0)
;; artistic_1_0
- ;; artistic_2_0
+ ("artistic_2_0" 'artistic2.0)
("bsd" 'bsd-3)
("freebsd" 'bsd-2)
;; gfdl_1_2
@@ -63,7 +63,7 @@
;; mozilla_1_0
("mozilla_1_1" 'mpl1.1)
("openssl" 'openssl)
- ("perl_5" 'gpl1+) ;and Artistic 1
+ ("perl_5" '(package-license perl)) ;GPL1+ and Artistic 1
("qpl_1_0" 'qpl)
;; ssleay
;; sun
@@ -141,17 +141,22 @@ META."
(#f
'())
((inputs ...)
- (delete-duplicates
- ;; Listed dependencies may include core modules. Filter those out.
- (filter-map (match-lambda
- (("perl" . _) ;implicit dependency
- #f)
- ((module . _)
- (and (not (core-module? module))
- (let ((name (guix-name (module->dist-name module))))
- (list name
- (list 'unquote (string->symbol name)))))))
- inputs)))))
+ (sort
+ (delete-duplicates
+ ;; Listed dependencies may include core modules. Filter those out.
+ (filter-map (match-lambda
+ (("perl" . _) ;implicit dependency
+ #f)
+ ((module . _)
+ (and (not (core-module? module))
+ (let ((name (guix-name (module->dist-name
module))))
+ (list name
+ (list 'unquote (string->symbol name)))))))
+ inputs))
+ (lambda args
+ (match args
+ (((a _ ...) (b _ ...))
+ (string<? a b))))))))
(define (maybe-inputs guix-name inputs)
(match inputs
@@ -162,7 +167,9 @@ META."
(list 'quasiquote inputs))))))
(define source-url
- (assoc-ref meta "download_url"))
+ (regexp-substitute/global #f "http://cpan.metacpan.org"
+ (assoc-ref meta "download_url")
+ 'pre "mirror://cpan" 'post))
(let ((tarball (with-store store
(download-to-store store source-url))))
--
1.7.9.5