From 0441e12185c31bd900bec545f48592a0b8fa765f Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Wed, 7 Jan 2026 01:54:28 +0100 Subject: [PATCH] rstudio: 2025.09.2+418 -> 2026.01.0+392 --- pkgs/by-name/rs/rstudio/fix-darwin.patch | 75 +++++++++++++++++++++--- pkgs/by-name/rs/rstudio/package.nix | 46 ++++++--------- 2 files changed, 85 insertions(+), 36 deletions(-) diff --git a/pkgs/by-name/rs/rstudio/fix-darwin.patch b/pkgs/by-name/rs/rstudio/fix-darwin.patch index be15630fa12d..0d940d4044f7 100644 --- a/pkgs/by-name/rs/rstudio/fix-darwin.patch +++ b/pkgs/by-name/rs/rstudio/fix-darwin.patch @@ -1,8 +1,8 @@ diff --git a/cmake/globals.cmake b/cmake/globals.cmake -index e53248b..c705d67 100644 +index 3601ee4..5090f32 100644 --- a/cmake/globals.cmake +++ b/cmake/globals.cmake -@@ -334,6 +334,7 @@ if (APPLE) +@@ -340,6 +340,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) @@ -10,11 +10,56 @@ index e53248b..c705d67 100644 else() set(RSTUDIO_INSTALL_BIN RStudio.app/Contents/MacOS) set(RSTUDIO_INSTALL_SUPPORTING RStudio.app/Contents/Resources) +@@ -470,44 +471,6 @@ macro(add_stripped_executable _target) + define_source_file_names("${_target}") + endmacro(add_stripped_executable) + +-if(APPLE) +- +- # set Homebrew prefix directory +- if(NOT DEFINED HOMEBREW_PREFIX) +- +- if(UNAME_M STREQUAL arm64) +- set(HOMEBREW_PREFIX_FALLBACK /opt/homebrew) +- else() +- set(HOMEBREW_PREFIX_FALLBACK /usr/local) +- endif() +- +- find_path(HOMEBREW_PREFIX +- NAMES bin/brew +- HINTS +- "${HOMEBREW_PREFIX_FALLBACK}") +- +- message(STATUS "Using Homebrew: ${HOMEBREW_PREFIX}") +- +- endif() +- +- # help Boost find icu4c +- if(RSTUDIO_USE_SYSTEM_BOOST) +- link_directories(${HOMEBREW_PREFIX}/opt/icu4c/lib) +- endif() +- +- # set OPENSSL_ROOT_DIR if unset +- if(NOT DEFINED OPENSSL_ROOT_DIR) +- +- file(GLOB OPENSSL_ROOT_CANDIDATE "${HOMEBREW_PREFIX}/Cellar/openssl/*") +- if(EXISTS "${OPENSSL_ROOT_CANDIDATE}") +- set(OPENSSL_ROOT_DIR "${OPENSSL_ROOT_CANDIDATE}" CACHE INTERNAL "") +- elseif(EXISTS "${HOMEBREW_PREFIX}/opt/openssl") +- set(OPENSSL_ROOT_DIR "${HOMEBREW_PREFIX}/opt/openssl" CACHE INTERNAL "") +- endif() +- +- endif() +- +-endif() + + # If enabled, use caching for the build + if(SCCACHE_ENABLED) diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt -index 76f3acb..2910cee 100644 +index 62688dd..f909f8d 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt -@@ -243,7 +243,7 @@ endif() +@@ -167,7 +167,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 +68,7 @@ index 76f3acb..2910cee 100644 set(Boost_USE_STATIC_LIBS ON) endif() -@@ -483,7 +483,7 @@ endif() +@@ -304,7 +304,7 @@ endif() # find SOCI libraries if(UNIX) @@ -32,8 +77,20 @@ index 76f3acb..2910cee 100644 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/cpp/session/postback/CMakeLists.txt b/src/cpp/session/postback/CMakeLists.txt +index 7bba997..4ef0abf 100644 +--- a/src/cpp/session/postback/CMakeLists.txt ++++ b/src/cpp/session/postback/CMakeLists.txt +@@ -36,6 +36,7 @@ add_stripped_executable(rpostback ${POSTBACK_SOURCE_FILES} ${POSTBACK_HEADER_FIL + # set link dependencies + target_link_libraries(rpostback + rstudio-core ++ ${FOUNDATION_LIBRARY} + ) + + if (RSTUDIO_SERVER) diff --git a/src/node/CMakeNodeTools.txt b/src/node/CMakeNodeTools.txt -index 40ae0f3..756fd5f 100644 +index fb3f394..3595f87 100644 --- a/src/node/CMakeNodeTools.txt +++ b/src/node/CMakeNodeTools.txt @@ -27,17 +27,7 @@ endif() @@ -85,10 +142,10 @@ index bccf5b3..0cc798a 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 94f56ac..fe7d5d9 100644 +index d84de20..efef843 100644 --- a/src/node/desktop/src/main/session-launcher.ts +++ b/src/node/desktop/src/main/session-launcher.ts -@@ -91,29 +91,9 @@ function launchProcess(absPath: FilePath, argList: string[]): ChildProcess { +@@ -85,29 +85,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'); @@ -121,7 +178,7 @@ index 94f56ac..fe7d5d9 100644 } const rsessionOptions = new LogOptions('rsession'); -@@ -566,22 +546,6 @@ export class SessionLauncher { +@@ -563,22 +543,6 @@ export class SessionLauncher { } } diff --git a/pkgs/by-name/rs/rstudio/package.nix b/pkgs/by-name/rs/rstudio/package.nix index c4d1d3340d09..791f6eb2840e 100644 --- a/pkgs/by-name/rs/rstudio/package.nix +++ b/pkgs/by-name/rs/rstudio/package.nix @@ -17,7 +17,7 @@ git, jdk, makeWrapper, - nodejs_22, + nodejs, npmHooks, xcbuild, yarn, @@ -25,7 +25,7 @@ zip, boost187, - electron_37, + electron_38, fontconfig, gnumake, hunspellDicts, @@ -44,11 +44,7 @@ }: let - # nodejs_24 has npm v11, which broke the lockfile - # let's just use nodejs_22 for now - nodejs = nodejs_22; - - electron = electron_37; + electron = electron_38; mathJaxSrc = fetchzip { url = "https://s3.amazonaws.com/rstudio-buildtools/mathjax-27.zip"; @@ -66,10 +62,8 @@ let owner = "quarto-dev"; repo = "quarto"; # Note: rev should ideally be the last commit of the release/rstudio-[codename] branch - # Note: This is the last working revision, because https://github.com/quarto-dev/quarto/pull/757 - # started using `file:` in the lockfile, which our fetcher can't handle - rev = "faef822a085df65809adf55fb77c273e9cdb87b9"; - hash = "sha256-DLpVYl0OkaBQtkFinJAS2suZ8gqx9BVS5HBaYrrT1HA="; + rev = "591b3520eafbb4da7b26b9f31aac6948801f19d8"; + hash = "sha256-scdm66Ekfjp5wdNDXcVZA5ZhNgFvuf/kIBF56HrE8uM="; }; hunspellDictionaries = lib.filter lib.isDerivation (lib.unique (lib.attrValues hunspellDicts)); @@ -91,13 +85,13 @@ let in stdenv.mkDerivation rec { pname = "RStudio"; - version = "2025.09.2+418"; + version = "2026.01.0+392"; src = fetchFromGitHub { owner = "rstudio"; repo = "rstudio"; tag = "v${version}"; - hash = "sha256-UFhvNLamKZQ9IBjEtDvSPOUILqGphDDOVb7ZZ8dnfVU="; + hash = "sha256-Q79uoNKh4plRFTe3uOTr27Hh/fMMkCbRPveZyq7cHQk="; }; # sources fetched into _deps via cmake's FetchContent @@ -129,7 +123,7 @@ stdenv.mkDerivation rec { dontBuild = true; dontFixup = true; - outputHash = "sha256-pXpp42hjjKrV75f2XLDYK7A9lrvWhuQBDJ0oymXE8Fg="; + outputHash = "sha256-t2kWnviFMw7TdxaJpiGDXe0M5HSIGD7o5hqWiPKUdOc="; outputHashAlgo = "sha256"; outputHashMode = "recursive"; }; @@ -183,7 +177,6 @@ stdenv.mkDerivation rec { (lib.cmakeBool "RSTUDIO_DISABLE_CHECK_FOR_UPDATES" true) (lib.cmakeBool "QUARTO_ENABLED" true) (lib.cmakeBool "RSTUDIO_ENABLE_COPILOT" false) # copilot-language-server is unfree - (lib.cmakeBool "RSTUDIO_CRASHPAD_ENABLED" false) # This is a NOOP except on x86_64-darwin (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" ( (placeholder "out") + (if stdenv.hostPlatform.isDarwin then "/Applications" else "/lib/rstudio") @@ -240,7 +233,7 @@ stdenv.mkDerivation rec { yarnOfflineCache = fetchYarnDeps { src = quartoSrc; - hash = "sha256-9ObJ3fzxPyGVfIgBj4BhCWqkrG1A2JqZsCreJA+1fWQ="; + hash = "sha256-XRxClyAaz3ja+Tr97aoqVxKhWOxezZ6OmEPGILdeOww="; }; dontYarnInstallDeps = true; # will call manually in preConfigure @@ -256,7 +249,7 @@ stdenv.mkDerivation rec { name = "rstudio-${version}-npm-deps"; inherit src; postPatch = "cd ${npmRoot}"; - hash = "sha256-/5GgRusDRyBMr5581ypTMzhqkvjpzYBaniFos524bEw="; + hash = "sha256-7gXLCFhan/TCTlc2okMWuWzfRYXmuwcqhmGKAqJOEM0="; }; preConfigure = '' @@ -290,10 +283,14 @@ stdenv.mkDerivation rec { # version in dependencies/common/install-mathjax ln -s ${mathJaxSrc} dependencies/mathjax-27 + # node used by cmake and node used for distribution + # version in cmake/globals.cmake + RSTUDIO_NODE_VERSION="22.13.1" + RSTUDIO_INSTALLED_NODE_VERSION="22.21.1" + mkdir -p dependencies/common/node - # node used by cmake - # version in cmake/globals.cmake (RSTUDIO_NODE_VERSION) - ln -s ${nodejs} dependencies/common/node/22.13.1 + ln -s ${nodejs} dependencies/common/node/$RSTUDIO_NODE_VERSION + ln -s ${nodejs} dependencies/common/node/$RSTUDIO_INSTALLED_NODE_VERSION-installed '' + lib.optionalString (!server) '' @@ -320,11 +317,6 @@ stdenv.mkDerivation rec { 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 - # 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 @@ -335,7 +327,7 @@ stdenv.mkDerivation rec { mkdir -p $out/bin '' + 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 + ln -s $out/lib/rstudio/bin/{postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server} $out/bin '' + lib.optionalString (!server && stdenv.hostPlatform.isLinux) '' # remove unneeded electron files, since we'll wrap the app with our own electron @@ -350,7 +342,7 @@ stdenv.mkDerivation rec { 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 + ln -s $out/Applications/RStudio.app/Contents/MacOS/{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