From 29fdc0ce2d98641fc1ae0ce3057dbc7fd1bdd3d6 Mon Sep 17 00:00:00 2001 From: Phil Dyer Date: Wed, 15 Sep 2021 11:09:17 +1000 Subject: [PATCH] rPackages: autoset bioconductor ver to match R ver BioConductor releases are tied to specific R releases. Updating the package set now automatically selects the correct version of bioconductor to match the current version of R. --- pkgs/development/r-modules/generate-r-packages.R | 9 ++++++++- pkgs/development/r-modules/generate-shell.nix | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/r-modules/generate-r-packages.R b/pkgs/development/r-modules/generate-r-packages.R index da9e0970b0f4..50b2d3b5f9ec 100755 --- a/pkgs/development/r-modules/generate-r-packages.R +++ b/pkgs/development/r-modules/generate-r-packages.R @@ -1,9 +1,16 @@ #!/usr/bin/env Rscript library(data.table) library(parallel) +library(BiocManager) cl <- makeCluster(10) -biocVersion <- 3.12 +biocVersion <- BiocManager:::.version_map() +biocVersion <- biocVersion[biocVersion$R == getRversion()[, 1:2],c("Bioc", "BiocStatus")] +if ("release" %in% biocVersion$BiocStatus) { + biocVersion <- as.numeric(as.character(biocVersion[biocVersion$BiocStatus == "release", "Bioc"])) +} else { + biocVersion <- max(as.numeric(as.character(biocVersion$Bioc))) +} snapshotDate <- Sys.Date()-1 mirrorUrls <- list( bioc=paste0("http://bioconductor.statistik.tu-dortmund.de/packages/", biocVersion, "/bioc/src/contrib/") diff --git a/pkgs/development/r-modules/generate-shell.nix b/pkgs/development/r-modules/generate-shell.nix index beb378275087..9719a61f4427 100644 --- a/pkgs/development/r-modules/generate-shell.nix +++ b/pkgs/development/r-modules/generate-shell.nix @@ -12,6 +12,7 @@ stdenv.mkDerivation { packages = with rPackages; [ data_table parallel + BiocManager ]; }) ];