From f2c0f7885e7176f414f7477f8a45fad6755576f2 Mon Sep 17 00:00:00 2001 From: Florian Wagner Date: Tue, 6 Jun 2017 14:02:47 +0200 Subject: [PATCH] Add and document R-cran build style; support CRAN in update-check. --- Manual.md | 7 +++++++ common/build-style/R-cran.sh | 7 +++++++ common/environment/build-style/R-cran.sh | 4 ++++ common/xbps-src/shutils/update_check.sh | 2 ++ 4 files changed, 20 insertions(+) create mode 100644 common/build-style/R-cran.sh create mode 100644 common/environment/build-style/R-cran.sh diff --git a/Manual.md b/Manual.md index 2712c04c5f..4d6e09f03b 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 0000000000..ab1acc228b --- /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 0000000000..d60f914f5f --- /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 9d0e26a773..7e4a681912 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