help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to copy a file to the package /bin folder using the r-build-syst


From: Simon Tournier
Subject: Re: How to copy a file to the package /bin folder using the r-build-system?
Date: Fri, 07 Apr 2023 18:07:52 +0200

Hi,

On ven., 31 mars 2023 at 23:21, Kyle Andrews <kyle@posteo.net> wrote:

>             (let ((out (assoc-ref outputs "out")))
>               ;;; TODO: this doesn't work!
>               ;; copy site-library/littler/bin/r to bin/r
>               (copy-file
>                (string-append out "site-library/littler/src/r")
>                (string-append out "/bin/r"))))))))

I guess what you want is:

--8<---------------cut here---------------start------------->8---
              (let* ((out (assoc-ref outputs "out"))
                     (out/bin (string-append out "/bin")))
                (mkdir out/bin)
                (copy-file "inst/bin/r"
                 (string-append out/bin "/r"))))))))
--8<---------------cut here---------------end--------------->8---

And I would write,

            (lambda _
              (mkdir (string-append #$output "/bin"))
              (copy-file "inst/bin/r"
                         (string-append #$output "/bin/r")))



Well, using one or the other, I get:

--8<---------------cut here---------------start------------->8---
$ guix shell -L /tmp/foo r-littler -C -- r --help

Usage: r [options] [-|file]

Launch GNU R to execute the R commands supplied in the specified file, or
from stdin if '-' is used. Suitable for so-called shebang '#!/'-line scripts.

Options:
  -h, --help           Give this help list
      --usage          Give a short usage message
  -V, --version        Show the version number
  -v, --vanilla        Pass the '--vanilla' option to R
  -t, --rtemp          Use per-session temporary directory as R does
  -i, --interactive    Let interactive() return 'true' rather than 'false'
  -q, --quick          Skip autoload / delayed assign of default libraries
  -p, --verbose        Print the value of expressions to the console
  -l, --packages list  Load the R packages from the comma-separated 'list'
  -d, --datastdin      Prepend command to load 'X' as csv from stdin
  -L, --libpath dir    Add directory to library path via '.libPaths(dir)'
  -e, --eval expr      Let R evaluate 'expr'

--8<---------------cut here---------------end--------------->8---


Hope that helps,
simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]