public inbox for gentoo-guru@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-guru] [RFC PATCH 2/3] eclass/R-packages: substitute _ with . in SRC_URI  and HOMEPAGE
       [not found] <20220705071539.2463760-1-me@r0bert.dev>
@ 2022-07-05  7:16 ` Robert Greener
  2022-07-06  0:49   ` Anna “CyberTailor”
  2022-07-05  7:16 ` [gentoo-guru] [RFC PATCH 1/3] eclass/R-packages: Use src/contrib or src/contrib/Archive from main CRAN Robert Greener
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 16+ messages in thread
From: Robert Greener @ 2022-07-05  7:16 UTC (permalink / raw
  To: gentoo-guru; +Cc: Robert Greener

This is done throughout other parts of the eclass, it would mean that
the SRC_URI and HOMEPAGE wouldn't need to be overrided in the ebuilds.
For example, in the case of data.table.

Signed-off-by: Robert Greener <me@r0bert.dev>
---
 eclass/R-packages.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass
index dd6b69933..a9bb32980 100644
--- a/eclass/R-packages.eclass
+++ b/eclass/R-packages.eclass
@@ -22,10 +22,10 @@ esac
 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_postinst
 
 SRC_URI="
-	https://cran.r-project.org/src/contrib/${PN}_${PV}.tar.gz
-	https://cran.r-project.org/src/contrib/Archive/${PN}/${PN}_${PV}.tar.gz
+	https://cran.r-project.org/src/contrib/${PN//_/.}_${PV}.tar.gz
+	https://cran.r-project.org/src/contrib/Archive/${PN//_/.}/${PN//_/.}_${PV}.tar.gz
 "
-HOMEPAGE="https://cran.r-project.org/package=${PN}"
+HOMEPAGE="https://cran.r-project.org/package=${PN//_/.}"
 
 SLOT="0"
 
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-guru] [RFC PATCH 1/3] eclass/R-packages: Use src/contrib or src/contrib/Archive from main CRAN
       [not found] <20220705071539.2463760-1-me@r0bert.dev>
  2022-07-05  7:16 ` [gentoo-guru] [RFC PATCH 2/3] eclass/R-packages: substitute _ with . in SRC_URI and HOMEPAGE Robert Greener
