[R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

Dirk Eddelbuettel edd @ending from debi@n@org
Sat Jan 5 00:29:25 CET 2019


On 5 January 2019 at 00:00, Iñaki Ucar wrote:
| On Fri, 4 Jan 2019 at 20:10, Iñaki Ucar <iucar using fedoraproject.org> wrote:
| >
| > I see. Then I suggest the following hack (not tested). If the package
| > has a vignette, put there a hidden chunk that generates a file with
| > info about the branch and the path. This file will be available for
| > your configure script, which runs at INSTALL time. There you can,
| > e.g., retrieve that branch from a remote repo.
| 
| Actually, if there is any vignette, the configure script is executed
| during the build process, because R needs to install the package to
| build the vignettes. There, you can rely on $OLDPWD to retrieve the
| path to the package.

Not really. Consider

  ~/git/repo/proj-brnchA
  ~/git/repo/proj-brnchB
  ~/git/repo/proj-brnchC

where each branch may have a in-repo build with static libraries and
header. And I build Rpkg_0.1.0.tar.gz in each with R CMD build. I need inside
of Rpkg_0.1.0.tar.gz a reference to whether we need headers from A, B or C.

$OLDPWD does not (generally) give me that.  Only if I invoked R CMD INSTALL
in the path.  My preference would be to do some "not unlink configure" which
write down the path in src/Makevars.  I think the vignette trick will let me
do that but I have not had time to try.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-package-devel mailing list