From 89e46f83c2a39a63326bb4faedf36fb678c03a03 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 18 Oct 2022 12:45:56 +0200 Subject: [PATCH 3/3] import/cran: Allow overriding tarball download. X-Debbugs-Cc: zimon.toutoune@gmail.com X-Debbugs-Cc: dev@jpoiret.xyz X-Debbugs-Cc: mail@cbaines.net X-Debbugs-Cc: rekado@elephly.net X-Debbugs-Cc: othacehe@gnu.org X-Debbugs-Cc: ludo@gnu.org * guix/import/cran.scm (%download-source): New parameter. (description->package): Use it. --- guix/import/cran.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 05374b5317..2a12963532 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -57,6 +57,7 @@ (define-module (guix import cran) #:export (%input-style %license-prefix %fetch-description + %download-source cran->guix-package bioconductor->guix-package @@ -265,6 +266,9 @@ (define download ;; of the URLs is the /Archive CRAN URL. (any (cut download-to-store store <>) urls))))))))) +(define %download-source + (make-parameter download)) + (define (fetch-description-from-tarball url) "Fetch the tarball at URL, extra its 'DESCRIPTION' file, parse it, and return the resulting alist." @@ -547,10 +551,10 @@ (define (description->package repository meta) (_ #f))))) (git? (if (assoc-ref meta 'git) #true #false)) (hg? (if (assoc-ref meta 'hg) #true #false)) - (source (download source-url #:method (cond - (git? 'git) - (hg? 'hg) - (else #f)))) + (source ((%download-source) source-url #:method (cond + (git? 'git) + (hg? 'hg) + (else #f)))) (sysdepends (append (if (needs-zlib? source (not (or git? hg?))) '("zlib") '()) (filter (lambda (name) -- 2.37.3