[rkward] /: Bookkeeping and cleanups

Thomas Friedrichsmeier null at kde.org
Mon Dec 30 15:05:29 GMT 2019


Git commit faf44e1c698dd8769aca54964fd9e103f75eab7c by Thomas Friedrichsmeier.
Committed on 30/12/2019 at 15:01.
Pushed by tfry into branch 'master'.

Bookkeeping and cleanups

M  +2    -0    ChangeLog
M  +0    -2    INSTALL
M  +0    -1    rkward/CMakeLists.txt
M  +0    -2    rkward/main.cpp
M  +0    -62   rkward/rbackend/FindR.cmake

https://commits.kde.org/rkward/faf44e1c698dd8769aca54964fd9e103f75eab7c

diff --git a/ChangeLog b/ChangeLog
index 35aa8e8c..0fd0ceff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
 --- Version 0.7.1 - UNRELEASED
+- Instead of installing rkward R packages at build time, install them at runtime, when needed     TODO: Testing, document removal of -DR_LIBDIR for packagers
+- Add new commandline option "--r-executable=auto" for auto-detection of R installation
 - Fixed: Underscore (_) was not accepted in names of newly created data.frames
 - <browser> element in save file mode gains checkbox to control overwriting of existing files
 - Fixed: <browser> element could not be set to not required
diff --git a/INSTALL b/INSTALL
index b17928b9..302efa68 100644
--- a/INSTALL
+++ b/INSTALL
@@ -34,8 +34,6 @@ In some cases you may want to set the following options:
 
 -DR_EXECUTABLE
 	path to the R executable. You may want to set this, if you have multiple versions of R installed, or R is not in your path. Example: -DR_EXECUTABLE=/usr/bin/R
--DR_LIBDIR
-	directory where R packages should be installed. Generally, this option is only of interest to packagers.
 -DR_HOME
 	R home directory. Almost certainly this option is not needed.
 -DR_INCLUDEDIR
diff --git a/rkward/CMakeLists.txt b/rkward/CMakeLists.txt
index a262089d..f8244eca 100644
--- a/rkward/CMakeLists.txt
+++ b/rkward/CMakeLists.txt
@@ -61,7 +61,6 @@ ENDIF()
 # We should switch with to target_compile_definitions once we require CMAKE 2.6+
 ADD_DEFINITIONS(-DR_EXECUTABLE="${R_EXECUTABLE}")
 ADD_DEFINITIONS(-DINSTALL_PATH="${CMAKE_INSTALL_PREFIX}")
-ADD_DEFINITIONS(-DR_LIBS="${R_LIBDIR}")
 SET_TARGET_PROPERTIES(rkward PROPERTIES
         MACOSX_BUNDLE_BUNDLE_NAME "RKWard")
 
diff --git a/rkward/main.cpp b/rkward/main.cpp
index d23e1d8c..c90234c1 100644
--- a/rkward/main.cpp
+++ b/rkward/main.cpp
@@ -319,8 +319,6 @@ int main (int argc, char *argv[]) {
 		qputenv ("PATH", QString ("%1/bin:%1/sbin:%2").arg (INSTALL_PATH).arg (oldpath).toLocal8Bit ());
 		if (RK_Debug::RK_Debug_Level > 3) qDebug ("Adjusting system path to %s", qPrintable (qgetenv ("PATH")));
 	}
-	// ensure that RKWard finds its own packages
-	qputenv ("R_LIBS", R_LIBS);
 	if (!qEnvironmentVariableIsSet ("DBUS_LAUNCHD_SESSION_BUS_SOCKET")) {
 		// try to ensure that DBus is running before trying to connect
 		QProcess::execute ("launchctl", QStringList () << "load" << "/Library/LaunchAgents/org.freedesktop.dbus-session.plist");
diff --git a/rkward/rbackend/FindR.cmake b/rkward/rbackend/FindR.cmake
index e8093360..063d0ed9 100644
--- a/rkward/rbackend/FindR.cmake
+++ b/rkward/rbackend/FindR.cmake
@@ -144,65 +144,3 @@ ELSE(NOT LIBR_BLAS)
 	MESSAGE(STATUS "Yes, ${LIBR_BLAS} exists")
 	SET(R_USED_LIBS ${R_USED_LIBS} Rblas)
 ENDIF(NOT LIBR_BLAS)
-
-# find R package library location
-IF(WIN32)
-	SET(PATH_SEP ";")
-ELSE(WIN32)
-	SET(PATH_SEP ":")
-ENDIF(WIN32)
-
-MESSAGE(STATUS "Checking for R package library location to use")
-IF(NOT R_LIBDIR)
-	EXECUTE_PROCESS(
-		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")
-ENDIF(NOT R_LIBDIR)
-
-# strip whitespace
-STRING(REGEX REPLACE "[ \n]+"
-	"" R_LIBDIR
-	"${R_LIBDIR}")
-
-# strip leading colon(s)
-STRING(REGEX REPLACE "^${PATH_SEP}+"
-	"" R_LIBDIR
-	"${R_LIBDIR}")
-
-# strip trailing colon(s)
-STRING(REGEX REPLACE "${PATH_SEP}+$"
-	"" R_LIBDIR
-	"${R_LIBDIR}")
-
-# find first path
-STRING(REGEX REPLACE "${PATH_SEP}"
-	" " R_LIBDIR
-	"${R_LIBDIR}")
-
-IF(NOT R_LIBDIR)
-	MESSAGE(STATUS "Not reliably determined or specified. Guessing.")
-	SET(R_LIBDIR ${R_HOME}/library)
-ENDIF(NOT R_LIBDIR)
-
-SET(R_LIBDIRS ${R_LIBDIR})
-SEPARATE_ARGUMENTS(R_LIBDIRS)
-
-SET(R_LIBDIR)
-FOREACH(CURRENTDIR ${R_LIBDIRS})
-	IF(NOT USE_R_LIBDIR)
-		IF(EXISTS ${CURRENTDIR})
-			SET(R_LIBDIR ${CURRENTDIR})
-			SET(USE_R_LIBDIR 1)
-		ELSE(EXISTS ${CURRENTDIR})
-			MESSAGE(STATUS "${CURRENTDIR} does not exist. Skipping")
-		ENDIF(EXISTS ${CURRENTDIR})
-	ENDIF(NOT USE_R_LIBDIR)
-ENDFOREACH(CURRENTDIR ${R_LIBDIRS})
-
-IF(NOT EXISTS ${R_LIBDIR})
-	MESSAGE(FATAL_ERROR "No existing library location found")
-ELSE(NOT EXISTS ${R_LIBDIR})
-	MESSAGE(STATUS "Will use ${R_LIBDIR}")
-ENDIF(NOT EXISTS ${R_LIBDIR})



More information about the rkward-tracker mailing list