diff --git a/pkgs/applications/editors/rstudio/boost-1.86.patch b/pkgs/applications/editors/rstudio/boost-1.86.patch index ca7ca648e5b6..058eaf42e96d 100644 --- a/pkgs/applications/editors/rstudio/boost-1.86.patch +++ b/pkgs/applications/editors/rstudio/boost-1.86.patch @@ -1,8 +1,8 @@ diff --git a/src/cpp/core/json/JsonRpc.cpp b/src/cpp/core/json/JsonRpc.cpp -index d034ffecd7..4b08486517 100644 +index d034ffe..4b08486 100644 --- a/src/cpp/core/json/JsonRpc.cpp +++ b/src/cpp/core/json/JsonRpc.cpp -@@ -193,7 +193,7 @@ +@@ -193,7 +193,7 @@ void JsonRpcResponse::setAfterResponse( bool JsonRpcResponse::hasAfterResponse() const { @@ -11,3 +11,78 @@ index d034ffecd7..4b08486517 100644 } +diff --git a/src/cpp/session/modules/rmarkdown/NotebookExec.cpp b/src/cpp/session/modules/rmarkdown/NotebookExec.cpp +index 5631a1f..0e3030b 100644 +--- a/src/cpp/session/modules/rmarkdown/NotebookExec.cpp ++++ b/src/cpp/session/modules/rmarkdown/NotebookExec.cpp +@@ -193,7 +193,7 @@ void ChunkExecContext::connect() + + // leave an execution lock in this folder so it won't be moved if the notebook + // is saved while executing +- auto lock = make_unique( ++ auto lock = rstudio::core::make_unique( + FileLock::createDefault(), + outputPath_.completePath(kExecutionLock)); + locks_.push_back(std::move(lock)); +@@ -204,7 +204,7 @@ void ChunkExecContext::connect() + initializeOutput(); + + // capture conditions +- auto pConditionCapture = make_unique(); ++ auto pConditionCapture = rstudio::core::make_unique(); + pConditionCapture->connect(); + captures_.push_back(std::move(pConditionCapture)); + connections_.push_back(events().onCondition.connect( +@@ -234,7 +234,7 @@ void ChunkExecContext::connect() + boost::bind(&ChunkExecContext::onFileOutput, this, _1, _2, + _3, ChunkOutputPlot, _4))); + +- auto pPlotCapture = make_unique(); ++ auto pPlotCapture = rstudio::core::make_unique(); + if (figWidth > 0 || figHeight > 0) + { + // user specified plot size, use it +@@ -261,7 +261,7 @@ void ChunkExecContext::connect() + boost::bind(&ChunkExecContext::onFileOutput, this, _1, _2, _3, + ChunkOutputHtml, 0))); + +- auto pHtmlCapture = make_unique(); ++ auto pHtmlCapture = rstudio::core::make_unique(); + error = pHtmlCapture->connectHtmlCapture( + outputPath_, + outputPath_.getParent().completePath(kChunkLibDir), +@@ -316,14 +316,14 @@ void ChunkExecContext::connect() + prevCharWidth_ = r::options::getOptionWidth(); + r::options::setOptionWidth(charWidth_); + +- auto pDirCapture = make_unique(); ++ auto pDirCapture = rstudio::core::make_unique(); + error = pDirCapture->connectDir(docId_, workingDir_); + if (error) + LOG_ERROR(error); + captures_.push_back(std::move(pDirCapture)); + + // begin capturing errors +- auto pErrorCapture = make_unique(); ++ auto pErrorCapture = rstudio::core::make_unique(); + pErrorCapture->connect(); + captures_.push_back(std::move(pErrorCapture)); + +@@ -341,7 +341,7 @@ void ChunkExecContext::connect() + boost::bind(&ChunkExecContext::onFileOutput, this, _1, _2, _3, + ChunkOutputData, 0))); + +- auto pDataCapture = make_unique(); ++ auto pDataCapture = rstudio::core::make_unique(); + error = pDataCapture->connectDataCapture( + outputPath_, + options_.mergedOptions()); +@@ -661,7 +661,7 @@ void ChunkExecContext::initializeOutput() + + // leave an execution lock in this folder so it won't be moved if the notebook + // is saved while executing +- auto lock = make_unique( ++ auto lock = rstudio::core::make_unique( + FileLock::createDefault(), + outputPath.completePath(kExecutionLock)); + locks_.push_back(std::move(lock)); diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index 84e07c350a9f..5b8f9b09db74 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -55,13 +55,12 @@ let hash = "sha256-J7SZK/9q3HcXTD7WFHxvh++ttuCd89Vc4SEBrUEU0AI="; }; - # Ideally, rev should match the rstudio release name. - # e.g. release/rstudio-mountain-hydrangea + # rev should ideally be the last commit of the release/rstudio-[codename] branch quartoSrc = fetchFromGitHub { owner = "quarto-dev"; repo = "quarto"; - rev = "bb264a572c6331d46abcf087748c021d815c55d7"; - hash = "sha256-lZnZvioztbBWWa6H177X6rRrrgACx2gMjVFDgNup93g="; + rev = "7d1582d06250216d18696145879415e473a2ae4d"; + hash = "sha256-AaE9EDT3tJieI403QGxAf+A/PEw1rmUdhdpy4WNf40o="; }; hunspellDictionaries = lib.filter lib.isDerivation (lib.unique (lib.attrValues hunspellDicts)); @@ -83,7 +82,7 @@ let in stdenv.mkDerivation rec { pname = "RStudio"; - version = "2024.04.2+764"; + version = "2024.12.1+563"; RSTUDIO_VERSION_MAJOR = lib.versions.major version; RSTUDIO_VERSION_MINOR = lib.versions.minor version; @@ -94,7 +93,7 @@ stdenv.mkDerivation rec { owner = "rstudio"; repo = "rstudio"; tag = "v${version}"; - hash = "sha256-j258eW1MYQrB6kkpjyolXdNuwQ3zSWv9so4q0QLsZuw="; + hash = "sha256-fguomJHs7FBffYfMlgWgnjLWK3uDZYX4Ip4asKZ8XVQ="; }; nativeBuildInputs = @@ -159,7 +158,6 @@ stdenv.mkDerivation rec { libclang = lib.getLib llvmPackages.libclang; }) - ./fix-resources-path.patch ./ignore-etc-os-release.patch ./dont-yarn-install.patch ./boost-1.86.patch @@ -174,13 +172,13 @@ stdenv.mkDerivation rec { --replace-fail "''${CMAKE_INSTALL_PREFIX}/rstudio" "rstudio" # set install path of freedesktop files - substituteInPlace src/{cpp,node}/desktop/CMakeLists.txt \ + substituteInPlace src/node/desktop/CMakeLists.txt \ --replace-fail "/usr/share" "$out/share" ''; yarnOfflineCache = fetchYarnDeps { yarnLock = quartoSrc + "/yarn.lock"; - hash = "sha256-Qw8O1Jzl2EO0DEF3Jrw/cIT9t22zs3jyKgDA5XZbuGA="; + hash = "sha256-48Q2MkfzXZSL3ly56WSjRVwU3fgRD8xivQobStBkk6Y="; }; dontYarnInstallDeps = true; # will call manually in preConfigure @@ -190,12 +188,14 @@ stdenv.mkDerivation rec { # don't build native modules with node headers npmFlags = [ "--ignore-scripts" ]; + makeCacheWritable = true; + npmDeps = fetchNpmDeps { name = "rstudio-${version}-npm-deps"; inherit src; patches = [ ./update-nan-and-node-abi.patch ]; postPatch = "cd ${npmRoot}"; - hash = "sha256-CtHCN4sWeHNDd59TV/TgTC4d6h7X1Cl4E/aJkAfRk7g="; + hash = "sha256-9VHse+nxr5A1EWuszQ6cnJAMqYiHFqHQ4OJ/TJq+XoI="; }; env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; @@ -226,11 +226,13 @@ stdenv.mkDerivation rec { 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 + # version in cmake/globals.cmake (RSTUDIO_NODE_VERSION) + ln -s ${nodejs} dependencies/common/node/20.15.1 + # node used at runtime - # version in CMakeGlobals.txt (RSTUDIO_INSTALLED_NODE_VERSION) - ln -s ${nodejs} dependencies/common/node/18.20.3 + # version in cmake/globals.cmake (RSTUDIO_INSTALLED_NODE_VERSION) + # upstream uses the -patched suffix for the runtime node directory + ln -s ${nodejs} dependencies/common/node/20.15.1-patched ${lib.optionalString (!server) '' pushd $npmRoot @@ -256,7 +258,7 @@ stdenv.mkDerivation rec { rm -r electron-dist # force @electron/packager to use our electron instead of downloading it - substituteInPlace node_modules/@electron/packager/src/index.js \ + substituteInPlace node_modules/@electron/packager/dist/packager.js \ --replace-fail "await this.getElectronZipPath(downloadOpts)" "'$(pwd)/electron.zip'" # Work around known nan issue for electron_33 and above diff --git a/pkgs/applications/editors/rstudio/fix-darwin.patch b/pkgs/applications/editors/rstudio/fix-darwin.patch index fd66f1574f5a..d07ecc6e5056 100644 --- a/pkgs/applications/editors/rstudio/fix-darwin.patch +++ b/pkgs/applications/editors/rstudio/fix-darwin.patch @@ -1,8 +1,8 @@ -diff --git a/CMakeGlobals.txt b/CMakeGlobals.txt -index 8868c44..19b2fa0 100644 ---- a/CMakeGlobals.txt -+++ b/CMakeGlobals.txt -@@ -345,6 +345,7 @@ if (APPLE) +diff --git a/cmake/globals.cmake b/cmake/globals.cmake +index e53248b..c705d67 100644 +--- a/cmake/globals.cmake ++++ b/cmake/globals.cmake +@@ -334,6 +334,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) @@ -11,10 +11,10 @@ index 8868c44..19b2fa0 100644 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 +index 76f3acb..2910cee 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt -@@ -240,7 +240,7 @@ endif() +@@ -243,7 +243,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) @@ -23,7 +23,7 @@ index b47f04f..928165d 100644 set(Boost_USE_STATIC_LIBS ON) endif() -@@ -475,7 +475,7 @@ endif() +@@ -483,7 +483,7 @@ endif() # find SOCI libraries if(UNIX) @@ -33,7 +33,7 @@ index b47f04f..928165d 100644 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 +index 40ae0f3..756fd5f 100644 --- a/src/node/CMakeNodeTools.txt +++ b/src/node/CMakeNodeTools.txt @@ -27,17 +27,7 @@ endif() @@ -56,10 +56,10 @@ index 43f7f63..8a35a16 100644 # 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 +index 35438fd..f9b1951 100644 --- a/src/node/desktop/CMakeLists.txt +++ b/src/node/desktop/CMakeLists.txt -@@ -119,22 +119,9 @@ if (APPLE) +@@ -122,22 +122,9 @@ if (APPLE) # configure Info.plist configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) @@ -84,7 +84,7 @@ index 2f4d929..9769143 100644 set(ELECTRON_BUILD_DIR "${ELECTRON_SOURCE_DIR}" CACHE INTERNAL "") endif() -@@ -230,16 +217,21 @@ if(WIN32) +@@ -233,16 +220,21 @@ if(WIN32) PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION "${RSTUDIO_INSTALL_BIN}") @@ -110,16 +110,18 @@ index 2f4d929..9769143 100644 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 +index 94f56ac..fe7d5d9 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 { +@@ -91,29 +91,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}` +- '-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 @@ -144,7 +146,7 @@ index 615ca1e..a9c1624 100644 } const rsessionOptions = new LogOptions('rsession'); -@@ -542,22 +524,6 @@ export class SessionLauncher { +@@ -566,22 +546,6 @@ export class SessionLauncher { } } @@ -164,6 +166,6 @@ index 615ca1e..a9c1624 100644 - } - } - - const sessionProc = launchProcess(this.sessionPath, argList); - sessionProc.on('error', (err) => { - // Unable to start rsession (at all) + // if we're running automation tests, set that up now + if (app.commandLine.hasSwitch('run-automation')) { + argList.push('--run-automation'); diff --git a/pkgs/applications/editors/rstudio/fix-resources-path.patch b/pkgs/applications/editors/rstudio/fix-resources-path.patch deleted file mode 100644 index 24f8b3cb51b9..000000000000 --- a/pkgs/applications/editors/rstudio/fix-resources-path.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/src/cpp/desktop/DesktopOptions.cpp -+++ b/src/cpp/desktop/DesktopOptions.cpp -@@ -499,15 +499,9 @@ - { - if (resourcesPath_.isEmpty()) - { --#ifdef RSTUDIO_PACKAGE_BUILD - // release configuration: the 'resources' folder is - // part of the supporting files folder -- resourcesPath_ = supportingFilePath().completePath("resources"); --#else -- // developer configuration: the 'resources' folder is -- // a sibling of the RStudio executable -- resourcesPath_ = scriptsPath().completePath("resources"); --#endif -+ resourcesPath_ = supportingFilePath().completePath("resources"); - } - - return resourcesPath_; diff --git a/pkgs/applications/editors/rstudio/ignore-etc-os-release.patch b/pkgs/applications/editors/rstudio/ignore-etc-os-release.patch index 7c67edd16fcb..5dfa009546e2 100644 --- a/pkgs/applications/editors/rstudio/ignore-etc-os-release.patch +++ b/pkgs/applications/editors/rstudio/ignore-etc-os-release.patch @@ -1,10 +1,10 @@ -diff --git a/CMakeGlobals.txt b/CMakeGlobals.txt -index 5f96ffb..3f15687 100644 ---- a/CMakeGlobals.txt -+++ b/CMakeGlobals.txt -@@ -29,11 +29,6 @@ endif() - get_filename_component(ROOT_SRC_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) - set(CMAKE_MODULE_PATH "${ROOT_SRC_DIR}/cmake/modules/") +diff --git a/cmake/globals.cmake b/cmake/globals.cmake +index e53248b..179e3cb 100644 +--- a/cmake/globals.cmake ++++ b/cmake/globals.cmake +@@ -23,11 +23,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux) + set(LINUX TRUE CACHE INTERNAL "") + endif() -# read /etc/os-release -if(LINUX) @@ -45,7 +45,7 @@ index 81a9e1f..0000000 -endforeach() - diff --git a/package/linux/CMakeLists.txt b/package/linux/CMakeLists.txt -index 5d5c35e..a94f8fc 100644 +index 2c55ebe..7ac9651 100644 --- a/package/linux/CMakeLists.txt +++ b/package/linux/CMakeLists.txt @@ -16,7 +16,7 @@ diff --git a/pkgs/applications/editors/rstudio/update-nan-and-node-abi.patch b/pkgs/applications/editors/rstudio/update-nan-and-node-abi.patch index 7ba18405769a..bdb62dfa8a5e 100644 --- a/pkgs/applications/editors/rstudio/update-nan-and-node-abi.patch +++ b/pkgs/applications/editors/rstudio/update-nan-and-node-abi.patch @@ -1,72 +1,70 @@ diff --git a/src/node/desktop/package-lock.json b/src/node/desktop/package-lock.json -index 01c11edaf4..5e356470be 100644 +index a210521..9543abb 100644 --- a/src/node/desktop/package-lock.json +++ b/src/node/desktop/package-lock.json -@@ -19,7 +19,7 @@ +@@ -18,7 +18,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", + "net-ipc": "2.2.0", +- "node-abi": "3.71.0", ++ "node-abi": "^3.74.0", + "node-addon-api": "8.3.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 @@ +@@ -56,7 +56,7 @@ + "json-schema-to-typescript": "14.1.0", + "lint-staged": "15.2.10", + "mocha": "10.8.2", +- "nan": "2.22.0", ++ "nan": "^2.22.1", + "node-loader": "2.1.0", + "nyc": "17.1.0", + "prettier": "3.3.3", +@@ -9538,9 +9538,9 @@ } }, "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" +- "version": "2.22.0", +- "resolved": "https://registry.npmjs.org/nan/-/nan-2.22.0.tgz", +- "integrity": "sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw==", ++ "version": "2.22.1", ++ "resolved": "https://registry.npmjs.org/nan/-/nan-2.22.1.tgz", ++ "integrity": "sha512-pfRR4ZcNTSm2ZFHaztuvbICf+hyiG6ecA06SfAxoPmuHjvMu0KUIae7Y8GyVkbBqeEIidsmXeYooWIX9+qjfRQ==", + "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.3", -@@ -9863,9 +9864,10 @@ +@@ -9667,9 +9667,9 @@ } }, "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", +- "version": "3.71.0", +- "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.71.0.tgz", +- "integrity": "sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==", ++ "version": "3.74.0", ++ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.74.0.tgz", ++ "integrity": "sha512-c5XK0MjkGBrQPGYG24GBADZud0NCbznxNx0ZkS+ebUTrmV1qTDxPxSL8zEAPURXSbLRWVexxmP4986BziahL5w==", + "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 +index 8b8ef47..287d879 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 @@ +@@ -54,7 +54,7 @@ + "json-schema-to-typescript": "14.1.0", + "lint-staged": "15.2.10", + "mocha": "10.8.2", +- "nan": "2.22.0", ++ "nan": "^2.22.1", + "node-loader": "2.1.0", + "nyc": "17.1.0", + "prettier": "3.3.3", +@@ -76,7 +76,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", + "net-ipc": "2.2.0", +- "node-abi": "3.71.0", ++ "node-abi": "^3.74.0", + "node-addon-api": "8.3.0", "node-system-fonts": "1.0.1", "properties-reader": "2.3.0",