Browse code

various hacks to get the source code updater to work for me

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/gmapR@110047 bc3139a8-67e5-0310-9ffc-ced21a209358

Michael Lawrence authored on 28/10/2015 20:56:15
Showing1 changed files

... ...
@@ -11,20 +11,19 @@
11 11
 # through svn).
12 12
 ##########################################################
13 13
 
14
-fixMakefile = function() {
14
+enableMaintainerMode = function() {
15 15
     mkfile = file.path("src/Makefile")
16 16
     txt = readLines(mkfile)
17 17
     txt2 = gsub("(--disable-maintainer-mode.*)", "\\\\ # \\1;", txt)
18 18
     writeLines(txt2, con = mkfile)
19 19
 }
20 20
 
21
-unfixMakefile = function() {
21
+disableMaintainerMode = function() {
22 22
     mkfile = file.path("src/Makefile")
23 23
     txt = readLines(mkfile)
24 24
     txt2 = gsub("\\\\ # (.*);", "\\1", txt)
25 25
     writeLines(txt2, con = mkfile)
26 26
 }
27
-    
28 27
 
29 28
 updateGMAPSrc <- function() {
30 29
 
... ...
@@ -60,13 +59,14 @@ updateGSTRUCTSrc <- function() {
60 59
   if (file.exists(extractDir)) {
61 60
     unlink(extractDir, recursive=TRUE)
62 61
   }
63
-  dir.create(extractDir)
62
+  dir.create(extractDir, recursive=TRUE)
64 63
   
65 64
   svnCheckoutDir <- .getSVNProj(projectSVNURL, extractDir)
66 65
   on.exit(unlink(svnCheckoutDir, recursive=TRUE), add=TRUE)
67 66
   setwd(svnCheckoutDir)
68
-  .bootstrapSVNCheckout(bootstrap.script)  
69
-  .configureSrc(program)
67
+  .bootstrapSVNCheckout(bootstrap.script)
68
+  samtoolsPath <- file.path(startingDir, "src", "samtools")
69
+  .configureSrc(program, samtoolsPath)
70 70
   .makeDist()
71 71
   .extractDistTarballIntoSrcDirectory(extractDir)
72 72
   invisible(TRUE)
... ...
@@ -107,12 +107,17 @@ updateGSTRUCTSrc <- function() {
107 107
   }
108 108
 }
109 109
 
110
-.configureSrc <- function(program) {
110
+.configureSrc <- function(program, samtoolsPath = NULL) {
111 111
   ##--with-gmapdb=${GMAPDB} --prefix=${PREFIX}
112 112
   ##configure. Set
113 113
   ##run a "make dist" to build a tarball
114 114
   command <- "./configure --disable-fulldist"
115
-  ##if (program == "gstruct") command <- paste(command, "--disable-binaries")
115
+  if (!is.null(samtoolsPath)) {
116
+      command <- paste0(command, " --with-samtools-lib=", samtoolsPath)
117
+  }
118
+  if (program == "gstruct") {
119
+      command <- paste(command, "--disable-binaries")
120
+  }
116 121
   if (!system(command) == 0) {
117 122
     stop("unable to configure")
118 123
   }
... ...
@@ -127,10 +132,7 @@ updateGSTRUCTSrc <- function() {
127 132
 }
128 133
 
129 134
 .makeDist <- function() {
130
-  ##run a "make dist" to build a tarball
131
-  if (!system("make distcheck") == 0) {
132
-    stop("unable to 'make dist'")
133
-  }  
135
+    system("make && make dist") ## possibly more robust than direct "make dist"
134 136
 }
135 137
 
136 138
 .extractDistTarballIntoSrcDirectory <- function(extractDir) {