From unknown Fri Jun 20 05:33:22 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#45288 <45288@debbugs.gnu.org> To: bug#45288 <45288@debbugs.gnu.org> Subject: Status: [PATCH] import/cran: Add input style "specification". Reply-To: bug#45288 <45288@debbugs.gnu.org> Date: Fri, 20 Jun 2025 12:33:22 +0000 retitle 45288 [PATCH] import/cran: Add input style "specification". reassign 45288 guix-patches submitter 45288 Ricardo Wurmus severity 45288 normal tag 45288 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 17 04:43:14 2020 Received: (at submit) by debbugs.gnu.org; 17 Dec 2020 09:43:14 +0000 Received: from localhost ([127.0.0.1]:34690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kppoX-0006en-LR for submit@debbugs.gnu.org; Thu, 17 Dec 2020 04:43:14 -0500 Received: from lists.gnu.org ([209.51.188.17]:46826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kppoV-0006ef-CN for submit@debbugs.gnu.org; Thu, 17 Dec 2020 04:43:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kppoT-0007DH-6k for guix-patches@gnu.org; Thu, 17 Dec 2020 04:43:10 -0500 Received: from sender4-of-o50.zoho.com ([136.143.188.50]:21026) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kppoH-0008W9-Bb for guix-patches@gnu.org; Thu, 17 Dec 2020 04:43:08 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1608198172; cv=none; d=zohomail.com; s=zohoarc; b=ZqWMARFR3odeCDcUdsOqF64whJg+6FJAaGchj32cXfnxDHT4IxB/QzYRt4q/Nvy8q6Ek/T5lNEcK6L1yR2kZ5KK2FxwfeciWzgUtOz5kVF1CPp60U2s7iKSaCy5YExGoY8zEM1vdsuJ3RUpfV44iuxF/3rwJrFEwlCkKvxPvGPw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608198172; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=i99VfSvUvqTngw3o18mim8TYk3mghwX+8U+GSXxaW2c=; b=BSoqXQErkcOFJ4Ll+NCR6ab2SNZcZGSHlchVE4twep9pDyeQ/jpjA/qgHTwO3l3mgqE+uiVFTVYm6HHyZXzsMHeN/OOA3hDl5UiKci9pv/QiJ8mGVbC4Qt/0TaxJn7qrv7h/kp/R/HjceeuUkXzy4H/wy6OvTgjDnQzzwAwdyzI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1608198172; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:To:Cc:Message-ID:Subject:Date:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=i99VfSvUvqTngw3o18mim8TYk3mghwX+8U+GSXxaW2c=; b=OrxGk0W0kJecJR2q7bi2g1AI+J+ulWcGel/xYe22uvt2xb6ojqDzv7V6MXeZojqI S4ZnFDNWqE3VdLoM546TuWYMnNz1uKQPrV7mQw5VvsshD4wZLbSbuYCDu+APfg1f+cZ NOMOPrQs59WuVae2yEN/GIFtuMCUqfCUMHlRmD7s= Received: from localhost (p54ad49eb.dip0.t-ipconnect.de [84.173.73.235]) by mx.zohomail.com with SMTPS id 1608198170803454.5269365682092; Thu, 17 Dec 2020 01:42:50 -0800 (PST) From: Ricardo Wurmus To: guix-patches@gnu.org Message-ID: <20201217094245.10300-1-rekado@elephly.net> Subject: [PATCH] import/cran: Add input style "specification". Date: Thu, 17 Dec 2020 10:42:45 +0100 X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset=utf8 Received-SPF: pass client-ip=136.143.188.50; envelope-from=rekado@elephly.net; helo=sender4-of-o50.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * guix/import/cran.scm (%input-style): New parameter. (format-inputs): Use it. * guix/scripts/import/cran.scm (guix-import-cran): Set the %input-style parameter. (%options): Add "--style" option. * doc/guix.texi (Invoking guix import): Document it. --- doc/guix.texi | 7 ++++++ guix/import/cran.scm | 13 +++++++++-- guix/scripts/import/cran.scm | 45 ++++++++++++++++++++---------------- 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 392baf5910..74cd86be37 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11009,6 +11009,13 @@ When @option{--recursive} is added, the importer w= ill traverse the dependency graph of the given upstream package recursively and generate package expressions for all those packages that are not yet in Guix. =20 +When @option{--style=3Dspecification} is added, the importer will generate +package definitions whose inputs are package specifications instead of +references to package variables. This is useful when generated package +definitions are to be appended to existing user modules, as the list of +used package modules need not be changed. The default is +@option{--style=3Dvariable}. + When @option{--archive=3Dbioconductor} is added, metadata is imported from @uref{https://www.bioconductor.org/, Bioconductor}, a repository of R packages for the analysis and comprehension of high-throughput diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 9d38be7a1e..fd44d80915 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -51,7 +51,9 @@ #:use-module (guix upstream) #:use-module (guix packages) #:use-module (gnu packages) - #:export (cran->guix-package + #:export (%input-style + + cran->guix-package bioconductor->guix-package cran-recursive-import %cran-updater @@ -74,6 +76,9 @@ ;;; ;;; Code: =20 +(define %input-style + (make-parameter 'variable)) ; or 'specification + (define string->license (match-lambda ("AGPL-3" 'agpl3+) @@ -128,7 +133,11 @@ (define (format-inputs names) "Generate a sorted list of package inputs from a list of package NAMES." (map (lambda (name) - (list name (list 'unquote (string->symbol name)))) + (case (%input-style) + ((specification) + (list name (list 'unquote (list 'specification->package name))= )) + (else + (list name (list 'unquote (string->symbol name)))))) (sort names string-cisymbol arg) (alist-delete 'repo result)))) + (option '(#\s "style") #t #f + (lambda (opt name arg result) + (alist-cons 'style (string->symbol arg) + (alist-delete 'style result)))) (option '(#\r "recursive") #f #f (lambda (opt name arg result) (alist-cons 'recursive #t result))) @@ -93,23 +97,24 @@ Import and convert the CRAN package for PACKAGE-NAME.\n= ")) value) (_ #f)) (reverse opts)))) - (match args - ((package-name) - (if (assoc-ref opts 'recursive) - ;; Recursive import - (with-error-handling - (map package->definition - (filter identity - (cran-recursive-import package-name - #:repo (or (assoc-ref opt= s 'repo) 'cran))))) - ;; Single import - (let ((sexp (cran->guix-package package-name - #:repo (or (assoc-ref opts 'rep= o) 'cran)))) - (unless sexp - (leave (G_ "failed to download description for package '~a'= ~%") - package-name)) - sexp))) - (() - (leave (G_ "too few arguments~%"))) - ((many ...) - (leave (G_ "too many arguments~%")))))) + (parameterize ((%input-style (assoc-ref opts 'style))) + (match args + ((package-name) + (if (assoc-ref opts 'recursive) + ;; Recursive import + (with-error-handling + (map package->definition + (filter identity + (cran-recursive-import package-name + #:repo (or (assoc-ref o= pts 'repo) 'cran))))) + ;; Single import + (let ((sexp (cran->guix-package package-name + #:repo (or (assoc-ref opts 'r= epo) 'cran)))) + (unless sexp + (leave (G_ "failed to download description for package '~= a'~%") + package-name)) + sexp))) + (() + (leave (G_ "too few arguments~%"))) + ((many ...) + (leave (G_ "too many arguments~%"))))))) --=20 2.29.2 From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 22 10:19:20 2020 Received: (at 45288-done) by debbugs.gnu.org; 22 Dec 2020 15:19:20 +0000 Received: from localhost ([127.0.0.1]:50708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1krjRY-0001UW-7j for submit@debbugs.gnu.org; Tue, 22 Dec 2020 10:19:20 -0500 Received: from sender4-of-o50.zoho.com ([136.143.188.50]:21072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1krjRW-0001UO-DQ for 45288-done@debbugs.gnu.org; Tue, 22 Dec 2020 10:19:19 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1608650357; cv=none; d=zohomail.com; s=zohoarc; b=IZtzwS6bxitx7DGbJHEJ/sGL9pRpuXl8SX6gt0P0rOTYjdAEUkiMA/UbFhFv7acq0rX+OfPzcTfdtdZWwLe49e+k6kvk+tSQx00xlIXuuUOI/Bt71aT/+LRC9eb44Z2+w0ENPJdXFJbsipMwpAIy7mbGdR2YJpGV27/e2n4RfgA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608650357; h=Content-Type:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=MCiHyM8GF95qqQKcdreLRdCP6S8GvO93lkekrFFDr1I=; b=dhclYonvWzpQvplQlbdBVLytzKhth1TbcYIRgrcOo71y2ssaaw1LzEgMRL3PHDZvn8H8JnOCl9rnvMKSHk7JDPSnzwXl4/g/Gt2KSPSTMNDukd/oi9rgpo/cU0GqXYUdp8FRT2/K2QJKmJWJ42VVQpgpuChwZwxSZZRdeHceg58= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1608650357; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type; bh=MCiHyM8GF95qqQKcdreLRdCP6S8GvO93lkekrFFDr1I=; b=Netx2jSgmMA7ZK9u0HZUsjz7tSP+pdHjl762CGu4Sjw7SPorF8tGIRDh05UcU8CD FkdIuBJ8WNs1wVIx8Zctr5yPQhcNbGirtJ09y8VkH/YQWbwYLH+0d61CLyjHJczOLhw Or6qApbYM5CTlPeNMqSDhL22892hUmeVogAHWnlw= Received: from localhost (p54ad4ffa.dip0.t-ipconnect.de [84.173.79.250]) by mx.zohomail.com with SMTPS id 1608650355405735.9432971992367; Tue, 22 Dec 2020 07:19:15 -0800 (PST) References: <20201217094245.10300-1-rekado@elephly.net> User-agent: mu4e 1.4.13; emacs 27.1 From: Ricardo Wurmus To: 45288-done@debbugs.gnu.org Subject: [PATCH] import/cran: Add input style "specification". In-reply-to: X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Tue, 22 Dec 2020 16:19:12 +0100 Message-ID: <878s9poolr.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 45288-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Pushed with commit 5f5e3873d735d13824c172d779e6095d6947f340. -- Ricardo From unknown Fri Jun 20 05:33:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 20 Jan 2021 12:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator