From afa892195222cb90f0264f527c0864cf78c05176 Mon Sep 17 00:00:00 2001 From: "Andre L. Martins" Date: Tue, 14 Oct 2014 16:41:20 +0100 Subject: [PATCH] Improve twoBit R interface compilation - Add missing symlinks for twobit.h twobit.c (and drop them from .gitignore) - Add Roxygen script to support roxygen2 systems (> 4.0) --- .gitignore | 2 -- Makefile | 2 +- Roxygen | 30 ++++++++++++++++++++++++++++++ pkg/src/twobit.c | 1 + pkg/src/twobit.h | 1 + 5 files changed, 33 insertions(+), 3 deletions(-) create mode 100755 Roxygen create mode 120000 pkg/src/twobit.c create mode 120000 pkg/src/twobit.h diff --git a/.gitignore b/.gitignore index 6424f0c..a099ccb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -pkg/src/twobit.c -pkg/src/twobit.h *.roxygen 2bit_ls test diff --git a/Makefile b/Makefile index e5da1d5..200f6d0 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/Roxygen b/Roxygen new file mode 100755 index 0000000..6c953f7 --- /dev/null +++ b/Roxygen @@ -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) diff --git a/pkg/src/twobit.c b/pkg/src/twobit.c new file mode 120000 index 0000000..0df528e --- /dev/null +++ b/pkg/src/twobit.c @@ -0,0 +1 @@ +../../twobit.c \ No newline at end of file diff --git a/pkg/src/twobit.h b/pkg/src/twobit.h new file mode 120000 index 0000000..afd4a0e --- /dev/null +++ b/pkg/src/twobit.h @@ -0,0 +1 @@ +../../twobit.h \ No newline at end of file