From 4d1f8fd68327ea9eb6cf3ec4623dbfb0fc4d526c Mon Sep 17 00:00:00 2001 From: Robert Greener Date: Wed, 6 Jul 2022 13:21:41 +0100 Subject: [PATCH] eclass/R-packages: Add CRAN_SNAPSHOT_DATE and use MRAN. The current SRC_URI searches all the CRAN mirrors for /src/contrib/${PN}_${PV}.tar.gz. This is problematic. Once a package is updated on CRAN, the package is removed from this path and moved to /src/contrib/Archive/${PN}/${PN}_${PV}.tar.gz. The effect of this is that once a package goes out-of-date on CRAN, the ebuild will no longer build. This significantly increases the maintenance burden of dev-R/* packages, as it requires that they be up-to-date at all times. The proposal here, is to use the snapshots of CRAN provided by Microsoft. This requires an additional variable set in the ebuilds, the update date. This can just be set to the date that the ebuild is updated. By setting this, out of date packages will continue to build. Signed-off-by: Robert Greener --- eclass/R-packages.eclass | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass index 1665203d19..ec730a9a3f 100644 --- a/eclass/R-packages.eclass +++ b/eclass/R-packages.eclass @@ -24,7 +24,15 @@ EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pk CRAN_PV=${CRAN_PV:-$PV} CRAN_PN=${CRAN_PN:-${PN//_/.}} -SRC_URI="mirror://cran/src/contrib/${CRAN_PN}_${CRAN_PV}.tar.gz" +# Set CRAN_SNAPSHOT_DATE to the date the ebuild was updated in the ebuild + +if [[ ${CRAN_SNAPSHOT_DATE} ]]; then + SRC_URI="https://cran.microsoft.com/snapshot/${CRAN_SNAPSHOT_DATE}" +else + SRC_URI="mirror://cran" +fi +SRC_URI+="/src/contrib/${CRAN_PN}_${CRAN_PV}.tar.gz" + HOMEPAGE="https://cran.r-project.org/package=${CRAN_PN}" SLOT="0"