all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kyle Andrews <kyle@posteo.net>
To: help-guix <help-guix@gnu.org>
Subject: How to copy a file to the package /bin folder using the r-build-system?
Date: Fri, 31 Mar 2023 23:21:18 +0000	[thread overview]
Message-ID: <87lejczclp.fsf@posteo.net> (raw)


Dear Guix,

I want to package the littler R package.

Unlike most R packages, this one provides an executable (a little r to
complement the big R) that should go on the PATH rather than be tucked
away into site-library where it cannot be used. Surprisingly, to me,
when the command below fails ...

```
guix build -K -f littler.scm
```

... the resulting temporary directory skips directly to the littler
folder wheras the /gnu/store builds show the output inside of
site-library. The /tmp output also looks different, lacking a bin/
folder like in the /gnu/store/*littlr* builds.

How do I go about getting r out of site-library/littler/bin/r in there
using the r-build-system?

Here is what I have right now:

```
(use-modules
 (guix packages)
 (guix download)
 (gnu packages statistics)
 (gnu packages compression)
 (gnu packages icu4c)
 (guix gexp)
 (guix build-system r)
 (gnu packages cran)
 (gnu packages autotools)
 ((guix licenses) #:prefix license:))

(define-public r-littler
  (package
    (name "r-littler")
    (version "0.3.18")
    (source (origin
              (method url-fetch)
              (uri (cran-uri "littler" version))
              (sha256
               (base32
                "1lp6a62g3yhzr4pv9kynibv7k9pd546w6hifs1aficyxbyg4dgqq"))))
    (properties `((upstream-name . "littler")))
    (build-system r-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
	  (add-after 'install 'add-to-path
	    (lambda* (#:key inputs outputs #:allow-other-keys)
	      (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"))))))))
    (inputs (list icu4c))
    (native-inputs (list r-simplermarkdown automake autoconf zlib))
    (home-page "https://github.com/eddelbuettel/littler")
    (synopsis "R at the Command-Line via 'r'")
    (description
     "This package provides a scripting and command-line front-end is provided by r
(aka littler') as a lightweight binary wrapper around the GNU R language and
environment for statistical computing and graphics.  While R can be used in
batch mode, the r binary adds full support for both shebang'-style scripting
(i.e.  using a hash-mark-exclamation-path expression as the first line in
scripts) as well as command-line use in standard Unix pipelines.  In other
words, r provides the R language without the environment.")
    (license license:gpl2+)))

;; (packages->manifest (list r r-littler))

r-littler
```

I'm grateful for any assistance!

Best Regards,
Kyle


             reply	other threads:[~2023-04-01  0:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31 23:21 Kyle Andrews [this message]
2023-04-07 16:07 ` How to copy a file to the package /bin folder using the r-build-system? Simon Tournier
2023-04-09  3:15   ` Kyle Andrews
2023-04-09  9:36     ` (
2023-04-09 12:54       ` Kyle Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lejczclp.fsf@posteo.net \
    --to=kyle@posteo.net \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.