Small patch to remove TODO for (@@ (guix build-system r) bioconductor-uri)

  • Open
  • quality assurance status badge
Details
3 participants
  • Kyle Andrews
  • Ricardo Wurmus
  • zimoun
Owner
unassigned
Submitted by
Kyle Andrews
Severity
normal
K
K
Kyle Andrews wrote on 25 Jul 2019 05:13
(address . guix-patches@gnu.org)
92658660d50853e4eec92f536d8b3eb720aab911.camel@gmail.com
Hi,

I am a heavy R user trying to get my feet wet with guix. Here is a
patch to remove the hard-coded bioconductor release by adding an
optional 3rd argument to the function with an appropriate default
value. I hope this is helpful.

Regards,

Kyle Andrews
From 729e621cc2175864937b6a4a3e754bd128ac9056 Mon Sep 17 00:00:00 2001
From: Kyle Andrews <kyle.c.andrews@gmail.com>
Date: Wed, 24 Jul 2019 22:51:20 -0400
Subject: [PATCH] NAME and VERSION are not enough for Bioconductor URI. Need
RELEASE.

---
guix/build-system/r.scm | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

Toggle diff (25 lines)
diff --git a/guix/build-system/r.scm b/guix/build-system/r.scm
index fbf08d3aa7..93b2f2f14f 100644
--- a/guix/build-system/r.scm
+++ b/guix/build-system/r.scm
@@ -47,13 +47,14 @@ available via the first URI, the second URI points to the archived version."
(string-append "mirror://cran/src/contrib/Archive/"
name "/" name "_" version ".tar.gz")))
-(define (bioconductor-uri name version)
+(define* (bioconductor-uri name version
+ #:optional
+ (release (@@ (guix import cran) %bioconductor-version)))
"Return a URI string for the R package archive on Bioconductor for the
-release corresponding to NAME and VERSION."
+release corresponding to NAME, package VERSION, and Bioconductor RELEASE."
(list (string-append "https://bioconductor.org/packages/release/bioc/src/contrib/"
name "_" version ".tar.gz")
- (string-append "https://bioconductor.org/packages/"
- (@@ (guix import cran) %bioconductor-version)
+ (string-append "https://bioconductor.org/packages/" release
"/bioc/src/contrib/Archive/"
name "_" version ".tar.gz")))
--
2.22.0
Z
Z
zimoun wrote on 25 Jul 2019 15:48
(name . Kyle Andrews)(address . kyle.c.andrews@gmail.com)(address . 36805@debbugs.gnu.org)
CAJ3okZ15JPdQETN1G4xS-OGyGV97_4t+Keg0eEfpCk18ir82-g@mail.gmail.com
Dear,

It appears to me nice---if for example one wants to create a channel
for Bioconductor 3.6 or older.
This eases the automation of such channel.

I am using the package `cytofkit`, removed in the last release:

Append strings to build the uri is not really nice.

Thank you for this suggestion.


All the best,
simon
K
K
Kyle Andrews wrote on 26 Jul 2019 06:17
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 36805@debbugs.gnu.org)
8a97ec5ed0d1f657731c22593a1f6696af2434dc.camel@gmail.com
On Thu, 2019-07-25 at 15:48 +0200, zimoun wrote:
Toggle quote (19 lines)
> Dear,
>
> It appears to me nice---if for example one wants to create a channel
> for Bioconductor 3.6 or older.
> This eases the automation of such channel.
>
> I am using the package `cytofkit`, removed in the last release:
> https://bioconductor.org/about/removed-packages/
>
> Append strings to build the uri is not really nice.
> https://github.com/zimoun/guix-bimsb/blob/master/bimsb/packages/stagi
> ng.scm#L2895-L2941
>
> Thank you for this suggestion.
>
>
> All the best,
> simon

Hi Simon,

I find it sometimes convenient to use a modified version of the
file.path function in R to save me from myself a bit with file paths
while also adding some semantic markup. Perhaps it would also be useful
for building Guix packages? Users would then seldom have to worry about
incorrectly including trailing slashes. I created a code snippet with
my naive implementation here:


Maybe there is already a guile library for this sort of thing?

Regards,

Kyle
R
R
Ricardo Wurmus wrote on 26 Jul 2019 11:46
(name . Kyle Andrews)(address . kyle.c.andrews@gmail.com)
87pnlx86x2.fsf@elephly.net
Hi Kyle,

Toggle quote (11 lines)
> I find it sometimes convenient to use a modified version of the
> file.path function in R to save me from myself a bit with file paths
> while also adding some semantic markup. Perhaps it would also be useful
> for building Guix packages? Users would then seldom have to worry about
> incorrectly including trailing slashes. I created a code snippet with
> my naive implementation here:
>
> https://gitlab.com/snippets/1879185
>
> Maybe there is already a guile library for this sort of thing?

There is, but it’s a little heavier:


--
Ricardo
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 36805@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 36805
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch