···9697## Updating the package set {#updating-the-package-set}
980000099```bash
100nix-shell generate-shell.nix
101···112mv bioc-experiment-packages.nix.new bioc-experiment-packages.nix
113```
114115-`generate-r-packages.R <repo>` reads `<repo>-packages.nix`, therefor the renaming.
0116117-## Testing if the Nix-expression could be evaluated {#testing-if-the-nix-expression-could-be-evaluated}
118-119-```bash
120-nix-build test-evaluation.nix --dry-run
121-```
122-123-If this exits fine, the expression is ok. If not, you have to edit `default.nix`
···9697## Updating the package set {#updating-the-package-set}
9899+There is a script and associated environment for regenerating the package
100+sets and synchronising the rPackages tree to the current CRAN and matching
101+BIOC release. These scripts are found in the `pkgs/development/r-modules`
102+directory and executed as follows:
103+104```bash
105nix-shell generate-shell.nix
106···117mv bioc-experiment-packages.nix.new bioc-experiment-packages.nix
118```
119120+`generate-r-packages.R <repo>` reads `<repo>-packages.nix`, therefore
121+the renaming.
122123+Some packages require overrides to specify external dependencies or other
124+patches and special requirements. These overrides are specified in the
125+`pkgs/development/r-modules/default.nix` file. As the `*-packages.nix`
126+contents are automatically generated it should not be edited and broken
127+builds should be addressed using overrides.
00
+12
pkgs/development/r-modules/generate-r-packages.R
···82nix <- apply(pkgs, 1, function(p) formatPackage(p[1], p[2], p[18], p[4], p[5], p[6]))
83write("done", stderr())
840000000000085cat("# This file is generated from generate-r-packages.R. DO NOT EDIT.\n")
86cat("# Execute the following command to update the file.\n")
87cat("#\n")
···95cat(";\n")
96cat("in with self; {\n")
97cat(paste(nix, collapse="\n"), "\n", sep="")
098cat("}\n")
99100stopCluster(cl)
···82nix <- apply(pkgs, 1, function(p) formatPackage(p[1], p[2], p[18], p[4], p[5], p[6]))
83write("done", stderr())
8485+# Mark deleted packages as broken
86+setkey(readFormatted, V2)
87+markBroken <- function(name) {
88+ str <- paste0(readFormatted[name], collapse='"')
89+ if(sum(grep("broken = true;", str)))
90+ return(str)
91+ write(paste("marked", name, "as broken"), stderr())
92+ gsub("};$", "broken = true; };", str)
93+}
94+broken <- lapply(setdiff(readFormatted[[2]], pkgs[[1]]), markBroken)
95+96cat("# This file is generated from generate-r-packages.R. DO NOT EDIT.\n")
97cat("# Execute the following command to update the file.\n")
98cat("#\n")
···106cat(";\n")
107cat("in with self; {\n")
108cat(paste(nix, collapse="\n"), "\n", sep="")
109+cat(paste(broken, collapse="\n"), "\n", sep="")
110cat("}\n")
111112stopCluster(cl)