nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1diff --git a/cmake/globals.cmake b/cmake/globals.cmake
2index 3601ee4..5090f32 100644
3--- a/cmake/globals.cmake
4+++ b/cmake/globals.cmake
5@@ -340,6 +340,7 @@ if (APPLE)
6 set(RSTUDIO_INSTALL_SUPPORTING RStudio.app/Contents/Resources/app)
7 # handles Quarto share when not stored alongside bin
8 set(RSTUDIO_INSTALL_RESOURCES RStudio.app/Contents/Resources)
9+ set(RSTUDIO_INSTALL_ELECTRON .)
10 else()
11 set(RSTUDIO_INSTALL_BIN RStudio.app/Contents/MacOS)
12 set(RSTUDIO_INSTALL_SUPPORTING RStudio.app/Contents/Resources)
13@@ -470,44 +471,6 @@ macro(add_stripped_executable _target)
14 define_source_file_names("${_target}")
15 endmacro(add_stripped_executable)
16
17-if(APPLE)
18-
19- # set Homebrew prefix directory
20- if(NOT DEFINED HOMEBREW_PREFIX)
21-
22- if(UNAME_M STREQUAL arm64)
23- set(HOMEBREW_PREFIX_FALLBACK /opt/homebrew)
24- else()
25- set(HOMEBREW_PREFIX_FALLBACK /usr/local)
26- endif()
27-
28- find_path(HOMEBREW_PREFIX
29- NAMES bin/brew
30- HINTS
31- "${HOMEBREW_PREFIX_FALLBACK}")
32-
33- message(STATUS "Using Homebrew: ${HOMEBREW_PREFIX}")
34-
35- endif()
36-
37- # help Boost find icu4c
38- if(RSTUDIO_USE_SYSTEM_BOOST)
39- link_directories(${HOMEBREW_PREFIX}/opt/icu4c/lib)
40- endif()
41-
42- # set OPENSSL_ROOT_DIR if unset
43- if(NOT DEFINED OPENSSL_ROOT_DIR)
44-
45- file(GLOB OPENSSL_ROOT_CANDIDATE "${HOMEBREW_PREFIX}/Cellar/openssl/*")
46- if(EXISTS "${OPENSSL_ROOT_CANDIDATE}")
47- set(OPENSSL_ROOT_DIR "${OPENSSL_ROOT_CANDIDATE}" CACHE INTERNAL "")
48- elseif(EXISTS "${HOMEBREW_PREFIX}/opt/openssl")
49- set(OPENSSL_ROOT_DIR "${HOMEBREW_PREFIX}/opt/openssl" CACHE INTERNAL "")
50- endif()
51-
52- endif()
53-
54-endif()
55
56 # If enabled, use caching for the build
57 if(SCCACHE_ENABLED)
58diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
59index 62688dd..f909f8d 100644
60--- a/src/cpp/CMakeLists.txt
61+++ b/src/cpp/CMakeLists.txt
62@@ -167,7 +167,7 @@ endif()
63 # determine whether we should statically link boost. we always do this
64 # unless we are building a non-packaged build on linux (in which case
65 # boost dynamic libraries are presumed to be installed on the system ldpath)
66-if(APPLE OR WIN32 OR RSTUDIO_PACKAGE_BUILD)
67+if(WIN32 OR RSTUDIO_PACKAGE_BUILD)
68 set(Boost_USE_STATIC_LIBS ON)
69 endif()
70
71@@ -304,7 +304,7 @@ endif()
72
73 # find SOCI libraries
74 if(UNIX)
75- if(NOT APPLE AND RSTUDIO_USE_SYSTEM_SOCI)
76+ if(RSTUDIO_USE_SYSTEM_SOCI)
77 find_library(SOCI_CORE_LIB NAMES "libsoci_core.a" "soci_core" REQUIRED)
78 find_library(SOCI_SQLITE_LIB NAMES "libsoci_sqlite3.a" "soci_sqlite3" REQUIRED)
79 if(RSTUDIO_PRO_BUILD)
80diff --git a/src/cpp/session/postback/CMakeLists.txt b/src/cpp/session/postback/CMakeLists.txt
81index 7bba997..4ef0abf 100644
82--- a/src/cpp/session/postback/CMakeLists.txt
83+++ b/src/cpp/session/postback/CMakeLists.txt
84@@ -36,6 +36,7 @@ add_stripped_executable(rpostback ${POSTBACK_SOURCE_FILES} ${POSTBACK_HEADER_FIL
85 # set link dependencies
86 target_link_libraries(rpostback
87 rstudio-core
88+ ${FOUNDATION_LIBRARY}
89 )
90
91 if (RSTUDIO_SERVER)
92diff --git a/src/node/CMakeNodeTools.txt b/src/node/CMakeNodeTools.txt
93index fb3f394..3595f87 100644
94--- a/src/node/CMakeNodeTools.txt
95+++ b/src/node/CMakeNodeTools.txt
96@@ -27,17 +27,7 @@ endif()
97
98 # set cmake env vars for node (NODEJS) and node tools, like YARN, and NPM
99
100-if(APPLE AND UNAME_M STREQUAL arm64)
101-
102- # make sure we're using arm64 binaries of node / npm for arm64 builds
103- set(NODEJS
104- "${CMAKE_CURRENT_LIST_DIR}/../../dependencies/common/node/${RSTUDIO_NODE_VERSION}-arm64/bin/node")
105- set(NPM
106- "${CMAKE_CURRENT_LIST_DIR}/../../dependencies/common/node/${RSTUDIO_NODE_VERSION}-arm64/bin/npm")
107- set(NPX
108- "${CMAKE_CURRENT_LIST_DIR}/../../dependencies/common/node/${RSTUDIO_NODE_VERSION}-arm64/bin/npx")
109-
110-else()
111+if(true)
112
113 # Detect node.js, npm, and npx; use versions supplied by the dependency scripts
114 find_program(NODEJS
115diff --git a/src/node/desktop/CMakeLists.txt b/src/node/desktop/CMakeLists.txt
116index bccf5b3..0cc798a 100644
117--- a/src/node/desktop/CMakeLists.txt
118+++ b/src/node/desktop/CMakeLists.txt
119@@ -236,16 +236,21 @@ if(WIN32)
120 install(FILES ${VCRUNTIME_X86_FILES} DESTINATION "${RSTUDIO_INSTALL_BIN}/x86")
121 install(FILES ${VCRUNTIME_X64_FILES} DESTINATION "${RSTUDIO_INSTALL_BIN}")
122
123-elseif(LINUX)
124+elseif(LINUX OR APPLE)
125
126- if(UNAME_M STREQUAL aarch64)
127+ if(UNAME_M STREQUAL aarch64 OR UNAME_M STREQUAL arm64)
128 set(ELECTRON_ARCH arm64)
129 else()
130 set(ELECTRON_ARCH x64)
131 endif()
132+ if(APPLE)
133+ set(ELECTRON_PLATFORM darwin)
134+ else()
135+ set(ELECTRON_PLATFORM linux)
136+ endif()
137
138 install(
139- DIRECTORY "${ELECTRON_BINARY_DIR}/out/RStudio-linux-${ELECTRON_ARCH}/"
140+ DIRECTORY "${ELECTRON_BINARY_DIR}/out/RStudio-${ELECTRON_PLATFORM}-${ELECTRON_ARCH}/"
141 DIRECTORY_PERMISSIONS
142 OWNER_READ OWNER_WRITE OWNER_EXECUTE
143 GROUP_READ GROUP_EXECUTE
144diff --git a/src/node/desktop/src/main/session-launcher.ts b/src/node/desktop/src/main/session-launcher.ts
145index d84de20..efef843 100644
146--- a/src/node/desktop/src/main/session-launcher.ts
147+++ b/src/node/desktop/src/main/session-launcher.ts
148@@ -85,29 +85,9 @@ function launchProcess(absPath: FilePath, argList: string[]): ChildProcess {
149 // DYLD_INSERT_LIBRARIES to inject the library we wish to use
150 const rHome = new FilePath(getenv('R_HOME'));
151 const rLib = rHome.completePath('lib/libR.dylib');
152- const dyldArgs = [
153- '-e',
154- `DYLD_INSERT_LIBRARIES=${rLib.getAbsolutePath()}`,
155- '-e',
156- `DYLD_FALLBACK_LIBRARY_PATH=${dyldFallbackLibraryPath}`,
157- ];
158-
159- // launch via /usr/bin/arch, so we can control whether the OS requests
160- // x86 or arm64 versions of the libraries in the launched rsession
161- const path = absPath.getAbsolutePath();
162- if (process.arch === 'arm64') {
163- const fileInfo = execSync(`/usr/bin/file "${rLib}"`, { encoding: 'utf-8' });
164- if (fileInfo.indexOf('arm64') === -1 && fileInfo.indexOf('x86_64') !== -1) {
165- argList = ['-x86_64', ...dyldArgs, path, ...argList];
166- absPath = new FilePath('/usr/bin/arch');
167- } else {
168- argList = ['-arm64', ...dyldArgs, path, ...argList];
169- absPath = new FilePath('/usr/bin/arch');
170- }
171- } else {
172- argList = ['-x86_64', ...dyldArgs, path, ...argList];
173- absPath = new FilePath('/usr/bin/arch');
174- }
175+
176+ env['DYLD_INSERT_LIBRARIES'] = rLib.getAbsolutePath();
177+ env['DYLD_FALLBACK_LIBRARY_PATH'] = dyldFallbackLibraryPath;
178 }
179
180 const rsessionOptions = new LogOptions('rsession');
181@@ -563,22 +543,6 @@ export class SessionLauncher {
182 }
183 }
184
185- // on macOS, we need to look at R and figure out if we should be trying to run
186- // with the arm64 session binary (rsession-arm64) or with the x64 session binary (rsession)
187- if (app.isPackaged && process.platform === 'darwin' && process.arch === 'arm64') {
188- const rHome = getenv('R_HOME');
189- const rLibPath = `${rHome}/lib/libR.dylib`;
190- logger().logDebug(`$ /usr/bin/file "${rLibPath}"`);
191- const fileInfo = execSync(`/usr/bin/file "${rLibPath}"`, { encoding: 'utf-8' });
192- logger().logDebug(fileInfo);
193- if (fileInfo.indexOf('arm64') !== -1) {
194- this.sessionPath = this.sessionPath.getParent().completeChildPath('rsession-arm64');
195- logger().logDebug(`R is arm64; using ${this.sessionPath}`);
196- } else {
197- logger().logDebug(`R is x86_64; using ${this.sessionPath}`);
198- }
199- }
200-
201 // if we're running automation tests, set that up now
202 if (app.commandLine.hasSwitch('run-automation')) {
203 argList.push('--run-automation');