FS#74850 - [r] add provides for some built-in R packages

Attached to Project: Community Packages
Opened by Hans (sukanka) - Wednesday, 25 May 2022, 15:31 GMT
Last edited by Antonio Rojas (arojas) - Thursday, 26 May 2022, 21:20 GMT
Task Type Support Request
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Currently, the r package in the repository contains the following package
```
➜ ~ pacman -Ql r | grep R/library | cut -d'/' -f6 | uniq |sort
base
boot
class
cluster
codetools
compiler
datasets
foreign
graphics
grDevices
grid
KernSmooth
lattice
MASS
Matrix
methods
mgcv
nlme
nnet
parallel
rpart
spatial
splines
stats
stats4
survival
tcltk
tools
translations
utils
```
Some of them in CRAN are listed separately and can be updated separately. for example,
[MASS](https://cran.r-project.org/web/packages/MASS/index.html)
they are highlighted when they are shown as dependencies, see also MASS, and have a look at
> Suggests: lattice, nlme, nnet, survival

they are highlited and can be updated separately, it also depends on `stats, utils` which is bundled in R.

I suggest that add the following provides in `r` (add prefix `r-`)
```
base
compiler
datasets
graphics
grDevices
grid
methods
parallel
splines
stats
stats4
survival
tcltk
tools
translations
utils
```
and the following can be added to provides (add prefix `r-`), or deleted from the built r package and packed separately (add prefix `r-`).
```
boot
class
cluster
codetools
foreign
lattice
KernSmooth
MASS
Matrix
mgcv
nlme
nnet
rpart
spatial
```
Then it will become much easier to package an R package in AUR or any other repository.

Additional info:
* package version(s)
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:
This task depends upon

Closed by  Antonio Rojas (arojas)
Thursday, 26 May 2022, 21:20 GMT
Reason for closing:  Implemented
Additional comments about closing:  r 4.2.0-4
Comment by Antonio Rojas (arojas) - Wednesday, 25 May 2022, 20:23 GMT
I don't understand what the problem is. Can't these simply not be specified in the package dependencies since they are provided by R itself?
Comment by Allan McRae (Allan) - Wednesday, 25 May 2022, 23:51 GMT
I guess this is for automatic tools that create PKGBUILDs and add dependencies from the CRAN details? While the helpers could detect those packages and depend on R, there is a need for version information in the provides which is more difficult.

I guess these could be automatically added to provides in the package() function by grepping over /usr/lib/R/library/*/DESCRIPTION to get the version number?
Comment by Hans (sukanka) - Thursday, 26 May 2022, 01:16 GMT
Right, this is for automatic tools. I was previously doing it manually and was not aware of this, so many dependencies can't be found. When I'm finally aware of it, I feel it could be better to add these provides in r.
BTW, I found a script that can deal with these automatically, see https://github.com/hubutui/pkgbuild-generator-for-r

The version information for the provides can automatically be obtained by, for example, `MASS`
```
_cranver=$(grep Version /usr/lib/R/library/MASS/DESCRIPTION | cut -d' ' -f2)
```
which gives `7.3-56`, and ${_cranver//[:-]/.} is `7.3.56`

Loading...