I have a package that Imports INLA, which is not hosted on CRAN or a standard GitHub repository. There are multiple SO questions detailing how to install the package on a personal machine, such as this, or even mentions it as a dependency in a package.
The two ways that are typically recommended to install on a personal machine are:
Direct from INLA website
install.packages("INLA",repos=c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/stable"), dep=TRUE)
From the GitHub host
devtools::install_github(repo = "https://github.com/hrue/r-inla", ref = "stable", subdir = "rinla", build = FALSE)
Now, these are fine for personal machines, but don't work in the DESCRIPTION files Remotes:
section.
If we do url::https://inla.r-inla-download.org/R/stable
, this gives an error that the file extension isn't recognized.
Error: Error: Failed to install 'unknown package' from URL:
Don't know how to decompress files with extension
If we do github::hrue/r-inla
, I am unaware of how to pass (or if it's even possible) the ref
, subdir
, and build
arguments in the DESCRIPTION file.
Previous packages used a read only mirror of the INLA code that was hosted on GitHub, solely for this purpose, at this repo and then just using github::inbo/INLA
. However, this repository is out of date.
Current solution
What I'm doing instead is to directly reference the tarball hosted on the main webpage.
url::https://inla.r-inla-download.org/R/stable/src/contrib/INLA_21.02.23.tar.gz
This solution works, and passes CI as well as the machines are able to install and load from there. The only issue is that I need to periodically update the static link to this tarball, and would prefer to reference the stable build, either directly from the INLA website as above, or the hrue/inla
repo with those other arguments passed. Is there a way to achieve this in the DESCRIPTION file?