diff mbox series

[bug#36805] Small patch to remove TODO for (@@ (guix build-system r) bioconductor-uri)

Message ID 92658660d50853e4eec92f536d8b3eb720aab911.camel@gmail.com
State Accepted
Headers show
Series [bug#36805] Small patch to remove TODO for (@@ (guix build-system r) bioconductor-uri) | expand

Commit Message

Kyle Andrews July 25, 2019, 3:13 a.m. UTC
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

Comments

Simon Tournier July 25, 2019, 1:48 p.m. UTC | #1
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/staging.scm#L2895-L2941

Thank you for this suggestion.


All the best,
simon
Kyle Andrews July 26, 2019, 4:17 a.m. UTC | #2
On Thu, 2019-07-25 at 15:48 +0200, zimoun wrote:
> 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:

https://gitlab.com/snippets/1879185

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

Regards,

Kyle
Ricardo Wurmus July 26, 2019, 9:46 a.m. UTC | #3
Hi Kyle,

> 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:

    https://gitlab.com/brandoninvergo/guile-file-names
diff mbox series

Patch

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(-)

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