tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
rstudio: do minor cleanup
TomaSajt
8 months ago
77e50143
bc42fc06
+44
-46
1 changed file
expand all
collapse all
unified
split
pkgs
applications
editors
rstudio
default.nix
+44
-46
pkgs/applications/editors/rstudio/default.nix
···
224
224
'';
225
225
226
226
yarnOfflineCache = fetchYarnDeps {
227
227
-
yarnLock = quartoSrc + "/yarn.lock";
227
227
+
src = quartoSrc;
228
228
hash = "sha256-F+gqVNNhLmyrC+tJuElw7cpx5z/WLHOiYow/y86KR5c=";
229
229
};
230
230
···
244
244
hash = "sha256-ispV6FJdtOELtFNIZDn1lKbwvO/iTO8mrZ8nIOs2uhs=";
245
245
};
246
246
247
247
-
preConfigure = ''
248
248
-
# populate the directories used by cmake's FetchContent
249
249
-
mkdir -p build/_deps
250
250
-
cp -r "$extSrcs"/* build/_deps
251
251
-
chmod -R u+w build/_deps
247
247
+
preConfigure =
248
248
+
''
249
249
+
# populate the directories used by cmake's FetchContent
250
250
+
mkdir -p build/_deps
251
251
+
cp -r "$extSrcs"/* build/_deps
252
252
+
chmod -R u+w build/_deps
252
253
253
253
-
# set up node_modules directory inside quarto so that panmirror can be built
254
254
-
mkdir src/gwt/lib/quarto
255
255
-
cp -r --no-preserve=all ${quartoSrc}/* src/gwt/lib/quarto
256
256
-
pushd src/gwt/lib/quarto
257
257
-
yarnConfigHook
258
258
-
popd
254
254
+
# set up node_modules directory inside quarto so that panmirror can be built
255
255
+
mkdir src/gwt/lib/quarto
256
256
+
cp -r --no-preserve=all ${quartoSrc}/* src/gwt/lib/quarto
257
257
+
pushd src/gwt/lib/quarto
258
258
+
yarnConfigHook
259
259
+
popd
259
260
260
260
-
### set up dependencies that will be copied into the result
261
261
-
# note: only the directory names have to match upstream, the actual versions don't
262
262
-
# note: symlinks are preserved
261
261
+
### set up dependencies that will be copied into the result
262
262
+
# note: only the directory names have to match upstream, the actual versions don't
263
263
+
# note: symlinks are preserved
263
264
264
264
-
mkdir dependencies/dictionaries
265
265
-
for dict in ${builtins.concatStringsSep " " dictionaries}; do
266
266
-
for i in "$dict/share/hunspell/"*; do
267
267
-
ln -s $i dependencies/dictionaries/
265
265
+
mkdir dependencies/dictionaries
266
266
+
for dict in ${builtins.concatStringsSep " " dictionaries}; do
267
267
+
for i in "$dict/share/hunspell/"*; do
268
268
+
ln -s $i dependencies/dictionaries/
269
269
+
done
268
270
done
269
269
-
done
270
271
271
271
-
ln -s ${quartoWrapper} dependencies/quarto
272
272
+
ln -s ${quartoWrapper} dependencies/quarto
272
273
273
273
-
# version in dependencies/common/install-mathjax
274
274
-
ln -s ${mathJaxSrc} dependencies/mathjax-27
274
274
+
# version in dependencies/common/install-mathjax
275
275
+
ln -s ${mathJaxSrc} dependencies/mathjax-27
275
276
276
276
-
mkdir -p dependencies/common/node
277
277
-
# node used by cmake
278
278
-
# version in cmake/globals.cmake (RSTUDIO_NODE_VERSION)
279
279
-
ln -s ${nodejs} dependencies/common/node/22.13.1
277
277
+
mkdir -p dependencies/common/node
278
278
+
# node used by cmake
279
279
+
# version in cmake/globals.cmake (RSTUDIO_NODE_VERSION)
280
280
+
ln -s ${nodejs} dependencies/common/node/22.13.1
280
281
281
281
-
${lib.optionalString (!server) ''
282
282
+
''
283
283
+
+ lib.optionalString (!server) ''
282
284
pushd $npmRoot
283
285
284
286
substituteInPlace package.json \
···
308
310
# Work around known nan issue for electron_33 and above
309
311
# https://github.com/nodejs/nan/issues/978
310
312
substituteInPlace node_modules/nan/nan.h \
311
311
-
--replace-fail '#include "nan_scriptorigin.h"' ""
313
313
+
--replace-fail '#include "nan_scriptorigin.h"' ""
312
314
313
315
# now that we patched everything, we still have to run the scripts we ignored with --ignore-scripts
314
316
npm rebuild
315
317
316
318
popd
317
317
-
''}
318
318
-
'';
319
319
+
'';
319
320
320
320
-
postInstall = ''
321
321
-
mkdir -p $out/bin
322
322
-
323
323
-
${lib.optionalString (server && stdenv.hostPlatform.isLinux) ''
321
321
+
postInstall =
322
322
+
''
323
323
+
mkdir -p $out/bin
324
324
+
''
325
325
+
+ lib.optionalString (server && stdenv.hostPlatform.isLinux) ''
324
326
ln -s $out/lib/rstudio/bin/{crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server} $out/bin
325
325
-
''}
326
326
-
327
327
-
${lib.optionalString (!server && stdenv.hostPlatform.isLinux) ''
327
327
+
''
328
328
+
+ lib.optionalString (!server && stdenv.hostPlatform.isLinux) ''
328
329
# remove unneeded electron files, since we'll wrap the app with our own electron
329
330
shopt -s extglob
330
331
rm -r $out/lib/rstudio/!(locales|resources|resources.pak)
···
335
336
--suffix PATH : ${lib.makeBinPath [ gnumake ]}
336
337
337
338
ln -s $out/lib/rstudio/resources/app/bin/{diagnostics,rpostback} $out/bin
338
338
-
''}
339
339
-
340
340
-
${lib.optionalString (server && stdenv.hostPlatform.isDarwin) ''
339
339
+
''
340
340
+
+ lib.optionalString (server && stdenv.hostPlatform.isDarwin) ''
341
341
ln -s $out/Applications/RStudio.app/Contents/MacOS/{crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server} $out/bin
342
342
-
''}
343
343
-
344
344
-
${lib.optionalString (!server && stdenv.hostPlatform.isDarwin) ''
342
342
+
''
343
343
+
+ lib.optionalString (!server && stdenv.hostPlatform.isDarwin) ''
345
344
# electron can't find its files if we use a symlink here
346
345
makeWrapper $out/Applications/RStudio.app/Contents/MacOS/RStudio $out/bin/rstudio
347
346
348
347
ln -s $out/Applications/RStudio.app/Contents/Resources/app/bin/{diagnostics,rpostback} $out/bin
349
349
-
''}
350
350
-
'';
348
348
+
'';
351
349
352
350
passthru = {
353
351
inherit server;