From 45b1d202eff8fad701bba815cdfc30dea79b91f3 Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Mon, 9 Oct 2023 09:20:18 +1100 Subject: [PATCH] rstudio: fix server node patching --- pkgs/applications/editors/rstudio/default.nix | 3 ++ .../editors/rstudio/use-system-node.patch | 30 ++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index 2ce482f356c8..82a572eaf4c5 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -145,6 +145,9 @@ in --replace '@node@' ${nodejs} \ --replace './lib/quarto' ${quartoSrc} + substituteInPlace src/cpp/conf/rsession-dev.conf \ + --replace '@node@' ${nodejs} + substituteInPlace src/cpp/core/libclang/LibClang.cpp \ --replace '@libclang@' ${llvmPackages.libclang.lib} \ --replace '@libclang.so@' ${llvmPackages.libclang.lib}/lib/libclang.so diff --git a/pkgs/applications/editors/rstudio/use-system-node.patch b/pkgs/applications/editors/rstudio/use-system-node.patch index 859349096134..bb4480b4ae5f 100644 --- a/pkgs/applications/editors/rstudio/use-system-node.patch +++ b/pkgs/applications/editors/rstudio/use-system-node.patch @@ -1,5 +1,33 @@ +diff --git a/src/cpp/conf/rsession-dev.conf b/src/cpp/conf/rsession-dev.conf +index d18362b..98cdd4c 100644 +--- a/src/cpp/conf/rsession-dev.conf ++++ b/src/cpp/conf/rsession-dev.conf +@@ -39,7 +39,7 @@ external-mathjax-path=${RSTUDIO_DEPENDENCIES_MATHJAX_DIR} + external-pandoc-path=${RSTUDIO_DEPENDENCIES_PANDOC_DIR} + external-quarto-path=${RSTUDIO_DEPENDENCIES_QUARTO_DIR} + external-libclang-path=${RSTUDIO_DEPENDENCIES_DIR}/common/libclang +-external-node-path=${RSTUDIO_DEPENDENCIES_DIR}/common/node/16.14.0/bin/node ++external-node-path=@node@/bin/node + + # enable copilot + copilot-enabled=1 +diff --git a/src/cpp/server/CMakeLists.txt b/src/cpp/server/CMakeLists.txt +index 30dd638..cb4a645 100644 +--- a/src/cpp/server/CMakeLists.txt ++++ b/src/cpp/server/CMakeLists.txt +@@ -250,10 +250,6 @@ if (UNIX AND NOT APPLE) + DESTINATION ${RSERVER_SYSTEMD_DIR}) + + # install node +- install( +- DIRECTORY "${RSTUDIO_DEPENDENCIES_DIR}/common/node/${RSTUDIO_NODE_VERSION}/" +- DESTINATION "${RSTUDIO_INSTALL_BIN}/node" +- USE_SOURCE_PERMISSIONS) + + elseif(APPLE) + diff --git a/src/gwt/build.xml b/src/gwt/build.xml -index 83e9433..f1ee63d 100644 +index 033d605..f1ee63d 100644 --- a/src/gwt/build.xml +++ b/src/gwt/build.xml @@ -87,29 +87,7 @@