@ 2022-07-05  7:16 ` Robert Greener
  2022-07-05  7:58   ` Anna “CyberTailor”
  2022-07-05  7:16 ` [gentoo-guru] [RFC PATCH 3/3] eclass/R-packages: Add CRAN_PV Robert Greener
  2022-07-06 12:21 ` [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements Robert Greener
  3 siblings, 1 reply; 16+ messages in thread
From: Robert Greener @ 2022-07-05  7:16 UTC (permalink / raw
  To: gentoo-guru; +Cc: Robert Greener

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 just the main CRAN, so that every mirror
doesn't have to be searched, to search the main repo, and then the
archive. (also, some CRAN mirrors seem misconfigured and return a html
document if the package is not found at
/src/contrib/${PN}_${PV}.tar.gz). This means that if the package is
out-of-date it will still build.

Signed-off-by: Robert Greener <me@r0bert.dev>
---
 eclass/R-packages.eclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass
index aed8cce84..dd6b69933 100644
--- a/eclass/R-packages.eclass
+++ b/eclass/R-packages.eclass
@@ -21,7 +21,10 @@ esac
 
 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_postinst
 
-SRC_URI="mirror://cran/src/contrib/${PN}_${PV}.tar.gz"
+SRC_URI="
+	https://cran.r-project.org/src/contrib/${PN}_${PV}.tar.gz
+	https://cran.r-project.org/src/contrib/Archive/${PN}/${PN}_${PV}.tar.gz
+"
 HOMEPAGE="https://cran.r-project.org/package=${PN}"
 
 SLOT="0"
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-guru] [RFC PATCH 3/3] eclass/R-packages: Add CRAN_PV
       [not found] <20220705071539.2463760-1-me@r0bert.dev>
  2022-07-05  7:16 ` [gentoo-guru] [RFC PATCH 2/3] eclass/R-packages: substitute _ with . in SRC_URI and HOMEPAGE Robert Greener
  2022-07-05  7:16 ` [gentoo-guru] [RFC PATCH 1/3] eclass/R-packages: Use src/contrib or src/contrib/Archive from main CRAN Robert Greener
@ 2022-07-05  7:16 ` Robert Greener
  2022-07-06 12:21 ` [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements Robert Greener
  3 siblings, 0 replies; 16+ messages in thread
From: Robert Greener @ 2022-07-05  7:16 UTC (permalink / raw
  To: gentoo-guru; +Cc: Robert Greener

Add a variable CRAN_PV which defaults to PV, but can be overridden in
the ebuild. This is useful for the case where the version number is
something like "1.2-24" as it often is with R packages, this would mean
that a variable like "CRAN_PV=$(ver_rs 2 -)" could be defined in the
ebuild, which is used in the SRC_URI of the eclass. If CRAN_PV isn't
defined, it just defaults to PV.

Signed-off-by: Robert Greener <me@r0bert.dev>
---
 eclass/R-packages.eclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass
index a9bb32980..144734b21 100644
--- a/eclass/R-packages.eclass
+++ b/eclass/R-packages.eclass
@@ -21,9 +21,10 @@ esac
 
 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_postinst
 
+CRAN_PV=${CRAN_PV:-$PV}
 SRC_URI="
-	https://cran.r-project.org/src/contrib/${PN//_/.}_${PV}.tar.gz
-	https://cran.r-project.org/src/contrib/Archive/${PN//_/.}/${PN//_/.}_${PV}.tar.gz
+	https://cran.r-project.org/src/contrib/${PN//_/.}_${CRAN_PV}.tar.gz
+	https://cran.r-project.org/src/contrib/Archive/${PN//_/.}/${PN//_/.}_${CRAN_PV}.tar.gz
 "
 HOMEPAGE="https://cran.r-project.org/package=${PN//_/.}"
 
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [gentoo-guru] [RFC PATCH 1/3] eclass/R-packages: Use src/contrib or src/contrib/Archive from main CRAN
  2022-07-05  7:16 ` [gentoo-guru] [RFC PATCH 1/3] eclass/R-packages: Use src/contrib or src/contrib/Archive from main CRAN Robert Greener
@ 2022-07-05  7:58   ` Anna “CyberTailor”
  2022-07-07  7:17     ` Alessandro Barbieri
  0 siblings, 1 reply; 16+ messages in thread
From: Anna “CyberTailor” @ 2022-07-05  7:58 UTC (permalink / raw
  To: gentoo-guru

On 2022-07-05 07:16, Robert Greener wrote:
> 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 just the main CRAN, so that every mirror
> doesn't have to be searched, to search the main repo, and then the
> archive. (also, some CRAN mirrors seem misconfigured and return a html
> document if the package is not found at
> /src/contrib/${PN}_${PV}.tar.gz). This means that if the package is
> out-of-date it will still build.
> 
> Signed-off-by: Robert Greener <me@r0bert.dev>
> ---
>  eclass/R-packages.eclass | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass
> index aed8cce84..dd6b69933 100644
> --- a/eclass/R-packages.eclass
> +++ b/eclass/R-packages.eclass
> @@ -21,7 +21,10 @@ esac
>  
>  EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_postinst
>  
> -SRC_URI="mirror://cran/src/contrib/${PN}_${PV}.tar.gz"
> +SRC_URI="
> +	https://cran.r-project.org/src/contrib/${PN}_${PV}.tar.gz
> +	https://cran.r-project.org/src/contrib/Archive/${PN}/${PN}_${PV}.tar.gz
> +"

Multiple SRC_URI doesn't work as fallback. You need a custom src_fetch
function instead.

>  HOMEPAGE="https://cran.r-project.org/package=${PN}"
>  
>  SLOT="0"
> -- 
> 2.35.1
> 
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-guru] [RFC PATCH 2/3] eclass/R-packages: substitute _ with . in SRC_URI  and HOMEPAGE
  2022-07-05  7:16 ` [gentoo-guru] [RFC PATCH 2/3] eclass/R-packages: substitute _ with . in SRC_URI and HOMEPAGE Robert Greener
@ 2022-07-06  0:49   ` Anna “CyberTailor”
  0 siblings, 0 replies; 16+ messages in thread
From: Anna “CyberTailor” @ 2022-07-06  0:49 UTC (permalink / raw
  To: gentoo-guru

On 2022-07-05 07:16, Robert Greener wrote:
> This is done throughout other parts of the eclass, it would mean that
> the SRC_URI and HOMEPAGE wouldn't need to be overrided in the ebuilds.
> For example, in the case of data.table.

I'd introduce a new variable CRAN_PN instead.
 
> Signed-off-by: Robert Greener <me@r0bert.dev>
> ---
>  eclass/R-packages.eclass | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass
> index dd6b69933..a9bb32980 100644
> --- a/eclass/R-packages.eclass
> +++ b/eclass/R-packages.eclass
> @@ -22,10 +22,10 @@ esac
>  EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_postinst
>  
>  SRC_URI="
> -	https://cran.r-project.org/src/contrib/${PN}_${PV}.tar.gz
> -	https://cran.r-project.org/src/contrib/Archive/${PN}/${PN}_${PV}.tar.gz
> +	https://cran.r-project.org/src/contrib/${PN//_/.}_${PV}.tar.gz
> +	https://cran.r-project.org/src/contrib/Archive/${PN//_/.}/${PN//_/.}_${PV}.tar.gz
>  "
> -HOMEPAGE="https://cran.r-project.org/package=${PN}"
> +HOMEPAGE="https://cran.r-project.org/package=${PN//_/.}"
>  
>  SLOT="0"
>  
> -- 
> 2.35.1
> 
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements
       [not found] <20220705071539.2463760-1-me@r0bert.dev>
                   ` (2 preceding siblings ...)
  2022-07-05  7:16 ` [gentoo-guru] [RFC PATCH 3/3] eclass/R-packages: Add CRAN_PV Robert Greener
@ 2022-07-06 12:21 ` Robert Greener
  2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 1/4] eclass/R-packages: Add CRAN_PV Robert Greener
                     ` (6 more replies)
  3 siblings, 7 replies; 16+ messages in thread
From: Robert Greener @ 2022-07-06 12:21 UTC (permalink / raw
  To: gentoo-guru; +Cc: Robert Greener, cyber, lssndrbarbieri

Hello,

Here is v2 of the improvements to eclass/R-packages. Thank you
Alessandro and Anna for your comments.

This time, I use the microsoft cran snapshots (MRAN), to download the
package if CRAN_UPD_DATE is set. If this is not set, then CRAN is used
as normal.

The intention would be to update all packages in dev-R to use
CRAN_UPD_DATE and then remove the if guard around this.

What do you all think?

--
Robert

Robert Greener (4):
  eclass/R-packages: Add CRAN_PV
  eclass/R-packages: Add CRAN_PN variable
  eclass/R-packages: Add CRAN_UPD_DATE and use MRAN.
  eclass/R-packages: Add Robert Greener (myself) as author

 eclass/R-packages.eclass | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

-- 
2.35.1



^ permalink raw reply	[flat|nested] 16+ messages in thread

* [gentoo-guru] [RFC PATCH v2 1/4] eclass/R-packages: Add CRAN_PV
  2022-07-06 12:21 ` [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements Robert Greener
@ 2022-07-06 12:21   ` Robert Greener
  2022-07-11  5:04     ` [gentoo-guru] " Alessandro Barbieri
  2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 2/4] eclass/R-packages: Add CRAN_PN variable Robert Greener
                     ` (5 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Robert Greener @ 2022-07-06 12:21 UTC (permalink / raw
  To: gentoo-guru; +Cc: Robert Greener, cyber, lssndrbarbieri

Add a variable CRAN_PV which defaults to PV, but can be overridden in
the ebuild. This is useful for the case where the version number is
something like "1.2-24" as it often is with R packages, this would mean
that a variable like "CRAN_PV=$(ver_rs 2 -)" could be defined in the
ebuild, which is used in the SRC_URI of the eclass. If CRAN_PV isn't
defined, it just defaults to PV.

Signed-off-by: Robert Greener <me@r0bert.dev>
---
 eclass/R-packages.eclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass
index aed8cce84..982920f43 100644
--- a/eclass/R-packages.eclass
+++ b/eclass/R-packages.eclass
@@ -21,7 +21,9 @@ esac
 
 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_postinst
 
-SRC_URI="mirror://cran/src/contrib/${PN}_${PV}.tar.gz"
+CRAN_PV=${CRAN_PV:-$PV}
+
+SRC_URI="mirror://cran/src/contrib/${PN}_${CRAN_PV}.tar.gz"
 HOMEPAGE="https://cran.r-project.org/package=${PN}"
 
 SLOT="0"
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-guru] [RFC PATCH v2 2/4] eclass/R-packages: Add CRAN_PN variable
  2022-07-06 12:21 ` [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements Robert Greener
  2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 1/4] eclass/R-packages: Add CRAN_PV Robert Greener
@ 2022-07-06 12:21   ` Robert Greener
  2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 3/4] eclass/R-packages: Add CRAN_UPD_DATE and use MRAN Robert Greener
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Robert Greener @ 2022-07-06 12:21 UTC (permalink / raw
  To: gentoo-guru; +Cc: Robert Greener, cyber, lssndrbarbieri

This can be overridden in the ebuilds, but if its not defined it is the
package name with _ substituted with periods. This maintains the
existing behaviour.

Signed-off-by: Robert Greener <me@r0bert.dev>
---
 eclass/R-packages.eclass | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass
index 982920f43..1665203d1 100644
--- a/eclass/R-packages.eclass
+++ b/eclass/R-packages.eclass
@@ -22,9 +22,10 @@ esac
 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_postinst
 
 CRAN_PV=${CRAN_PV:-$PV}
+CRAN_PN=${CRAN_PN:-${PN//_/.}}
 
-SRC_URI="mirror://cran/src/contrib/${PN}_${CRAN_PV}.tar.gz"
-HOMEPAGE="https://cran.r-project.org/package=${PN}"
+SRC_URI="mirror://cran/src/contrib/${CRAN_PN}_${CRAN_PV}.tar.gz"
+HOMEPAGE="https://cran.r-project.org/package=${CRAN_PN}"
 
 SLOT="0"
 
@@ -50,8 +51,8 @@ _movelink() {
 # function to unpack R packages into the right folder
 R-packages_src_unpack() {
 	unpack ${A}
-	if [[ -d "${PN//_/.}" ]] && [[ ! -d "${P}" ]]; then
-		mv "${PN//_/.}" "${P}" || die
+	if [[ -d "${CRAN_PN}" ]] && [[ ! -d "${P}" ]]; then
+		mv "${CRAN_PN}" "${P}" || die
 	fi
 }
 
@@ -101,7 +102,7 @@ R-packages_src_compile() {
 # documentation and examples to docsdir, symlinked back to R site-library (to allow access from within R)
 # everything else to R site-library
 R-packages_src_install() {
-	pushd "${T}/R/${PN//_/.}" || die
+	pushd "${T}/R/${CRAN_PN}" || die
 
 	local DOCS_DIR="/usr/share/doc/${PF}"
 
@@ -132,7 +133,7 @@ R-packages_src_install() {
 	rm -rf tests test || die
 
 	insinto "/usr/$(get_libdir)/R/site-library"
-	doins -r "${T}/R/${PN//_/.}"
+	doins -r "${T}/R/${CRAN_PN}"
 }
 
 # @FUNCTION: R-packages_pkg_postinst
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-guru] [RFC PATCH v2 3/4] eclass/R-packages: Add CRAN_UPD_DATE and use MRAN.
  2022-07-06 12:21 ` [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements Robert Greener
  2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 1/4] eclass/R-packages: Add CRAN_PV Robert Greener
  2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 2/4] eclass/R-packages: Add CRAN_PN variable Robert Greener
@ 2022-07-06 12:21   ` Robert Greener
  2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 4/4] eclass/R-packages: Add Robert Greener (myself) as author Robert Greener
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Robert Greener @ 2022-07-06 12:21 UTC (permalink / raw
  To: gentoo-guru; +Cc: Robert Greener, cyber, lssndrbarbieri

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 <me@r0bert.dev>
---
 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 1665203d1..74f175540 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_UPD_DATE to the date the ebuild was updated in the ebuild
+
+if [[ ${CRAN_UPD_DATE} ]]; then
+	SRC_URI="https://cran.microsoft.com/snapshot/${CRAN_UPD_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"
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-guru] [RFC PATCH v2 4/4] eclass/R-packages: Add Robert Greener (myself) as author
  2022-07-06 12:21 ` [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements Robert Greener
                     ` (2 preceding siblings ...)
  2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 3/4] eclass/R-packages: Add CRAN_UPD_DATE and use MRAN Robert Greener
@ 2022-07-06 12:21   ` Robert Greener
  2022-07-06 12:32   ` [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements Anna “CyberTailor”
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Robert Greener @ 2022-07-06 12:21 UTC (permalink / raw
  To: gentoo-guru; +Cc: Robert Greener, cyber, lssndrbarbieri

---
 eclass/R-packages.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass
index 74f175540..6473d7263 100644
--- a/eclass/R-packages.eclass
+++ b/eclass/R-packages.eclass
@@ -7,6 +7,7 @@
 # Denis Dupeyron <calchan@gentoo.org>
 # Benda Xu <heroxbd@gentoo.org>
 # Alessandro Barbieri <lssndrbarbieri@gmail.com>
+# Robert Greener <me@r0bert.dev>
 # @BLURB: eclass to build R packages
 # @MAINTAINER:
 # Alessandro Barbieri <lssndrbarbieri@gmail.com>
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements
  2022-07-06 12:21 ` [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements Robert Greener
                     ` (3 preceding siblings ...)
  2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 4/4] eclass/R-packages: Add Robert Greener (myself) as author Robert Greener
@ 2022-07-06 12:32   ` Anna “CyberTailor”
  2022-07-11  5:06   ` [gentoo-guru] " Alessandro Barbieri
  2022-07-12 12:06   ` Robert Greener
  6 siblings, 0 replies; 16+ messages in thread
From: Anna “CyberTailor” @ 2022-07-06 12:32 UTC (permalink / raw
  To: gentoo-guru

On 2022-07-06 13:21, Robert Greener wrote:
> Hello,
> 
> Here is v2 of the improvements to eclass/R-packages. Thank you
> Alessandro and Anna for your comments.
> 
> This time, I use the microsoft cran snapshots (MRAN), to download the
> package if CRAN_UPD_DATE is set. If this is not set, then CRAN is used
> as normal.
> 
> The intention would be to update all packages in dev-R to use
> CRAN_UPD_DATE and then remove the if guard around this.
> 
> What do you all think?

LGTM

> --
> Robert
> 
> Robert Greener (4):
>   eclass/R-packages: Add CRAN_PV
>   eclass/R-packages: Add CRAN_PN variable
>   eclass/R-packages: Add CRAN_UPD_DATE and use MRAN.
>   eclass/R-packages: Add Robert Greener (myself) as author
> 
>  eclass/R-packages.eclass | 24 ++++++++++++++++++------
>  1 file changed, 18 insertions(+), 6 deletions(-)
> 
> -- 
> 2.35.1
> 
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-guru] [RFC PATCH 1/3] eclass/R-packages: Use src/contrib or src/contrib/Archive from main CRAN
  2022-07-05  7:58   ` Anna “CyberTailor”
@ 2022-07-07  7:17     ` Alessandro Barbieri
  2022-07-08 13:09       ` Robert Greener
  0 siblings, 1 reply; 16+ messages in thread
From: Alessandro Barbieri @ 2022-07-07  7:17 UTC (permalink / raw
  To: Anna “CyberTailor”; +Cc: gentoo-guru

[-- Attachment #1: Type: text/plain, Size: 1890 bytes --]

Il giorno mar 5 lug 2022 alle ore 09:58 Anna “CyberTailor” <cyber@sysrq.in>
ha scritto:

> On 2022-07-05 07:16, Robert Greener wrote:
> > 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 just the main CRAN, so that every mirror
> > doesn't have to be searched, to search the main repo, and then the
> > archive. (also, some CRAN mirrors seem misconfigured and return a html
> > document if the package is not found at
> > /src/contrib/${PN}_${PV}.tar.gz). This means that if the package is
> > out-of-date it will still build.
> >
> > Signed-off-by: Robert Greener <me@r0bert.dev>
> > ---
> >  eclass/R-packages.eclass | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass
> > index aed8cce84..dd6b69933 100644
> > --- a/eclass/R-packages.eclass
> > +++ b/eclass/R-packages.eclass
> > @@ -21,7 +21,10 @@ esac
> >
> >  EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile
> src_install pkg_postinst
> >
> > -SRC_URI="mirror://cran/src/contrib/${PN}_${PV}.tar.gz"
> > +SRC_URI="
> > +     https://cran.r-project.org/src/contrib/${PN}_${PV}.tar.gz
> > +
> https://cran.r-project.org/src/contrib/Archive/${PN}/${PN}_${PV}.tar.gz
> > +"
>
> Multiple SRC_URI doesn't work as fallback. You need a custom src_fetch
> function instead.
>
>
I like this idea, any downsides?

[-- Attachment #2: Type: text/html, Size: 2683 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-guru] [RFC PATCH 1/3] eclass/R-packages: Use src/contrib or src/contrib/Archive from main CRAN
  2022-07-07  7:17     ` Alessandro Barbieri
@ 2022-07-08 13:09       ` Robert Greener
  0 siblings, 0 replies; 16+ messages in thread
From: Robert Greener @ 2022-07-08 13:09 UTC (permalink / raw
  To: Alessandro Barbieri, Anna “CyberTailor”; +Cc: gentoo-guru

On Thu, 2022-07-07 at 09:17 +0200, Alessandro Barbieri wrote:
> > Multiple SRC_URI doesn't work as fallback. You need a custom
> > src_fetch
> > function instead.
> > 
> > 
> I like this idea, any downsides?

Yes. It means that it would be a live ebuild, and we couldn't benefit
from the manifest, so it's a bit of a pain.

Check out v2 of the patch
(message id: 20220706122142.125975-1-me@r0bert.dev)
and see what you think.

In the updated patch, I define a variable CRAN_UPD_DATE that uses
snapshots of cran so the link never dies.

--
Robert


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [gentoo-guru] Re: [RFC PATCH v2 1/4] eclass/R-packages: Add CRAN_PV
  2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 1/4] eclass/R-packages: Add CRAN_PV Robert Greener
@ 2022-07-11  5:04     ` Alessandro Barbieri
  0 siblings, 0 replies; 16+ messages in thread
From: Alessandro Barbieri @ 2022-07-11  5:04 UTC (permalink / raw
  To: Robert Greener; +Cc: gentoo-guru, Anna “CyberTailor”

[-- Attachment #1: Type: text/plain, Size: 1207 bytes --]

Il Mer 6 Lug 2022, 14:22 Robert Greener <me@r0bert.dev> ha scritto:

> Add a variable CRAN_PV which defaults to PV, but can be overridden in
> the ebuild. This is useful for the case where the version number is
> something like "1.2-24" as it often is with R packages, this would mean
> that a variable like "CRAN_PV=$(ver_rs 2 -)" could be defined in the
> ebuild, which is used in the SRC_URI of the eclass. If CRAN_PV isn't
> defined, it just defaults to PV.
>
> Signed-off-by: Robert Greener <me@r0bert.dev>
> ---
>  eclass/R-packages.eclass | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass
> index aed8cce84..982920f43 100644
> --- a/eclass/R-packages.eclass
> +++ b/eclass/R-packages.eclass
> @@ -21,7 +21,9 @@ esac
>
>  EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile
> src_install pkg_postinst
>
> -SRC_URI="mirror://cran/src/contrib/${PN}_${PV}.tar.gz"
> +CRAN_PV=${CRAN_PV:-$PV}
> +
> +SRC_URI="mirror://cran/src/contrib/${PN}_${CRAN_PV}.tar.gz"
>  HOMEPAGE="https://cran.r-project.org/package=${PN}"
>
>  SLOT="0"
> --
> 2.35.1
>

I have no strong opinions on this. If you find it useful, do it.

>

[-- Attachment #2: Type: text/html, Size: 2015 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [gentoo-guru] Re: [RFC PATCH v2 0/4] eclass/R-packages: improvements
  2022-07-06 12:21 ` [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements Robert Greener
                     ` (4 preceding siblings ...)
  2022-07-06 12:32   ` [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements Anna “CyberTailor”
@ 2022-07-11  5:06   ` Alessandro Barbieri
  2022-07-12 12:06   ` Robert Greener
  6 siblings, 0 replies; 16+ messages in thread
From: Alessandro Barbieri @ 2022-07-11  5:06 UTC (permalink / raw
  To: Robert Greener; +Cc: gentoo-guru, Anna “CyberTailor”

[-- Attachment #1: Type: text/plain, Size: 956 bytes --]

Il Mer 6 Lug 2022, 14:21 Robert Greener <me@r0bert.dev> ha scritto:

> Hello,
>
> Here is v2 of the improvements to eclass/R-packages. Thank you
> Alessandro and Anna for your comments.
>
> This time, I use the microsoft cran snapshots (MRAN), to download the
> package if CRAN_UPD_DATE is set. If this is not set, then CRAN is used
> as normal.
>
> The intention would be to update all packages in dev-R to use
> CRAN_UPD_DATE and then remove the if guard around this.
>
> What do you all think?
>
> --
> Robert
>
> Robert Greener (4):
>   eclass/R-packages: Add CRAN_PV
>   eclass/R-packages: Add CRAN_PN variable
>   eclass/R-packages: Add CRAN_UPD_DATE and use MRAN.
>   eclass/R-packages: Add Robert Greener (myself) as author
>
>  eclass/R-packages.eclass | 24 ++++++++++++++++++------
>  1 file changed, 18 insertions(+), 6 deletions(-)
>
> --
> 2.35.1
>

I prefer the name CRAN_SNAPSHOT_DATE but I will not force to use it if you
don't like it.

>

[-- Attachment #2: Type: text/html, Size: 1534 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [gentoo-guru] Re: [RFC PATCH v2 0/4] eclass/R-packages: improvements
  2022-07-06 12:21 ` [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements Robert Greener
                     ` (5 preceding siblings ...)
  2022-07-11  5:06   ` [gentoo-guru] " Alessandro Barbieri
@ 2022-07-12 12:06   ` Robert Greener
  6 siblings, 0 replies; 16+ messages in thread
From: Robert Greener @ 2022-07-12 12:06 UTC (permalink / raw
  To: gentoo-guru; +Cc: cyber, lssndrbarbieri

On Wed, 2022-07-06 at 13:21 +0100, Robert Greener wrote:
> Hello,
> 
> Here is v2 of the improvements to eclass/R-packages. Thank you
> Alessandro and Anna for your comments.
> 
> This time, I use the microsoft cran snapshots (MRAN), to download the
> package if CRAN_UPD_DATE is set. If this is not set, then CRAN is
> used
> as normal.
> 
> The intention would be to update all packages in dev-R to use
> CRAN_UPD_DATE and then remove the if guard around this.
> 
> What do you all think?
> 
> --
> Robert
> 
> Robert Greener (4):
>   eclass/R-packages: Add CRAN_PV
>   eclass/R-packages: Add CRAN_PN variable
>   eclass/R-packages: Add CRAN_UPD_DATE and use MRAN.
>   eclass/R-packages: Add Robert Greener (myself) as author
> 
>  eclass/R-packages.eclass | 24 ++++++++++++++++++------
>  1 file changed, 18 insertions(+), 6 deletions(-)
> 


Thanks for the comments all. I've merged the changes in the dev branch.

--
Robert


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-11-24 22:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20220705071539.2463760-1-me@r0bert.dev>
2022-07-05  7:16 ` [gentoo-guru] [RFC PATCH 2/3] eclass/R-packages: substitute _ with . in SRC_URI and HOMEPAGE Robert Greener
2022-07-06  0:49   ` Anna “CyberTailor”
2022-07-05  7:16 ` [gentoo-guru] [RFC PATCH 1/3] eclass/R-packages: Use src/contrib or src/contrib/Archive from main CRAN Robert Greener
2022-07-05  7:58   ` Anna “CyberTailor”
2022-07-07  7:17     ` Alessandro Barbieri
2022-07-08 13:09       ` Robert Greener
2022-07-05  7:16 ` [gentoo-guru] [RFC PATCH 3/3] eclass/R-packages: Add CRAN_PV Robert Greener
2022-07-06 12:21 ` [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements Robert Greener
2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 1/4] eclass/R-packages: Add CRAN_PV Robert Greener
2022-07-11  5:04     ` [gentoo-guru] " Alessandro Barbieri
2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 2/4] eclass/R-packages: Add CRAN_PN variable Robert Greener
2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 3/4] eclass/R-packages: Add CRAN_UPD_DATE and use MRAN Robert Greener
2022-07-06 12:21   ` [gentoo-guru] [RFC PATCH v2 4/4] eclass/R-packages: Add Robert Greener (myself) as author Robert Greener
2022-07-06 12:32   ` [gentoo-guru] [RFC PATCH v2 0/4] eclass/R-packages: improvements Anna “CyberTailor”
2022-07-11  5:06   ` [gentoo-guru] " Alessandro Barbieri
2022-07-12 12:06   ` Robert Greener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox