import: cpan: Load (gnu packages perl) lazily.
* guix/import/cpan.scm: Remove dependency on (gnu packages perl). (perl-package): New procedure. (%corelist, core-module?): Use it instead of referring to 'perl'.
This commit is contained in:
parent
b719ddbbbb
commit
90eaa9419a
|
@ -38,7 +38,6 @@
|
||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
#:use-module (guix upstream)
|
#:use-module (guix upstream)
|
||||||
#:use-module (guix derivations)
|
#:use-module (guix derivations)
|
||||||
#:use-module (gnu packages perl)
|
|
||||||
#:export (cpan->guix-package
|
#:export (cpan->guix-package
|
||||||
%cpan-updater))
|
%cpan-updater))
|
||||||
|
|
||||||
|
@ -133,21 +132,28 @@ or #f on failure. MODULE should be e.g. \"Test::Script\""
|
||||||
(number->string version))
|
(number->string version))
|
||||||
(version version)))
|
(version version)))
|
||||||
|
|
||||||
|
(define (perl-package)
|
||||||
|
"Return the 'perl' package. This is a lazy reference so that we don't
|
||||||
|
depend on (gnu packages perl)."
|
||||||
|
(module-ref (resolve-interface '(gnu packages perl)) 'perl))
|
||||||
|
|
||||||
(define %corelist
|
(define %corelist
|
||||||
(delay
|
(delay
|
||||||
(let* ((perl (with-store store
|
(let* ((perl (with-store store
|
||||||
(derivation->output-path
|
(derivation->output-path
|
||||||
(package-derivation store perl))))
|
(package-derivation store (perl-package)))))
|
||||||
(core (string-append perl "/bin/corelist")))
|
(core (string-append perl "/bin/corelist")))
|
||||||
(and (access? core X_OK)
|
(and (access? core X_OK)
|
||||||
core))))
|
core))))
|
||||||
|
|
||||||
(define core-module?
|
(define core-module?
|
||||||
(let ((perl-version (package-version perl))
|
(let ((rx (make-regexp
|
||||||
(rx (make-regexp
|
|
||||||
(string-append "released with perl v?([0-9\\.]*)"
|
(string-append "released with perl v?([0-9\\.]*)"
|
||||||
"(.*and removed from v?([0-9\\.]*))?"))))
|
"(.*and removed from v?([0-9\\.]*))?"))))
|
||||||
(lambda (name)
|
(lambda (name)
|
||||||
|
(define perl-version
|
||||||
|
(package-version (perl-package)))
|
||||||
|
|
||||||
(define (version-between? lower version upper)
|
(define (version-between? lower version upper)
|
||||||
(and (version>=? version lower)
|
(and (version>=? version lower)
|
||||||
(or (not upper)
|
(or (not upper)
|
||||||
|
|
Loading…
Reference in New Issue