rstudio: build as electron app, add darwin support (#362637)

This commit is contained in:
Justin Bedő 2025-02-28 07:38:36 +11:00 committed by GitHub
commit 9c9e6f02cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 396 additions and 90 deletions

View File

@ -1,6 +1,7 @@
{
lib,
stdenv,
runCommand,
fetchzip,
fetchFromGitHub,
replaceVars,
@ -9,7 +10,7 @@
zlib,
openssl,
R,
libsForQt5,
fontconfig,
quarto,
libuuid,
hunspellDicts,
@ -21,16 +22,34 @@
yaml-cpp,
soci,
sqlite,
apple-sdk_11,
xcbuild,
nodejs,
npmHooks,
fetchNpmDeps,
yarn,
yarnConfigHook,
fetchYarnDeps,
zip,
git,
makeWrapper,
electron_33,
server ? false, # build server version
pam,
nixosTests,
}:
let
# Note: we shouldn't use the latest electron here, since the node-abi dependency might
# need to be updated every time the latest electron gets a new abi version number
electron = electron_33;
# unpack tarball containing electron's headers
electron-headers = runCommand "electron-headers" { } ''
mkdir -p $out
tar -C $out --strip-components=1 -xvf ${electron.headers}
'';
mathJaxSrc = fetchzip {
url = "https://s3.amazonaws.com/rstudio-buildtools/mathjax-27.zip";
hash = "sha256-J7SZK/9q3HcXTD7WFHxvh++ttuCd89Vc4SEBrUEU0AI=";
@ -53,6 +72,14 @@ let
d: !(lib.hasAttr "dictFileName" d && lib.elem d.dictFileName (map (d: d.dictFileName) largeDicts))
) hunspellDictionaries;
dictionaries = largeDicts ++ otherDicts;
# rstudio assumes quarto bundles pandoc into bin/tools/
quartoWrapper = runCommand "quarto-wrapper" { } ''
mkdir -p $out/bin/tools
ln -s ${lib.getExe pandoc} $out/bin/tools/pandoc
ln -s ${lib.getExe quarto} $out/bin/quarto
ln -s ${quarto}/share $out/share
'';
in
stdenv.mkDerivation rec {
pname = "RStudio";
@ -66,7 +93,7 @@ stdenv.mkDerivation rec {
src = fetchFromGitHub {
owner = "rstudio";
repo = "rstudio";
rev = "refs/tags/v${version}";
tag = "v${version}";
hash = "sha256-j258eW1MYQrB6kkpjyolXdNuwQ3zSWv9so4q0QLsZuw=";
};
@ -78,9 +105,14 @@ stdenv.mkDerivation rec {
nodejs
yarn
yarnConfigHook
zip
git
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ]
++ lib.optionals (!server) [
libsForQt5.wrapQtAppsHook
(nodejs.python.withPackages (ps: [ ps.setuptools ]))
npmHooks.npmConfigHook
makeWrapper
];
buildInputs =
@ -94,30 +126,30 @@ stdenv.mkDerivation rec {
soci
sqlite.dev
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_11 ]
++ lib.optionals server [ pam ]
++ lib.optionals (!server) [
libsForQt5.qtbase
libsForQt5.qtxmlpatterns
libsForQt5.qtsensors
libsForQt5.qtwebengine
libsForQt5.qtwebchannel
];
++ lib.optionals (!server) [ fontconfig ];
cmakeFlags =
[
(lib.cmakeFeature "RSTUDIO_TARGET" (if server then "Server" else "Desktop"))
(lib.cmakeFeature "RSTUDIO_TARGET" (if server then "Server" else "Electron"))
(lib.cmakeBool "RSTUDIO_USE_SYSTEM_SOCI" true)
(lib.cmakeBool "RSTUDIO_USE_SYSTEM_BOOST" true)
(lib.cmakeBool "RSTUDIO_USE_SYSTEM_YAML_CPP" true)
(lib.cmakeBool "RSTUDIO_DISABLE_CHECK_FOR_UPDATES" true)
(lib.cmakeBool "QUARTO_ENABLED" true)
(lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/lib/rstudio")
(lib.cmakeBool "RSTUDIO_CRASHPAD_ENABLED" false) # This is a NOOP except on x86_64-darwin
(lib.cmakeFeature "CMAKE_INSTALL_PREFIX" (
(placeholder "out") + (if stdenv.isDarwin then "/Applications" else "/lib/rstudio")
))
]
++ lib.optionals (!server) [
(lib.cmakeFeature "QT_QMAKE_EXECUTABLE" "${libsForQt5.qmake}/bin/qmake")
(lib.cmakeBool "RSTUDIO_INSTALL_FREEDESKTOP" true)
(lib.cmakeBool "RSTUDIO_INSTALL_FREEDESKTOP" stdenv.hostPlatform.isLinux)
];
# on Darwin, cmake uses find_library to locate R instead of using the PATH
env.NIX_LDFLAGS = "-L${R}/lib/R/lib";
patches = [
# Hack RStudio to only use the input R and provided libclang.
(replaceVars ./r-location.patch {
@ -130,8 +162,10 @@ stdenv.mkDerivation rec {
./fix-resources-path.patch
./ignore-etc-os-release.patch
./dont-yarn-install.patch
./dont-assume-pandoc-in-quarto.patch
./boost-1.86.patch
./fix-darwin.patch
# needed for rebuilding for later electron versions
./update-nan-and-node-abi.patch
];
postPatch = ''
@ -151,6 +185,21 @@ stdenv.mkDerivation rec {
dontYarnInstallDeps = true; # will call manually in preConfigure
npmRoot = "src/node/desktop";
# don't build native modules with node headers
npmFlags = [ "--ignore-scripts" ];
npmDeps = fetchNpmDeps {
name = "rstudio-${version}-npm-deps";
inherit src;
patches = [ ./update-nan-and-node-abi.patch ];
postPatch = "cd ${npmRoot}";
hash = "sha256-CtHCN4sWeHNDd59TV/TgTC4d6h7X1Cl4E/aJkAfRk7g=";
};
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
preConfigure = ''
# set up node_modules directory inside quarto so that panmirror can be built
mkdir src/gwt/lib/quarto
@ -170,36 +219,90 @@ stdenv.mkDerivation rec {
done
done
ln -s ${quarto} dependencies/quarto
ln -s ${quartoWrapper} dependencies/quarto
# version in dependencies/common/install-mathjax
ln -s ${mathJaxSrc} dependencies/mathjax-27
# version in CMakeGlobals.txt (PANDOC_VERSION)
mkdir -p dependencies/pandoc/2.18
ln -s ${lib.getBin pandoc}/bin/* dependencies/pandoc/2.18
# version in CMakeGlobals.txt (RSTUDIO_INSTALLED_NODE_VERSION)
mkdir -p dependencies/common/node
# node used by cmake
# version in CMakeGlobals.txt (RSTUDIO_NODE_VERSION)
ln -s ${nodejs} dependencies/common/node/18.18.2
# node used at runtime
# version in CMakeGlobals.txt (RSTUDIO_INSTALLED_NODE_VERSION)
ln -s ${nodejs} dependencies/common/node/18.20.3
${lib.optionalString (!server) ''
pushd $npmRoot
substituteInPlace package.json \
--replace-fail "npm ci && " ""
# use electron's headers to make node-gyp compile against the electron ABI
export npm_config_nodedir="${electron-headers}"
### override the detected electron version
substituteInPlace node_modules/@electron-forge/core-utils/dist/electron-version.js \
--replace-fail "return version" "return '${electron.version}'"
### create the electron archive to be used by electron-packager
cp -r ${electron.dist} electron-dist
chmod -R u+w electron-dist
pushd electron-dist
zip -0Xqr ../electron.zip .
popd
rm -r electron-dist
# force @electron/packager to use our electron instead of downloading it
substituteInPlace node_modules/@electron/packager/src/index.js \
--replace-fail "await this.getElectronZipPath(downloadOpts)" "'$(pwd)/electron.zip'"
# Work around known nan issue for electron_33 and above
# https://github.com/nodejs/nan/issues/978
substituteInPlace node_modules/nan/nan.h \
--replace-fail '#include "nan_scriptorigin.h"' ""
# now that we patched everything, we still have to run the scripts we ignored with --ignore-scripts
npm rebuild
popd
''}
'';
postInstall = ''
mkdir -p $out/bin
${lib.optionalString server ''
${lib.optionalString (server && stdenv.hostPlatform.isLinux) ''
ln -s $out/lib/rstudio/bin/{crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server} $out/bin
''}
${lib.optionalString (!server) ''
ln -s $out/lib/rstudio/bin/{diagnostics,rpostback,rstudio} $out/bin
${lib.optionalString (!server && stdenv.hostPlatform.isLinux) ''
# remove unneeded electron files, since we'll wrap the app with our own electron
shopt -s extglob
rm -r $out/lib/rstudio/!(locales|resources|resources.pak)
makeWrapper ${lib.getExe electron} "$out/bin/rstudio" \
--add-flags "$out/lib/rstudio/resources/app/" \
--set-default ELECTRON_FORCE_IS_PACKAGED 1 \
--suffix PATH : ${lib.makeBinPath [ gnumake ]}
ln -s $out/lib/rstudio/resources/app/bin/{diagnostics,rpostback} $out/bin
''}
${lib.optionalString (server && stdenv.hostPlatform.isDarwin) ''
ln -s $out/Applications/RStudio.app/Contents/MacOS/{crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server} $out/bin
''}
${lib.optionalString (!server && stdenv.hostPlatform.isDarwin) ''
# electron can't find its files if we use a symlink here
makeWrapper $out/Applications/RStudio.app/Contents/MacOS/RStudio $out/bin/rstudio
ln -s $out/Applications/RStudio.app/Contents/Resources/app/bin/{diagnostics,rpostback} $out/bin
''}
'';
qtWrapperArgs = lib.optionals (!server) [
"--suffix PATH : ${lib.makeBinPath [ gnumake ]}"
];
passthru = {
inherit server;
tests = {
@ -208,15 +311,15 @@ stdenv.mkDerivation rec {
};
meta = {
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
description = "Set of integrated tools for the R language";
homepage = "https://www.rstudio.com/";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [
ciil
cfhammill
tomasajt
];
mainProgram = "rstudio" + lib.optionalString server "-server";
platforms = lib.platforms.linux;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
}

View File

@ -1,48 +0,0 @@
diff --git a/src/cpp/session/CMakeLists.txt b/src/cpp/session/CMakeLists.txt
index 0202e84..596b9f8 100644
--- a/src/cpp/session/CMakeLists.txt
+++ b/src/cpp/session/CMakeLists.txt
@@ -59,11 +59,7 @@ endif()
# install pandoc
-# - by default, we use quarto + quarto's bundled pandoc
-# - if quarto is not enabled, use pandoc fallback
-if(QUARTO_ENABLED)
- set(RSTUDIO_DEPENDENCIES_PANDOC_DIR "${RSTUDIO_DEPENDENCIES_QUARTO_DIR}/bin/tools")
-elseif(EXISTS "${RSTUDIO_TOOLS_ROOT}/pandoc/${PANDOC_VERSION}")
+if(EXISTS "${RSTUDIO_TOOLS_ROOT}/pandoc/${PANDOC_VERSION}")
set(RSTUDIO_DEPENDENCIES_PANDOC_DIR "${RSTUDIO_TOOLS_ROOT}/pandoc/${PANDOC_VERSION}")
else()
set(RSTUDIO_DEPENDENCIES_PANDOC_DIR "${RSTUDIO_DEPENDENCIES_DIR}/pandoc/${PANDOC_VERSION}")
@@ -733,11 +729,10 @@ if(NOT RSTUDIO_SESSION_WIN32 AND NOT RSESSION_ALTERNATE_BUILD)
PATTERN ".gitignore"
EXCLUDE)
endif()
- else()
- install(DIRECTORY "${RSTUDIO_DEPENDENCIES_PANDOC_DIR}/"
- DESTINATION "${RSTUDIO_INSTALL_BIN}/pandoc"
- USE_SOURCE_PERMISSIONS)
endif()
+ install(DIRECTORY "${RSTUDIO_DEPENDENCIES_PANDOC_DIR}/"
+ DESTINATION "${RSTUDIO_INSTALL_BIN}/pandoc"
+ USE_SOURCE_PERMISSIONS)
# install embedded packages
foreach(PKG ${RSTUDIO_EMBEDDED_PACKAGES})
diff --git a/src/cpp/session/include/session/SessionConstants.hpp b/src/cpp/session/include/session/SessionConstants.hpp
index e6aef22..57491ec 100644
--- a/src/cpp/session/include/session/SessionConstants.hpp
+++ b/src/cpp/session/include/session/SessionConstants.hpp
@@ -147,11 +147,7 @@
#define kSessionTmpDirEnvVar "RS_SESSION_TMP_DIR"
#define kSessionTmpDir "rstudio-rsession"
-#ifdef QUARTO_ENABLED
-# define kDefaultPandocPath "bin/quarto/bin/tools"
-#else
# define kDefaultPandocPath "bin/pandoc"
-#endif
#define kDefaultNodePath "bin/node"
#define kDefaultQuartoPath "bin/quarto"

View File

@ -0,0 +1,169 @@
diff --git a/CMakeGlobals.txt b/CMakeGlobals.txt
index 8868c44..19b2fa0 100644
--- a/CMakeGlobals.txt
+++ b/CMakeGlobals.txt
@@ -345,6 +345,7 @@ if (APPLE)
set(RSTUDIO_INSTALL_SUPPORTING RStudio.app/Contents/Resources/app)
# handles Quarto share when not stored alongside bin
set(RSTUDIO_INSTALL_RESOURCES RStudio.app/Contents/Resources)
+ set(RSTUDIO_INSTALL_ELECTRON .)
else()
set(RSTUDIO_INSTALL_BIN RStudio.app/Contents/MacOS)
set(RSTUDIO_INSTALL_SUPPORTING RStudio.app/Contents/Resources)
diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
index b47f04f..928165d 100644
--- a/src/cpp/CMakeLists.txt
+++ b/src/cpp/CMakeLists.txt
@@ -240,7 +240,7 @@ endif()
# determine whether we should statically link boost. we always do this
# unless we are building a non-packaged build on linux (in which case
# boost dynamic libraries are presumed to be installed on the system ldpath)
-if(APPLE OR WIN32 OR RSTUDIO_PACKAGE_BUILD)
+if(WIN32 OR RSTUDIO_PACKAGE_BUILD)
set(Boost_USE_STATIC_LIBS ON)
endif()
@@ -475,7 +475,7 @@ endif()
# find SOCI libraries
if(UNIX)
- if(NOT APPLE AND RSTUDIO_USE_SYSTEM_SOCI)
+ if(RSTUDIO_USE_SYSTEM_SOCI)
find_library(SOCI_CORE_LIB NAMES "libsoci_core.a" "soci_core" REQUIRED)
find_library(SOCI_SQLITE_LIB NAMES "libsoci_sqlite3.a" "soci_sqlite3" REQUIRED)
if(RSTUDIO_PRO_BUILD)
diff --git a/src/node/CMakeNodeTools.txt b/src/node/CMakeNodeTools.txt
index 43f7f63..8a35a16 100644
--- a/src/node/CMakeNodeTools.txt
+++ b/src/node/CMakeNodeTools.txt
@@ -27,17 +27,7 @@ endif()
# set cmake env vars for node (NODEJS) and node tools, like YARN, and NPM
-if(APPLE AND UNAME_M STREQUAL arm64)
-
- # make sure we're using arm64 binaries of node / npm for arm64 builds
- set(NODEJS
- "${CMAKE_CURRENT_LIST_DIR}/../../dependencies/common/node/${RSTUDIO_NODE_VERSION}-arm64/bin/node")
- set(NPM
- "${CMAKE_CURRENT_LIST_DIR}/../../dependencies/common/node/${RSTUDIO_NODE_VERSION}-arm64/bin/npm")
- set(NPX
- "${CMAKE_CURRENT_LIST_DIR}/../../dependencies/common/node/${RSTUDIO_NODE_VERSION}-arm64/bin/npx")
-
-else()
+if(true)
# Detect node.js, npm, and npx; use versions supplied by the dependency scripts
find_program(NODEJS
diff --git a/src/node/desktop/CMakeLists.txt b/src/node/desktop/CMakeLists.txt
index 2f4d929..9769143 100644
--- a/src/node/desktop/CMakeLists.txt
+++ b/src/node/desktop/CMakeLists.txt
@@ -119,22 +119,9 @@ if (APPLE)
# configure Info.plist
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
+endif()
- # copy sources to build directory. note that the build directory cannot
- # be the "true" CMake directory as some files are resolved relative to
- # the desktop project's relative path in the application structure
- set(ELECTRON_BUILD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../desktop-build-${UNAME_M}" CACHE INTERNAL "")
- file(REMOVE_RECURSE "${ELECTRON_BUILD_DIR}")
- file(MAKE_DIRECTORY "${ELECTRON_BUILD_DIR}")
- file(
- COPY "${CMAKE_CURRENT_SOURCE_DIR}/"
- DESTINATION "${ELECTRON_BUILD_DIR}/"
- REGEX "/.webpack$" EXCLUDE
- REGEX "/build$" EXCLUDE
- REGEX "/bin$" EXCLUDE
- REGEX "/out$" EXCLUDE
- REGEX "/node_modules$" EXCLUDE)
-else()
+if(true)
set(ELECTRON_BUILD_DIR "${ELECTRON_SOURCE_DIR}" CACHE INTERNAL "")
endif()
@@ -230,16 +217,21 @@ if(WIN32)
PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
DESTINATION "${RSTUDIO_INSTALL_BIN}")
-elseif(LINUX)
+elseif(LINUX OR APPLE)
- if(UNAME_M STREQUAL aarch64)
+ if(UNAME_M STREQUAL aarch64 OR UNAME_M STREQUAL arm64)
set(ELECTRON_ARCH arm64)
else()
set(ELECTRON_ARCH x64)
endif()
+ if(APPLE)
+ set(ELECTRON_PLATFORM darwin)
+ else()
+ set(ELECTRON_PLATFORM linux)
+ endif()
install(
- DIRECTORY "${ELECTRON_BUILD_DIR}/out/RStudio-linux-${ELECTRON_ARCH}/"
+ DIRECTORY "${ELECTRON_BUILD_DIR}/out/RStudio-${ELECTRON_PLATFORM}-${ELECTRON_ARCH}/"
DIRECTORY_PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
diff --git a/src/node/desktop/src/main/session-launcher.ts b/src/node/desktop/src/main/session-launcher.ts
index 615ca1e..a9c1624 100644
--- a/src/node/desktop/src/main/session-launcher.ts
+++ b/src/node/desktop/src/main/session-launcher.ts
@@ -89,27 +89,9 @@ function launchProcess(absPath: FilePath, argList: string[]): ChildProcess {
// DYLD_INSERT_LIBRARIES to inject the library we wish to use
const rHome = new FilePath(getenv('R_HOME'));
const rLib = rHome.completePath('lib/libR.dylib');
- const dyldArgs = [
- '-e', `DYLD_INSERT_LIBRARIES=${rLib.getAbsolutePath()}`,
- '-e', `DYLD_FALLBACK_LIBRARY_PATH=${dyldFallbackLibraryPath}`
- ];
-
- // launch via /usr/bin/arch, so we can control whether the OS requests
- // x86 or arm64 versions of the libraries in the launched rsession
- const path = absPath.getAbsolutePath();
- if (process.arch === 'arm64') {
- const fileInfo = execSync(`/usr/bin/file "${rLib}"`, { encoding: 'utf-8' });
- if (fileInfo.indexOf('arm64') === -1 && fileInfo.indexOf('x86_64') !== -1) {
- argList = ['-x86_64', ...dyldArgs, path, ...argList];
- absPath = new FilePath('/usr/bin/arch');
- } else {
- argList = ['-arm64', ...dyldArgs, path, ...argList];
- absPath = new FilePath('/usr/bin/arch');
- }
- } else {
- argList = ['-x86_64', ...dyldArgs, path, ...argList];
- absPath = new FilePath('/usr/bin/arch');
- }
+
+ env['DYLD_INSERT_LIBRARIES'] = rLib.getAbsolutePath();
+ env['DYLD_FALLBACK_LIBRARY_PATH'] = dyldFallbackLibraryPath;
}
const rsessionOptions = new LogOptions('rsession');
@@ -542,22 +524,6 @@ export class SessionLauncher {
}
}
- // on macOS, we need to look at R and figure out if we should be trying to run
- // with the arm64 session binary (rsession-arm64) or with the x64 session binary (rsession)
- if (app.isPackaged && process.platform === 'darwin' && process.arch === 'arm64') {
- const rHome = getenv('R_HOME');
- const rLibPath = `${rHome}/lib/libR.dylib`;
- logger().logDebug(`$ /usr/bin/file "${rLibPath}"`);
- const fileInfo = execSync(`/usr/bin/file "${rLibPath}"`, { encoding: 'utf-8' });
- logger().logDebug(fileInfo);
- if (fileInfo.indexOf('arm64') !== -1) {
- this.sessionPath = this.sessionPath.getParent().completeChildPath('rsession-arm64');
- logger().logDebug(`R is arm64; using ${this.sessionPath}`);
- } else {
- logger().logDebug(`R is x86_64; using ${this.sessionPath}`);
- }
- }
-
const sessionProc = launchProcess(this.sessionPath, argList);
sessionProc.on('error', (err) => {
// Unable to start rsession (at all)

View File

@ -1,23 +1,23 @@
diff --git a/src/cpp/core/r_util/REnvironmentPosix.cpp b/src/cpp/core/r_util/REnvironmentPosix.cpp
index dbc9a9a1..9a526a86 100644
index a4e964d49d..512707801b 100644
--- a/src/cpp/core/r_util/REnvironmentPosix.cpp
+++ b/src/cpp/core/r_util/REnvironmentPosix.cpp
@@ -107,12 +107,9 @@ FilePath systemDefaultRScript(std::string* pErrMsg)
@@ -108,13 +108,7 @@ FilePath systemDefaultRScript(std::string* pErrMsg)
{
// check fallback paths
std::vector<std::string> rScriptPaths = {
- "/usr/bin/R",
- "/usr/local/bin/R",
- "/opt/local/bin/R",
+ "@R@/bin/R"
#ifdef __APPLE__
- #ifdef __APPLE__
- "/opt/homebrew/bin/R",
- "/Library/Frameworks/R.framework/Resources/bin/R",
+ "@R@/bin/R",
#endif
- #endif
+ "@R@/bin/R"
};
@@ -225,8 +222,7 @@ FilePath systemDefaultRScript(std::string* pErrMsg)
return scanForRScript(rScriptPaths, pErrMsg);
@@ -226,8 +220,7 @@ FilePath systemDefaultRScript(std::string* pErrMsg)
// scan in standard locations as a fallback
std::string scanErrMsg;
std::vector<std::string> rScriptPaths;
@ -27,4 +27,15 @@ index dbc9a9a1..9a526a86 100644
FilePath scriptPath = scanForRScript(rScriptPaths, &scanErrMsg);
if (scriptPath.isEmpty())
{
diff --git a/src/node/desktop/src/main/detect-r.ts b/src/node/desktop/src/main/detect-r.ts
index 5b768b7cbf..c0efeac0fe 100644
--- a/src/node/desktop/src/main/detect-r.ts
+++ b/src/node/desktop/src/main/detect-r.ts
@@ -305,6 +305,7 @@ writeLines(sep = "\x1F", c(
}
export function scanForR(): Expected<string> {
+ return ok('@R@/bin/R');
// if the RSTUDIO_WHICH_R environment variable is set, use that
// note that this does not pick up variables set in a user's bash profile, for example
const rstudioWhichR = getenv('RSTUDIO_WHICH_R');

View File

@ -0,0 +1,72 @@
diff --git a/src/node/desktop/package-lock.json b/src/node/desktop/package-lock.json
index 01c11edaf4..5e356470be 100644
--- a/src/node/desktop/package-lock.json
+++ b/src/node/desktop/package-lock.json
@@ -19,7 +19,7 @@
"line-reader": "0.4.0",
"lodash.debounce": "4.0.8",
"net-ipc": "2.1.0",
- "node-abi": "3.52.0",
+ "node-abi": "^3.71.0",
"node-addon-api": "7.0.0",
"node-system-fonts": "1.0.1",
"properties-reader": "2.3.0",
@@ -63,7 +63,7 @@
"json-schema-to-typescript": "13.1.1",
"lint-staged": "15.2.0",
"mocha": "10.2.0",
- "nan": "2.18.0",
+ "nan": "^2.22.0",
"node-loader": "2.0.0",
"nyc": "15.1.0",
"prettier": "3.1.1",
@@ -9768,9 +9768,10 @@
}
},
"node_modules/nan": {
- "version": "2.18.0",
- "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz",
- "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w=="
+ "version": "2.22.0",
+ "resolved": "https://registry.npmjs.org/nan/-/nan-2.22.0.tgz",
+ "integrity": "sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw==",
+ "license": "MIT"
},
"node_modules/nanoid": {
"version": "3.3.3",
@@ -9863,9 +9864,10 @@
}
},
"node_modules/node-abi": {
- "version": "3.52.0",
- "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.52.0.tgz",
- "integrity": "sha512-JJ98b02z16ILv7859irtXn4oUaFWADtvkzy2c0IAatNVX2Mc9Yoh8z6hZInn3QwvMEYhHuQloYi+TTQy67SIdQ==",
+ "version": "3.71.0",
+ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.71.0.tgz",
+ "integrity": "sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==",
+ "license": "MIT",
"dependencies": {
"semver": "^7.3.5"
},
diff --git a/src/node/desktop/package.json b/src/node/desktop/package.json
index 059c39f9d7..ca9066077d 100644
--- a/src/node/desktop/package.json
+++ b/src/node/desktop/package.json
@@ -59,7 +59,7 @@
"json-schema-to-typescript": "13.1.1",
"lint-staged": "15.2.0",
"mocha": "10.2.0",
- "nan": "2.18.0",
+ "nan": "^2.22.0",
"node-loader": "2.0.0",
"nyc": "15.1.0",
"process": "0.11.10",
@@ -83,7 +83,7 @@
"line-reader": "0.4.0",
"lodash.debounce": "4.0.8",
"net-ipc": "2.1.0",
- "node-abi": "3.52.0",
+ "node-abi": "^3.71.0",
"node-addon-api": "7.0.0",
"node-system-fonts": "1.0.1",
"properties-reader": "2.3.0",

View File

@ -3,7 +3,6 @@
R,
rstudio,
makeWrapper,
wrapQtAppsHook,
recommendedPackages,
packages,
fontconfig,
@ -14,7 +13,7 @@ runCommand (rstudio.name + "-wrapper")
preferLocalBuild = true;
allowSubstitutes = false;
nativeBuildInputs = [ (if rstudio.server then makeWrapper else wrapQtAppsHook) ];
nativeBuildInputs = [ makeWrapper ];
dontWrapQtApps = true;
buildInputs =
@ -56,7 +55,7 @@ runCommand (rstudio.name + "-wrapper")
else
''
ln -s ${rstudio}/share $out
makeQtWrapper ${rstudio}/bin/rstudio $out/bin/rstudio \
makeWrapper ${rstudio}/bin/rstudio $out/bin/rstudio \
--set R_PROFILE_USER $out/$fixLibsR
''
)

View File

@ -11063,7 +11063,7 @@ with pkgs;
wrapR = false;
};
rstudioWrapper = libsForQt5.callPackage ../development/r-modules/wrapper-rstudio.nix {
rstudioWrapper = callPackage ../development/r-modules/wrapper-rstudio.nix {
recommendedPackages = with rPackages; [
boot class cluster codetools foreign KernSmooth lattice MASS
Matrix mgcv nlme nnet rpart spatial survival