import: cpan: Move core-module? to top-level.
* guix/import/cpan.scm (cpan-module->sexp): Move local core-module? procedure to ... (core-module?): ... here.master
parent
63773200d7
commit
d391ad57d6
|
@ -116,23 +116,7 @@ if the original's domain was metacpan."
|
||||||
(and (access? core X_OK)
|
(and (access? core X_OK)
|
||||||
core))))
|
core))))
|
||||||
|
|
||||||
(define (cpan-module->sexp meta)
|
(define core-module?
|
||||||
"Return the `package' s-expression for a CPAN module from the metadata in
|
|
||||||
META."
|
|
||||||
(define name
|
|
||||||
(assoc-ref meta "distribution"))
|
|
||||||
|
|
||||||
(define (guix-name name)
|
|
||||||
(if (string-prefix? "perl-" name)
|
|
||||||
(string-downcase name)
|
|
||||||
(string-append "perl-" (string-downcase name))))
|
|
||||||
|
|
||||||
(define version
|
|
||||||
(match (assoc-ref meta "version")
|
|
||||||
((? number? vrs) (number->string vrs))
|
|
||||||
((? string? vrs) vrs)))
|
|
||||||
|
|
||||||
(define core-module?
|
|
||||||
(let ((perl-version (package-version perl))
|
(let ((perl-version (package-version perl))
|
||||||
(rx (make-regexp
|
(rx (make-regexp
|
||||||
(string-append "released with perl v?([0-9\\.]*)"
|
(string-append "released with perl v?([0-9\\.]*)"
|
||||||
|
@ -157,6 +141,22 @@ META."
|
||||||
first perl-version last))))
|
first perl-version last))))
|
||||||
(loop)))))))))))
|
(loop)))))))))))
|
||||||
|
|
||||||
|
(define (cpan-module->sexp meta)
|
||||||
|
"Return the `package' s-expression for a CPAN module from the metadata in
|
||||||
|
META."
|
||||||
|
(define name
|
||||||
|
(assoc-ref meta "distribution"))
|
||||||
|
|
||||||
|
(define (guix-name name)
|
||||||
|
(if (string-prefix? "perl-" name)
|
||||||
|
(string-downcase name)
|
||||||
|
(string-append "perl-" (string-downcase name))))
|
||||||
|
|
||||||
|
(define version
|
||||||
|
(match (assoc-ref meta "version")
|
||||||
|
((? number? vrs) (number->string vrs))
|
||||||
|
((? string? vrs) vrs)))
|
||||||
|
|
||||||
(define (convert-inputs phases)
|
(define (convert-inputs phases)
|
||||||
;; Convert phase dependencies into a list of name/variable pairs.
|
;; Convert phase dependencies into a list of name/variable pairs.
|
||||||
(match (flatten
|
(match (flatten
|
||||||
|
|
Loading…
Reference in New Issue