[rkward/work/frameworks-Mac] /: FindR.cmake: don't source the user's .Rprofile
R.J.V. Bertin
null at kde.org
Wed May 17 19:42:55 UTC 2017
Git commit fe52ab7f569d97f213a42cfe2c3f50854a0a9a6c by R.J.V. Bertin.
Committed on 17/05/2017 at 17:46.
Pushed by rjvbb into branch 'work/frameworks-Mac'.
FindR.cmake: don't source the user's .Rprofile
The file may generate output which will confuse the script
A +54 -0 fwMac-patches/patch-FindR-no_user_profile.diff
M +6 -6 rkward/rbackend/FindR.cmake
https://commits.kde.org/rkward/fe52ab7f569d97f213a42cfe2c3f50854a0a9a6c
diff --git a/fwMac-patches/patch-FindR-no_user_profile.diff b/fwMac-patches/patch-FindR-no_user_profile.diff
new file mode 100644
index 00000000..22b666ef
--- /dev/null
+++ b/fwMac-patches/patch-FindR-no_user_profile.diff
@@ -0,0 +1,54 @@
+diff --git a/rkward/rbackend/FindR.cmake b/rkward/rbackend/FindR.cmake
+index 7ab4bb8..a97ee0c 100644
+--- a/rkward/rbackend/FindR.cmake
++++ b/rkward/rbackend/FindR.cmake
+@@ -14,7 +14,7 @@ ENDIF(R_EXECUTABLE-NOTFOUND)
+
+ # find out about R architecture (needed for some paths)
+ EXECUTE_PROCESS(
+- COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.version$arch)"
++ COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "--no-init-file" "-e" "cat(R.version$arch)"
+ OUTPUT_VARIABLE R_ARCH)
+ MESSAGE (STATUS "R architecture is ${R_ARCH}")
+
+@@ -22,11 +22,11 @@ MESSAGE (STATUS "R architecture is ${R_ARCH}")
+ SET (R_MIN_VERSION "2.10.0")
+ MESSAGE (STATUS "Checking R version")
+ EXECUTE_PROCESS(
+- COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "cat (paste(R.version$major, R.version$minor, sep='.'))"
++ COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "--no-init-file" "-e" "cat (paste(R.version$major, R.version$minor, sep='.'))"
+ OUTPUT_VARIABLE R_VERSION)
+ MESSAGE (STATUS "R version is ${R_VERSION}")
+ EXECUTE_PROCESS(
+- COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "min_ver <- '${R_MIN_VERSION}'; if (compareVersion ('${R_VERSION}', min_ver) < 0) cat ('At least R version', min_ver, 'is required')"
++ COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "--no-init-file" "-e" "min_ver <- '${R_MIN_VERSION}'; if (compareVersion ('${R_VERSION}', min_ver) < 0) cat ('At least R version', min_ver, 'is required')"
+ OUTPUT_VARIABLE R_VERSION_STATUS)
+ IF (R_VERSION_STATUS)
+ MESSAGE (FATAL_ERROR ${R_VERSION_STATUS})
+@@ -37,7 +37,7 @@ ENDIF (R_VERSION_STATUS)
+ MESSAGE(STATUS "Looking for R_HOME")
+ IF(NOT R_HOME)
+ EXECUTE_PROCESS(
+- COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home())"
++ COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "--no-init-file" "-e" "cat(R.home())"
+ OUTPUT_VARIABLE R_HOME)
+ ELSE(NOT R_HOME)
+ MESSAGE(STATUS "Specified by user")
+@@ -54,7 +54,7 @@ MESSAGE(STATUS "Looking for R include files")
+ IF(NOT R_INCLUDEDIR)
+ IF(WIN32 OR APPLE) # This version of the test will not work with R < 2.9.0, but the other version (in the else part) will not work on windows or apple (but we do not really need to support ancient versions of R, there).
+ EXECUTE_PROCESS(
+- COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home('include'))"
++ COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "--no-init-file" "-e" "cat(R.home('include'))"
+ OUTPUT_VARIABLE R_INCLUDEDIR)
+ ELSE(WIN32 OR APPLE)
+ EXECUTE_PROCESS(
+@@ -151,7 +151,7 @@ ENDIF(WIN32)
+ MESSAGE(STATUS "Checking for R package library location to use")
+ IF(NOT R_LIBDIR)
+ EXECUTE_PROCESS(
+- COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "cat(paste(unique (c(.Library.site, .Library)), collapse='${PATH_SEP}'))"
++ COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "--no-init-file" "-e" "cat(paste(unique (c(.Library.site, .Library)), collapse='${PATH_SEP}'))"
+ OUTPUT_VARIABLE R_LIBDIR)
+ ELSE(NOT R_LIBDIR)
+ MESSAGE(STATUS "Location specified by user")
diff --git a/rkward/rbackend/FindR.cmake b/rkward/rbackend/FindR.cmake
index 7ab4bb81..a97ee0c7 100644
--- a/rkward/rbackend/FindR.cmake
+++ b/rkward/rbackend/FindR.cmake
@@ -14,7 +14,7 @@ ENDIF(R_EXECUTABLE-NOTFOUND)
# find out about R architecture (needed for some paths)
EXECUTE_PROCESS(
- COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.version$arch)"
+ COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "--no-init-file" "-e" "cat(R.version$arch)"
OUTPUT_VARIABLE R_ARCH)
MESSAGE (STATUS "R architecture is ${R_ARCH}")
@@ -22,11 +22,11 @@ MESSAGE (STATUS "R architecture is ${R_ARCH}")
SET (R_MIN_VERSION "2.10.0")
MESSAGE (STATUS "Checking R version")
EXECUTE_PROCESS(
- COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "cat (paste(R.version$major, R.version$minor, sep='.'))"
+ COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "--no-init-file" "-e" "cat (paste(R.version$major, R.version$minor, sep='.'))"
OUTPUT_VARIABLE R_VERSION)
MESSAGE (STATUS "R version is ${R_VERSION}")
EXECUTE_PROCESS(
- COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "min_ver <- '${R_MIN_VERSION}'; if (compareVersion ('${R_VERSION}', min_ver) < 0) cat ('At least R version', min_ver, 'is required')"
+ COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "--no-init-file" "-e" "min_ver <- '${R_MIN_VERSION}'; if (compareVersion ('${R_VERSION}', min_ver) < 0) cat ('At least R version', min_ver, 'is required')"
OUTPUT_VARIABLE R_VERSION_STATUS)
IF (R_VERSION_STATUS)
MESSAGE (FATAL_ERROR ${R_VERSION_STATUS})
@@ -37,7 +37,7 @@ ENDIF (R_VERSION_STATUS)
MESSAGE(STATUS "Looking for R_HOME")
IF(NOT R_HOME)
EXECUTE_PROCESS(
- COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home())"
+ COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "--no-init-file" "-e" "cat(R.home())"
OUTPUT_VARIABLE R_HOME)
ELSE(NOT R_HOME)
MESSAGE(STATUS "Specified by user")
@@ -54,7 +54,7 @@ MESSAGE(STATUS "Looking for R include files")
IF(NOT R_INCLUDEDIR)
IF(WIN32 OR APPLE) # This version of the test will not work with R < 2.9.0, but the other version (in the else part) will not work on windows or apple (but we do not really need to support ancient versions of R, there).
EXECUTE_PROCESS(
- COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home('include'))"
+ COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "--no-init-file" "-e" "cat(R.home('include'))"
OUTPUT_VARIABLE R_INCLUDEDIR)
ELSE(WIN32 OR APPLE)
EXECUTE_PROCESS(
@@ -151,7 +151,7 @@ ENDIF(WIN32)
MESSAGE(STATUS "Checking for R package library location to use")
IF(NOT R_LIBDIR)
EXECUTE_PROCESS(
- COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "cat(paste(unique (c(.Library.site, .Library)), collapse='${PATH_SEP}'))"
+ COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "--no-init-file" "-e" "cat(paste(unique (c(.Library.site, .Library)), collapse='${PATH_SEP}'))"
OUTPUT_VARIABLE R_LIBDIR)
ELSE(NOT R_LIBDIR)
MESSAGE(STATUS "Location specified by user")
More information about the rkward-tracker
mailing list