[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/04: import: cpan: Load (gnu packages perl) lazily.

From: Ludovic Courtès
Subject: 03/04: import: cpan: Load (gnu packages perl) lazily.
Date: Tue, 10 Oct 2017 17:12:19 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 90eaa9419ae65d0efc34393b9e1bde3a422ec723
Author: Ludovic Courtès <address@hidden>
Date:   Tue Oct 10 11:13:28 2017 +0200

    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'.
 guix/import/cpan.scm | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index 01acc6f..6261e3e 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -38,7 +38,6 @@
   #:use-module (guix packages)
   #:use-module (guix upstream)
   #:use-module (guix derivations)
-  #:use-module (gnu packages perl)
   #:export (cpan->guix-package
@@ -133,21 +132,28 @@ or #f on failure.  MODULE should be e.g. \"Test::Script\""
      (number->string 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
     (let* ((perl (with-store store
-                    (package-derivation store perl))))
+                    (package-derivation store (perl-package)))))
            (core (string-append perl "/bin/corelist")))
       (and (access? core X_OK)
 (define core-module?
-  (let ((perl-version (package-version perl))
-        (rx (make-regexp
+  (let ((rx (make-regexp
              (string-append "released with perl v?([0-9\\.]*)"
                             "(.*and removed from v?([0-9\\.]*))?"))))
     (lambda (name)
+      (define perl-version
+        (package-version (perl-package)))
       (define (version-between? lower version upper)
         (and (version>=? version lower)
              (or (not upper)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]