[R-pkg-devel] Rcpp: how best to include source from another Github repository
Thanks Ivan, this is helpful. I'll do some more research. It would be nice to have an Rcpp standard/recommended way to do this. I don't want to have a non-standard ./src or ./data folder structure for my Rcpp package, but these are the two relevant folders in my original repository. Maybe with some sort of synlinking I could achieve this 'custom' folder/file mapping. -John
On Tue, Jan 21, 2025 at 1:05?PM Ivan Krylov <ikrylov at disroot.org> wrote:
? Tue, 21 Jan 2025 11:57:46 +0100 John Clarke <john.clarke at cornerstonenw.com> ?????:
Ideally, it would be nice to be able to pull the files from the source repo using a tag/hash so that the only code change in the Rcpp repo would be that reference rather than all the changes to the shared source.
I've been using Git submodules for this purpose: https://codeberg.org/aitap/Ropj/src/branch/master/src https://git-scm.com/book/en/v2/Git-Tools-Submodules Every time the upstream changes I have to update the commit pointer in my repository too, but other than that, it's been working fine. My .Rbuildignore filters out all the unnecessary files included in the upstream repository, leaving only the relevant source code in the resulting source package. The resulting repository must be cloned with --recurse-submodules (or, if forgotten, must be initialised with git submodule update --init); further updates to the tracked commit pointer must be applied with git submodule update. If the referenced repository becomes unavailable, it will be impossible to build the package. -- Best regards, Ivan