diff --git a/Manual.md b/Manual.md index 2712c04c5f4..4d6e09f03bf 100644 --- a/Manual.md +++ b/Manual.md @@ -673,6 +673,13 @@ depend on additional packages. This build style does not install dependencies to the root directory, and only checks if a binary package is available in repositories. +- `R-cran` For packages that are available on The Comprehensive R Archive +Network (CRAN). The build style requires the `pkgname` to start with +`R-cran-` and any dashes (`-`) in the CRAN-given version to be replaced +with the character `r` in the `version` variable. The `distfiles` +location will automatically be set as well as the package made to depend +on `R`. + - `ruby-module` For packages that are ruby modules and are installable via `ruby install.rb`. Additional install arguments can be specified via `make_install_args`. diff --git a/common/build-style/R-cran.sh b/common/build-style/R-cran.sh new file mode 100644 index 00000000000..ab1acc228b6 --- /dev/null +++ b/common/build-style/R-cran.sh @@ -0,0 +1,7 @@ +# +# This helper is for templates using R-cran. +# +do_install() { + mkdir -p ${DESTDIR}/usr/lib/R/library + ( cd .. && R CMD INSTALL -l ${DESTDIR}/usr/lib/R/library ${pkgname#R-cran-} ) +} diff --git a/common/environment/build-style/R-cran.sh b/common/environment/build-style/R-cran.sh new file mode 100644 index 00000000000..d60f914f5f7 --- /dev/null +++ b/common/environment/build-style/R-cran.sh @@ -0,0 +1,4 @@ +makedepends+=" R" +depends+=" R" +distfiles="https://cran.r-project.org/src/contrib/${pkgname#R-cran-}_${version//r/-}.tar.gz" +wrksrc="${XBPS_BUILDDIR}/${pkgname#R-cran-}" diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh index 9d0e26a7737..7e4a6819124 100644 --- a/common/xbps-src/shutils/update_check.sh +++ b/common/xbps-src/shutils/update_check.sh @@ -57,6 +57,8 @@ update_check() { url="http://ftp.gnome.org/pub/GNOME/sources/$pkgname/cache.json";; *kernel.org/pub/linux/kernel/*) rx=linux-'\K'${version%.*}'[\d.]+(?=\.tar\.xz)';; + *cran.r-project.org/src/contrib*) + rx='\b\Q'"${pkgname#R-cran-}"'\E_\K\d+(\.\d+)*(-\d+)?(?=\.tar)';; esac fi