···96969797## Updating the package set {#updating-the-package-set}
98989999+There is a script and associated environment for regenerating the package
100100+sets and synchronising the rPackages tree to the current CRAN and matching
101101+BIOC release. These scripts are found in the `pkgs/development/r-modules`
102102+directory and executed as follows:
103103+99104```bash
100105nix-shell generate-shell.nix
101106···112117mv bioc-experiment-packages.nix.new bioc-experiment-packages.nix
113118```
114119115115-`generate-r-packages.R <repo>` reads `<repo>-packages.nix`, therefor the renaming.
120120+`generate-r-packages.R <repo>` reads `<repo>-packages.nix`, therefore
121121+the renaming.
116122117117-## Testing if the Nix-expression could be evaluated {#testing-if-the-nix-expression-could-be-evaluated}
118118-119119-```bash
120120-nix-build test-evaluation.nix --dry-run
121121-```
122122-123123-If this exits fine, the expression is ok. If not, you have to edit `default.nix`
123123+Some packages require overrides to specify external dependencies or other
124124+patches and special requirements. These overrides are specified in the
125125+`pkgs/development/r-modules/default.nix` file. As the `*-packages.nix`
126126+contents are automatically generated it should not be edited and broken
127127+builds should be addressed using overrides.
+12
pkgs/development/r-modules/generate-r-packages.R
···8282nix <- apply(pkgs, 1, function(p) formatPackage(p[1], p[2], p[18], p[4], p[5], p[6]))
8383write("done", stderr())
84848585+# Mark deleted packages as broken
8686+setkey(readFormatted, V2)
8787+markBroken <- function(name) {
8888+ str <- paste0(readFormatted[name], collapse='"')
8989+ if(sum(grep("broken = true;", str)))
9090+ return(str)
9191+ write(paste("marked", name, "as broken"), stderr())
9292+ gsub("};$", "broken = true; };", str)
9393+}
9494+broken <- lapply(setdiff(readFormatted[[2]], pkgs[[1]]), markBroken)
9595+8596cat("# This file is generated from generate-r-packages.R. DO NOT EDIT.\n")
8697cat("# Execute the following command to update the file.\n")
8798cat("#\n")
···95106cat(";\n")
96107cat("in with self; {\n")
97108cat(paste(nix, collapse="\n"), "\n", sep="")
109109+cat(paste(broken, collapse="\n"), "\n", sep="")
98110cat("}\n")
99111100112stopCluster(cl)