For https://github.com/r-lib/pkgdepends/issues/303 . Basically, I'm spending a lot of time working in repositories that share sources between Python and R packages and it would be nice if the pak-based tooling worked out-of-the box for things like Remotes: dependencies and check/build/install actions.
The general approach is:
Look for bootstrap.R and Config/build/bootstrap: TRUE
Use callr::rscript() to run boostrap.R with the working directory set to the source directory
The DESCRIPTION Config option is nice because it makes the opt-in more explicit (in the event that bootstrap.R existed in the package directory already) and because there was already a place to document Config/build options.
As @gaborcsardi pointed out, using Rscript + "boostrap.R" is more portable than a shell script because Rtools might not be installed or on the PATH.
This approach doesn't help with R CMD INSTALL pkg_directory but package authors can always do $R_HOME/bin/Rscript bootstrap.R in configure and/or configure.win, which also would work with devtools::load_all() (I think).
For https://github.com/r-lib/pkgdepends/issues/303 . Basically, I'm spending a lot of time working in repositories that share sources between Python and R packages and it would be nice if the pak-based tooling worked out-of-the box for things like
Remotes:
dependencies and check/build/install actions.The general approach is:
bootstrap.R
andConfig/build/bootstrap: TRUE
callr::rscript()
to runboostrap.R
with the working directory set to the source directoryThe DESCRIPTION Config option is nice because it makes the opt-in more explicit (in the event that bootstrap.R existed in the package directory already) and because there was already a place to document Config/build options.
As @gaborcsardi pointed out, using
Rscript
+ "boostrap.R" is more portable than a shell script because Rtools might not be installed or on the PATH.This approach doesn't help with
R CMD INSTALL pkg_directory
but package authors can always do$R_HOME/bin/Rscript bootstrap.R
inconfigure
and/orconfigure.win
, which also would work withdevtools::load_all()
(I think).