-
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
88 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Generated from Tools/setup_rcpp_rinside.R.in | ||
# | ||
Sys.setenv(GITHUB_PAT = "@GITHUB_PAT@") | ||
Sys.setenv(RENV_PATHS_ROOT = "@MODULES_RENV_ROOT_PATH@") | ||
Sys.setenv(RENV_PATHS_CACHE = "@MODULES_RENV_CACHE_PATH@") | ||
Sys.setenv(RENV_PATHS_SANDBOX = "@RENV_SANDBOX@") | ||
Sys.setenv(JASPENGINE_LOCATION = "@JASP_ENGINE_PATH@/JASPEngine") | ||
|
||
if("@R_PKG_CELLAR_PATH@" != "") | ||
Sys.setenv(RENV_PATHS_CELLAR = "@R_PKG_CELLAR_PATH@") | ||
|
||
RENV_LIBRARY <- "@RENV_LIBRARY@" | ||
R_CPP_INCLUDES_LIBRARY <- "@R_CPP_INCLUDES_LIBRARY@" | ||
JASPMODULEINSTALLER_LIBRARY <- "@JASPMODULEINSTALLER_LIBRARY@" | ||
PKGDEPENDS_LIBRARY <- "@PKGDEPENDS_LIBRARY@" | ||
|
||
ENGINE <- file.path("@PROJECT_SOURCE_DIR@", "Engine") | ||
MODULES <- file.path("@PROJECT_SOURCE_DIR@", "Modules") | ||
TOOLS <- file.path("@PROJECT_SOURCE_DIR@", "Tools") | ||
|
||
# defines assignFunctionInRenv, getOS, and setupRenv | ||
source(file.path(ENGINE, "jaspModuleInstaller", "R", "renvOverrides.R")) | ||
|
||
mkdir <- function(paths) { | ||
for (path in paths) | ||
if (!dir.exists(path)) | ||
dir.create(path, recursive = TRUE) | ||
} | ||
|
||
mkdir(c(RENV_LIBRARY, R_CPP_INCLUDES_LIBRARY, JASPMODULEINSTALLER_LIBRARY)) | ||
|
||
# used by renv | ||
options( | ||
install.opts = "--no-multiarch --no-docs --no-test-load", | ||
# these two could be added to setupRenv | ||
renv.config.install.verbose = TRUE, | ||
renv.config.ppm.default = TRUE | ||
) | ||
|
||
.libPaths(RENV_LIBRARY) | ||
sandboxPaths <- renv:::renv_sandbox_activate() | ||
|
||
#to fix flatpak issue cleaning up on interrupt | ||
if (@IS_FLATPAK_USED@) { | ||
system2(command="chmod", args=c("-R", "777", "@RENV_LIBRARY@/../")) | ||
} | ||
|
||
cat("Using sandbox paths:\n") | ||
for (path in sandboxPaths) | ||
cat(" ", path, "\n", sep = "") | ||
|
||
cat("Restoring Rcpp & RInside\n") | ||
setupRenv(R_CPP_INCLUDES_LIBRARY) | ||
renv::restore( | ||
library = R_CPP_INCLUDES_LIBRARY, | ||
lockfile = file.path(MODULES, "Rcpp_RInside.lock"), | ||
clean = TRUE | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters