nixpkgs/pkgs/applications/editors/rstudio/use-system-node.patch
2024-05-27 09:26:21 +02:00

82 lines
3.4 KiB
Diff

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/18.18.2/bin/node
+external-node-path=@node@/bin/node
# enable copilot
copilot-enabled=1
diff --git a/src/gwt/build.xml b/src/gwt/build.xml
index 033d605..f1ee63d 100644
--- a/src/gwt/build.xml
+++ b/src/gwt/build.xml
@@ -87,29 +87,7 @@
<!-- ensure version matches RSTUDIO_NODE_VERSION -->
<property name="node.version" value="18.18.2"/>
<property name="node.dir" value="../../dependencies/common/node/${node.version}"/>
- <!-- use yarn from system but will prefer yarn from dependencies if available -->
- <condition property="yarn.bin" value="yarn">
- <not>
- <os family="windows" />
- </not>
- </condition>
- <available
- property="yarn.bin"
- value="${node.dir}/bin/yarn"
- file="${node.dir}/bin/yarn"/>
- <condition property="yarn.bin" value="${node.dir}/node_modules/yarn/bin/yarn.cmd">
- <os family="windows" />
- </condition>
- <!-- use yarn from /opt/rstudio-tools if installed (typical for Docker) -->
- <available
- property="yarn.bin"
- value="/opt/rstudio-tools/dependencies/common/node/${node.version}/bin/yarn"
- file="/opt/rstudio-tools/dependencies/common/node/${node.version}/bin/yarn"/>
- <!-- use yarn from c:/rstudio-tools if installed (typical for Docker on Windows) -->
- <available
- property="yarn.bin"
- value="c:\rstudio-tools\dependencies\common\node\${node.version}\node_modules\yarn\bin\yarn.cmd"
- file="c:\rstudio-tools\dependencies\common\node\${node.version}\node_modules\yarn\bin\yarn.cmd"/>
+ <property name="node.bin" value="@node@/bin/node"/>
<property name="panmirror.dir" value="./lib/quarto/apps/panmirror"/>
<property name="panmirror.build.dir" value="./www/js/panmirror"/>
@@ -133,28 +111,11 @@
<isset property="panmirror.minify" />
</not>
</condition>
-
- <echo message="yarn location: ${yarn.bin}"/>
- <echo message="panmirror location: ${panmirror.dir}"/>
- <echo message="panmirror minify: ${panmirror.minify}"/>
-
<mkdir dir="${panmirror.build.dir}"/>
- <exec executable="${yarn.bin}" dir="${panmirror.dir}" resolveexecutable="true" failonerror="true">
- <arg value="install"/>
- <arg value="--network-timeout"/>
- <arg value="240000"/>
- </exec>
- <exec executable="${yarn.bin}" dir="${panmirror.dir}" resolveexecutable="true" failonerror="true">
- <arg value="build"/>
- <arg value="--minify"/>
- <arg value="${panmirror.minify}"/>
- <arg value="--sourcemap"/>
- <arg value="true"/>
- <env key="PANMIRROR_OUTDIR" value="dist-rstudio"/>
+ <exec executable="${node.bin}" dir="${panmirror.dir}" spawn="${panmirror.spawn}">
+ <arg value="fuse"/>
+ <arg value="${panmirror.target}"/>
</exec>
- <copy todir="${panmirror.build.dir}">
- <fileset dir="${panmirror.dir}/dist-rstudio"/>
- </copy>
</target>
<target name="javac" description="Compile java source">