all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: r: Add which to propagated-inputs.
@ 2017-01-23 21:01 Raoul Bonnal
  2017-01-24 21:04 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Raoul Bonnal @ 2017-01-23 21:01 UTC (permalink / raw)
  To: guix-devel

From: Raoul Jean Pierre Bonnal <ilpuccio.febo@gmail.com>

* gnu/packages/statistics.scm (r)[propagated-inputs]: Add which.
---

Notes:
    In my local installation of R
    
    Sys.which(c("bash"))
    
    was not working properly, inspecting the function(below) I had not installed which beforehand.
    > Sys.which
    function (names)
    {
        res <- character(length(names))
        names(res) <- names
        which <- "/gnu/store/cn670s29lsf2nr5axd8gmhl8sb9qpyiq-which-2.21/bin/which"
        if (!nzchar(which)) {
            warning("'which' was not found on this platform")
            return(res)
        }
        for (i in seq_along(names)) {
            if (is.na(names[i])) {
                res[i] <- NA
                next
            }
            ans <- suppressWarnings(system(paste(which, shQuote(names[i])),
                intern = TRUE, ignore.stderr = TRUE))
            if (grepl("solaris", R.version$os)) {
                tmp <- strsplit(ans[1], " ", fixed = TRUE)[[1]]
                if (identical(tmp[1:3], c("no", i, "in")))
                    ans <- ""
            }
            res[i] <- if (length(ans))
                ans[1]
            else ""
            if (!file.exists(res[i]))
                res[i] <- ""
        }
        res
    }
    
    requiring which to be installed along with R seems to fix the issue.

 gnu/packages/statistics.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index f27cb5704..648825b1e 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -191,6 +191,8 @@ be output in text, PostScript, PDF or HTML.")
        ("pcre" ,pcre)
        ("readline" ,readline)
        ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("which" ,which)))
     (native-search-paths
      (list (search-path-specification
             (variable "R_LIBS_SITE")
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-24 21:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-23 21:01 [PATCH] gnu: r: Add which to propagated-inputs Raoul Bonnal
2017-01-24 21:04 ` Ludovic Courtès
2017-01-24 21:54   ` Ra

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.