Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 0 additions & 67 deletions pkgs/by-name/rs/rstudio/bump-node-abi.patch

This file was deleted.

30 changes: 30 additions & 0 deletions pkgs/by-name/rs/rstudio/dont-npm-ci.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/src/node/desktop/CMakeLists.txt b/src/node/desktop/CMakeLists.txt
index bccf5b3..71e10a7 100644
--- a/src/node/desktop/CMakeLists.txt
+++ b/src/node/desktop/CMakeLists.txt
@@ -117,11 +117,7 @@ file(MAKE_DIRECTORY "${ELECTRON_BINARY_DIR}")
file(
COPY "${CMAKE_CURRENT_SOURCE_DIR}/"
DESTINATION "${ELECTRON_BINARY_DIR}/"
- REGEX "/.webpack$" EXCLUDE
- REGEX "/build$" EXCLUDE
- REGEX "/bin$" EXCLUDE
- REGEX "/out$" EXCLUDE
- REGEX "/node_modules$" EXCLUDE)
+)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/main/build-info.ts.in
diff --git a/src/node/desktop/package.json b/src/node/desktop/package.json
index df92166..47ca4b4 100644
--- a/src/node/desktop/package.json
+++ b/src/node/desktop/package.json
@@ -10,7 +10,7 @@
"scripts": {
"clean": "ts-node scripts/clean.ts",
"lint": "eslint ./src ./test",
- "package": "npm ci && electron-forge package",
+ "package": "electron-forge package",
"start": "electron-forge start -- --no-sandbox",
"debug": "electron-forge start --inspect-electron",
"fullstart": "npm install && electron-forge start",
37 changes: 6 additions & 31 deletions pkgs/by-name/rs/rstudio/fix-darwin.patch
Original file line number Diff line number Diff line change
Expand Up @@ -56,37 +56,12 @@ index 40ae0f3..756fd5f 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 35438fd..f9b1951 100644
index bccf5b3..0cc798a 100644
--- a/src/node/desktop/CMakeLists.txt
+++ b/src/node/desktop/CMakeLists.txt
@@ -122,22 +122,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()

@@ -233,16 +220,21 @@ if(WIN32)
PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
DESTINATION "${RSTUDIO_INSTALL_BIN}")
@@ -236,16 +236,21 @@ if(WIN32)
install(FILES ${VCRUNTIME_X86_FILES} DESTINATION "${RSTUDIO_INSTALL_BIN}/x86")
install(FILES ${VCRUNTIME_X64_FILES} DESTINATION "${RSTUDIO_INSTALL_BIN}")

-elseif(LINUX)
+elseif(LINUX OR APPLE)
Expand All @@ -104,8 +79,8 @@ index 35438fd..f9b1951 100644
+ endif()

install(
- DIRECTORY "${ELECTRON_BUILD_DIR}/out/RStudio-linux-${ELECTRON_ARCH}/"
+ DIRECTORY "${ELECTRON_BUILD_DIR}/out/RStudio-${ELECTRON_PLATFORM}-${ELECTRON_ARCH}/"
- DIRECTORY "${ELECTRON_BINARY_DIR}/out/RStudio-linux-${ELECTRON_ARCH}/"
+ DIRECTORY "${ELECTRON_BINARY_DIR}/out/RStudio-${ELECTRON_PLATFORM}-${ELECTRON_ARCH}/"
DIRECTORY_PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
Expand Down
40 changes: 22 additions & 18 deletions pkgs/by-name/rs/rstudio/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

apple-sdk_11,
boost187,
electron_36,
electron_37,
fontconfig,
gnumake,
hunspellDicts,
Expand All @@ -45,19 +45,28 @@
}:

let
electron = electron_36;
electron = electron_37;

mathJaxSrc = fetchzip {
url = "https://s3.amazonaws.com/rstudio-buildtools/mathjax-27.zip";
hash = "sha256-J7SZK/9q3HcXTD7WFHxvh++ttuCd89Vc4SEBrUEU0AI=";
};

# rev should ideally be the last commit of the release/rstudio-[codename] branch
# Note: we could build this from source, but let's just do what upstream does for now
gwt = fetchzip {
url = "https://rstudio-buildtools.s3.us-east-1.amazonaws.com/gwt/gwt-2.12.2.tar.gz";
stripRoot = false;
hash = "sha256-DgcCiheYeP7sISduz6E3WhTty2nSs14k2OYIG93KmkY=";
};

quartoSrc = fetchFromGitHub {
owner = "quarto-dev";
repo = "quarto";
rev = "8ee12b5d6bd49c7b212eae894bd011ffbeea1c48";
hash = "sha256-pTrWedYeG2SWQ4jl2fstKjsweWhj4aAvVDiSfkdU3No=";
# 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=";
};

hunspellDictionaries = lib.filter lib.isDerivation (lib.unique (lib.attrValues hunspellDicts));
Expand All @@ -79,13 +88,13 @@ let
in
stdenv.mkDerivation rec {
pname = "RStudio";
version = "2025.05.1+513";
version = "2025.09.1+401";

src = fetchFromGitHub {
owner = "rstudio";
repo = "rstudio";
tag = "v${version}";
hash = "sha256-KaolU82bxzAlYl+aYwlFljqsmNv0dn8XP1llaLK3LQE=";
hash = "sha256-FVK/1trMVFEv17HbUpaISC9gyE2HBKtdZWjxbgdXALc=";
};

# sources fetched into _deps via cmake's FetchContent
Expand Down Expand Up @@ -117,7 +126,7 @@ stdenv.mkDerivation rec {
dontBuild = true;
dontFixup = true;

outputHash = "sha256-YW+l0/RZf8ek217pfWTwsR4PTugMGHyW+vaZEwGjMas=";
outputHash = "sha256-pXpp42hjjKrV75f2XLDYK7A9lrvWhuQBDJ0oymXE8Fg=";
outputHashAlgo = "sha256";
outputHashMode = "recursive";
};
Expand Down Expand Up @@ -207,8 +216,8 @@ stdenv.mkDerivation rec {

./ignore-etc-os-release.patch
./dont-yarn-install.patch
./dont-npm-ci.patch
./fix-darwin.patch
./bump-node-abi.patch
];

postPatch = ''
Expand All @@ -223,7 +232,7 @@ stdenv.mkDerivation rec {

yarnOfflineCache = fetchYarnDeps {
src = quartoSrc;
hash = "sha256-F+gqVNNhLmyrC+tJuElw7cpx5z/WLHOiYow/y86KR5c=";
hash = "sha256-9ObJ3fzxPyGVfIgBj4BhCWqkrG1A2JqZsCreJA+1fWQ=";
};

dontYarnInstallDeps = true; # will call manually in preConfigure
Expand All @@ -239,11 +248,7 @@ stdenv.mkDerivation rec {
name = "rstudio-${version}-npm-deps";
inherit src;
postPatch = "cd ${npmRoot}";
patches = [
# needed for support for electron versions above electron_34
./bump-node-abi.patch
];
hash = "sha256-64PJPUE/xwdQdxVGiKzy8ADnxXH/qGQtFMib0unZpoA=";
hash = "sha256-HfJsm/UauA5Vdi22WfTJGiI9K979Sw7RYApYdZU0AUs=";
};

preConfigure = ''
Expand All @@ -270,6 +275,8 @@ stdenv.mkDerivation rec {
done
done

ln -s ${gwt} dependencies/common/gwtproject

ln -s ${quartoWrapper} dependencies/quarto

# version in dependencies/common/install-mathjax
Expand All @@ -284,9 +291,6 @@ stdenv.mkDerivation rec {
+ 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}"

Expand Down
Loading