Skip to content

Commit

Permalink
Improve twoBit R interface compilation
Browse files Browse the repository at this point in the history
- Add missing symlinks for twobit.h twobit.c (and drop them from .gitignore)
- Add Roxygen script to support roxygen2 systems (> 4.0)
  • Loading branch information
andrelmartins committed Oct 14, 2014
1 parent 87e99aa commit afa8921
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
pkg/src/twobit.c
pkg/src/twobit.h
*.roxygen
2bit_ls
test
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ twobit.so: twobit.c

twoBit.pkg:
rm -Rf pkg.roxygen
R CMD roxygen pkg
(R CMD roxygen pkg)||(./Roxygen pkg)
R CMD INSTALL pkg.roxygen
30 changes: 30 additions & 0 deletions Roxygen
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/Rscript
library(methods)
library(utils)
library(roxygen2)

args <- commandArgs(TRUE)

sourcePath = args[1]

tmp = charToRaw(sourcePath)
if (tmp[length(tmp)] == charToRaw("/"))
tmp = tmp[1:(length(tmp) - 1)]
sourcePath = rawToChar(tmp)

output = paste(sourcePath, ".roxygen", sep='')

#
# stupid roxygen no longer supports separte output path
#
res = system(paste("mkdir", output), intern = FALSE, wait = TRUE)
if (res != 0)
stop("failed to create output folder")

res = system(paste("cp -Rf ", sourcePath, "/* ", output, sep=''), intern = FALSE, wait = TRUE)
if (res != 0)
stop("failed to copy input to output folder")

#roxygenize(sourcePath, output)
#roxygenize(output, output)
roxygenize(output)
1 change: 1 addition & 0 deletions pkg/src/twobit.c
1 change: 1 addition & 0 deletions pkg/src/twobit.h

0 comments on commit afa8921

Please sign in to comment.