cran4linux / sysreqs

System Requirements for R Packages
GNU General Public License v2.0
2 stars 0 forks source link

Add Bioc packages #1

Open Enchufa2 opened 10 months ago

Enchufa2 commented 10 months ago
eddelbuettel commented 10 months ago

Here is what r2u does:

https://github.com/eddelbuettel/r2u/blob/cae4998b43a4f663ef75f55c18a4839e2cabb237/R/init.R#L193-L219

## also:
##
## db <- available.packages(repos = BiocManager::repositories())
## deps <- tools::package_dependencies("Rgraphviz", db, recursive=TRUE)

## cf  contrib.url(BiocManager::repositories())
##     [1] "https://bioconductor.org/packages/3.14/bioc/src/contrib"
##     [2] "https://bioconductor.org/packages/3.14/data/annotation/src/contrib"
##     [3] "https://bioconductor.org/packages/3.14/data/experiment/src/contrib"
biocrepo <- paste0("https://bioconductor.org/packages/", .getConfig("bioc_version"), "/bioc")
apBIOC <- data.table(ap="Bioc", as.data.frame(available.packages(repos=biocrepo)))
biocdataannrepo <- paste0("https://bioconductor.org/packages/", .getConfig("bioc_version"), "/data/annotation")
apBIOCdataann <- data.table(ap="Bioc", as.data.frame(available.packages(repos=biocdataannrepo)))
apBIOC <- merge(apBIOC, apBIOCdataann, all=TRUE)
biocdataexprepo <- paste0("https://bioconductor.org/packages/", .getConfig("bioc_version"), "/data/experiment")
apBIOCdataexp <- data.table(ap="Bioc", as.data.frame(available.packages(repos=biocdataexprepo)))
apBIOC <- merge(apBIOC, apBIOCdataexp, all=TRUE)

## the returned set is tools::CRAN_package_db() and _not_ dependent on the distribution name
ppmrepo <- paste0("https://packagemanager.posit.co/all/__linux__/jammy/latest")
apPPM <- data.table(ap="CRAN", as.data.frame(available.packages(repos=ppmrepo)))
ap <- merge(apPPM, apBIOC, all=TRUE)

ap[, deb := paste0("r-", tolower(ap), "-", tolower(Package))]

apfile <- .defaultAPFile(TRUE)
saveRDS(ap, apfile)
Enchufa2 commented 10 months ago

The issue is that tools::CRAN_package_db returns much more info than utils::available.packages. In particular, I'm after the SystemRequirements field here.

eddelbuettel commented 10 months ago

Oh I am aware. But maybe other repositories just don't do you the favour of collating that. I grew it organically for the 250 or so BioC packages I built, and I understand the BioC folks looking after the binaries in their containers do the same. They asked about you the other day (as in: "any idea if there is a RH repo") and I sent them your way. Did they come knocking yet? (And yes I know RH != FC but "close".)

Enchufa2 commented 10 months ago

Yes, we're in contact. :)

@vjcitn @almahmoud Parsing all the DESCRIPTION files is easy and fast on your side. This could be a nice feature in addition to e.g. a new BiocManager::package_db(). Do you think you could provide this?