From e7ff77d1264a41febd148c9a9120e6bc53536acd Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:21:37 +0100 Subject: [PATCH 1/5] rstudio: format with nixfmt --- pkgs/applications/editors/rstudio/default.nix | 274 ++++++++++-------- 1 file changed, 159 insertions(+), 115 deletions(-) diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index ff0c468fc509d..4ef6e69512986 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -1,38 +1,39 @@ -{ lib -, stdenv -, mkDerivation -, fetchurl -, fetchFromGitHub -, makeDesktopItem -, copyDesktopItems -, cmake -, boost183 -, zlib -, openssl -, R -, qtbase -, qtxmlpatterns -, qtsensors -, qtwebengine -, qtwebchannel -, quarto -, libuuid -, hunspellDicts -, unzip -, ant -, jdk -, gnumake -, pandoc -, llvmPackages -, yaml-cpp -, soci -, postgresql -, nodejs -, qmake -, server ? false # build server version -, sqlite -, pam -, nixosTests +{ + lib, + stdenv, + mkDerivation, + fetchurl, + fetchFromGitHub, + makeDesktopItem, + copyDesktopItems, + cmake, + boost183, + zlib, + openssl, + R, + qtbase, + qtxmlpatterns, + qtsensors, + qtwebengine, + qtwebchannel, + quarto, + libuuid, + hunspellDicts, + unzip, + ant, + jdk, + gnumake, + pandoc, + llvmPackages, + yaml-cpp, + soci, + postgresql, + nodejs, + qmake, + server ? false, # build server version + sqlite, + pam, + nixosTests, }: let @@ -41,9 +42,7 @@ let RSTUDIO_VERSION_MAJOR = lib.versions.major version; RSTUDIO_VERSION_MINOR = lib.versions.minor version; RSTUDIO_VERSION_PATCH = lib.versions.patch version; - RSTUDIO_VERSION_SUFFIX = "+" + toString ( - lib.tail (lib.splitString "+" version) - ); + RSTUDIO_VERSION_SUFFIX = "+" + toString (lib.tail (lib.splitString "+" version)); src = fetchFromGitHub { owner = "rstudio"; @@ -75,54 +74,73 @@ let description = "Set of integrated tools for the R language"; in -(if server then stdenv.mkDerivation else mkDerivation) - (rec { - inherit pname version src RSTUDIO_VERSION_MAJOR RSTUDIO_VERSION_MINOR RSTUDIO_VERSION_PATCH RSTUDIO_VERSION_SUFFIX; - - nativeBuildInputs = [ - cmake - unzip - ant - jdk - pandoc - nodejs - ] ++ lib.optionals (!server) [ - copyDesktopItems - ]; +(if server then stdenv.mkDerivation else mkDerivation) ( + rec { + inherit + pname + version + src + RSTUDIO_VERSION_MAJOR + RSTUDIO_VERSION_MINOR + RSTUDIO_VERSION_PATCH + RSTUDIO_VERSION_SUFFIX + ; - buildInputs = [ - boost183 - zlib - openssl - R - libuuid - yaml-cpp - soci - postgresql - quarto - ] ++ (if server then [ - sqlite.dev - pam - ] else [ - qtbase - qtxmlpatterns - qtsensors - qtwebengine - qtwebchannel - ]); - - cmakeFlags = [ - "-DRSTUDIO_TARGET=${if server then "Server" else "Desktop"}" - "-DRSTUDIO_USE_SYSTEM_SOCI=ON" - "-DRSTUDIO_USE_SYSTEM_BOOST=ON" - "-DRSTUDIO_USE_SYSTEM_YAML_CPP=ON" - "-DRSTUDIO_DISABLE_CHECK_FOR_UPDATES=ON" - "-DQUARTO_ENABLED=TRUE" - "-DPANDOC_VERSION=${pandoc.version}" - "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/lib/rstudio" - ] ++ lib.optionals (!server) [ - "-DQT_QMAKE_EXECUTABLE=${qmake}/bin/qmake" - ]; + nativeBuildInputs = + [ + cmake + unzip + ant + jdk + pandoc + nodejs + ] + ++ lib.optionals (!server) [ + copyDesktopItems + ]; + + buildInputs = + [ + boost183 + zlib + openssl + R + libuuid + yaml-cpp + soci + postgresql + quarto + ] + ++ ( + if server then + [ + sqlite.dev + pam + ] + else + [ + qtbase + qtxmlpatterns + qtsensors + qtwebengine + qtwebchannel + ] + ); + + cmakeFlags = + [ + "-DRSTUDIO_TARGET=${if server then "Server" else "Desktop"}" + "-DRSTUDIO_USE_SYSTEM_SOCI=ON" + "-DRSTUDIO_USE_SYSTEM_BOOST=ON" + "-DRSTUDIO_USE_SYSTEM_YAML_CPP=ON" + "-DRSTUDIO_DISABLE_CHECK_FOR_UPDATES=ON" + "-DQUARTO_ENABLED=TRUE" + "-DPANDOC_VERSION=${pandoc.version}" + "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/lib/rstudio" + ] + ++ lib.optionals (!server) [ + "-DQT_QMAKE_EXECUTABLE=${qmake}/bin/qmake" + ]; # Hack RStudio to only use the input R and provided libclang. patches = [ @@ -162,32 +180,31 @@ in # These dicts contain identically-named dict files, so we only keep the # -large versions in case of clashes largeDicts = lib.filter (d: lib.hasInfix "-large-wordlist" d.name) hunspellDictionaries; - otherDicts = lib.filter - (d: !(lib.hasAttr "dictFileName" d && - lib.elem d.dictFileName (map (d: d.dictFileName) largeDicts))) - hunspellDictionaries; + otherDicts = lib.filter ( + d: !(lib.hasAttr "dictFileName" d && lib.elem d.dictFileName (map (d: d.dictFileName) largeDicts)) + ) hunspellDictionaries; dictionaries = largeDicts ++ otherDicts; preConfigure = '' - mkdir dependencies/dictionaries - for dict in ${builtins.concatStringsSep " " dictionaries}; do - for i in "$dict/share/hunspell/"*; do - ln -s $i dependencies/dictionaries/ - done - done + mkdir dependencies/dictionaries + for dict in ${builtins.concatStringsSep " " dictionaries}; do + for i in "$dict/share/hunspell/"*; do + ln -s $i dependencies/dictionaries/ + done + done - unzip -q ${mathJaxSrc} -d dependencies/mathjax-27 + unzip -q ${mathJaxSrc} -d dependencies/mathjax-27 - # As of Chocolate Cosmos, node 18.20.3 is used for runtime - # 18.18.2 is still used for build - # see https://github.com/rstudio/rstudio/commit/facb5cf1ab38fe77813aaf36590804e4f865d780 - mkdir -p dependencies/common/node/18.20.3 + # As of Chocolate Cosmos, node 18.20.3 is used for runtime + # 18.18.2 is still used for build + # see https://github.com/rstudio/rstudio/commit/facb5cf1ab38fe77813aaf36590804e4f865d780 + mkdir -p dependencies/common/node/18.20.3 - mkdir -p dependencies/pandoc/${pandoc.version} - cp ${pandoc}/bin/pandoc dependencies/pandoc/${pandoc.version}/pandoc + mkdir -p dependencies/pandoc/${pandoc.version} + cp ${pandoc}/bin/pandoc dependencies/pandoc/${pandoc.version}/pandoc - cp -r ${rsconnectSrc} dependencies/rsconnect - ( cd dependencies && ${R}/bin/R CMD build -d --no-build-vignettes rsconnect ) + cp -r ${rsconnectSrc} dependencies/rsconnect + ( cd dependencies && ${R}/bin/R CMD build -d --no-build-vignettes rsconnect ) ''; postInstall = '' @@ -198,9 +215,12 @@ in ln $out/lib/rstudio/rstudio.png $out/share/icons/hicolor/48x48/apps ''} - for f in {${if server - then "crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server" - else "diagnostics,rpostback,rstudio"}}; do + for f in {${ + if server then + "crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server" + else + "diagnostics,rpostback,rstudio" + }}; do ln -s $out/lib/rstudio/bin/$f $out/bin done @@ -216,16 +236,22 @@ in inherit description; homepage = "https://www.rstudio.com/"; license = lib.licenses.agpl3Only; - maintainers = with lib.maintainers; [ ciil cfhammill ]; + maintainers = with lib.maintainers; [ + ciil + cfhammill + ]; mainProgram = "rstudio" + lib.optionalString server "-server"; platforms = lib.platforms.linux; }; passthru = { inherit server; - tests = { inherit (nixosTests) rstudio-server; }; + tests = { + inherit (nixosTests) rstudio-server; + }; }; - } // lib.optionalAttrs (!server) { + } + // lib.optionalAttrs (!server) { qtWrapperArgs = [ "--suffix PATH : ${lib.makeBinPath [ gnumake ]}" ]; @@ -240,11 +266,29 @@ in comment = description; categories = [ "Development" ]; mimeTypes = [ - "text/x-r-source" "text/x-r" "text/x-R" "text/x-r-doc" "text/x-r-sweave" "text/x-r-markdown" - "text/x-r-html" "text/x-r-presentation" "application/x-r-data" "application/x-r-project" - "text/x-r-history" "text/x-r-profile" "text/x-tex" "text/x-markdown" "text/html" - "text/css" "text/javascript" "text/x-chdr" "text/x-csrc" "text/x-c++hdr" "text/x-c++src" + "text/x-r-source" + "text/x-r" + "text/x-R" + "text/x-r-doc" + "text/x-r-sweave" + "text/x-r-markdown" + "text/x-r-html" + "text/x-r-presentation" + "application/x-r-data" + "application/x-r-project" + "text/x-r-history" + "text/x-r-profile" + "text/x-tex" + "text/x-markdown" + "text/html" + "text/css" + "text/javascript" + "text/x-chdr" + "text/x-csrc" + "text/x-c++hdr" + "text/x-c++src" ]; }) ]; - }) + } +) From 3f9546f9f23debe64de94100782815ae5f6f4d80 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:28:11 +0100 Subject: [PATCH 2/5] rstudio: don't use libsForQt5.callPackage --- pkgs/applications/editors/rstudio/default.nix | 23 ++++++++----------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index 4ef6e69512986..0a48250d3e844 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -1,7 +1,6 @@ { lib, stdenv, - mkDerivation, fetchurl, fetchFromGitHub, makeDesktopItem, @@ -11,11 +10,7 @@ zlib, openssl, R, - qtbase, - qtxmlpatterns, - qtsensors, - qtwebengine, - qtwebchannel, + libsForQt5, quarto, libuuid, hunspellDicts, @@ -29,7 +24,6 @@ soci, postgresql, nodejs, - qmake, server ? false, # build server version sqlite, pam, @@ -74,7 +68,7 @@ let description = "Set of integrated tools for the R language"; in -(if server then stdenv.mkDerivation else mkDerivation) ( +stdenv.mkDerivation ( rec { inherit pname @@ -97,6 +91,7 @@ in ] ++ lib.optionals (!server) [ copyDesktopItems + libsForQt5.wrapQtAppsHook ]; buildInputs = @@ -119,11 +114,11 @@ in ] else [ - qtbase - qtxmlpatterns - qtsensors - qtwebengine - qtwebchannel + libsForQt5.qtbase + libsForQt5.qtxmlpatterns + libsForQt5.qtsensors + libsForQt5.qtwebengine + libsForQt5.qtwebchannel ] ); @@ -139,7 +134,7 @@ in "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/lib/rstudio" ] ++ lib.optionals (!server) [ - "-DQT_QMAKE_EXECUTABLE=${qmake}/bin/qmake" + "-DQT_QMAKE_EXECUTABLE=${libsForQt5.qmake}/bin/qmake" ]; # Hack RStudio to only use the input R and provided libclang. diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 844ba5a100d62..efb836890d140 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15295,7 +15295,7 @@ with pkgs; backend = "wayland"; }; - rstudio = libsForQt5.callPackage ../applications/editors/rstudio { + rstudio = callPackage ../applications/editors/rstudio { jdk = jdk8; }; From b43523d57662d2f56b7281d4a1df693607f843bc Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sun, 8 Dec 2024 15:34:07 +0100 Subject: [PATCH 3/5] rstudio: clean up by moving values around --- pkgs/applications/editors/rstudio/default.nix | 394 +++++++++--------- 1 file changed, 188 insertions(+), 206 deletions(-) diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index 0a48250d3e844..659793a485123 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -31,20 +31,6 @@ }: let - pname = "RStudio"; - version = "2024.04.2+764"; - RSTUDIO_VERSION_MAJOR = lib.versions.major version; - RSTUDIO_VERSION_MINOR = lib.versions.minor version; - RSTUDIO_VERSION_PATCH = lib.versions.patch version; - RSTUDIO_VERSION_SUFFIX = "+" + toString (lib.tail (lib.splitString "+" version)); - - src = fetchFromGitHub { - owner = "rstudio"; - repo = "rstudio"; - rev = "v" + version; - hash = "sha256-j258eW1MYQrB6kkpjyolXdNuwQ3zSWv9so4q0QLsZuw="; - }; - mathJaxSrc = fetchurl { url = "https://s3.amazonaws.com/rstudio-buildtools/mathjax-27.zip"; hash = "sha256-xWy6psTOA8H8uusrXqPDEtL7diajYCVHcMvLiPsgQXY="; @@ -66,224 +52,220 @@ let hash = "sha256-lZnZvioztbBWWa6H177X6rRrrgACx2gMjVFDgNup93g="; }; - description = "Set of integrated tools for the R language"; + hunspellDictionaries = lib.filter lib.isDerivation (lib.unique (lib.attrValues hunspellDicts)); + # These dicts contain identically-named dict files, so we only keep the + # -large versions in case of clashes + largeDicts = lib.filter (d: lib.hasInfix "-large-wordlist" d.name) hunspellDictionaries; + otherDicts = lib.filter ( + d: !(lib.hasAttr "dictFileName" d && lib.elem d.dictFileName (map (d: d.dictFileName) largeDicts)) + ) hunspellDictionaries; + dictionaries = largeDicts ++ otherDicts; in -stdenv.mkDerivation ( - rec { - inherit - pname - version - src - RSTUDIO_VERSION_MAJOR - RSTUDIO_VERSION_MINOR - RSTUDIO_VERSION_PATCH - RSTUDIO_VERSION_SUFFIX - ; +stdenv.mkDerivation rec { + pname = "RStudio"; + version = "2024.04.2+764"; - nativeBuildInputs = - [ - cmake - unzip - ant - jdk - pandoc - nodejs - ] - ++ lib.optionals (!server) [ - copyDesktopItems - libsForQt5.wrapQtAppsHook - ]; + RSTUDIO_VERSION_MAJOR = lib.versions.major version; + RSTUDIO_VERSION_MINOR = lib.versions.minor version; + RSTUDIO_VERSION_PATCH = lib.versions.patch version; + RSTUDIO_VERSION_SUFFIX = "+" + toString (lib.tail (lib.splitString "+" version)); - buildInputs = - [ - boost183 - zlib - openssl - R - libuuid - yaml-cpp - soci - postgresql - quarto - ] - ++ ( - if server then - [ - sqlite.dev - pam - ] - else - [ - libsForQt5.qtbase - libsForQt5.qtxmlpatterns - libsForQt5.qtsensors - libsForQt5.qtwebengine - libsForQt5.qtwebchannel - ] - ); + src = fetchFromGitHub { + owner = "rstudio"; + repo = "rstudio"; + rev = "v" + version; + hash = "sha256-j258eW1MYQrB6kkpjyolXdNuwQ3zSWv9so4q0QLsZuw="; + }; - cmakeFlags = - [ - "-DRSTUDIO_TARGET=${if server then "Server" else "Desktop"}" - "-DRSTUDIO_USE_SYSTEM_SOCI=ON" - "-DRSTUDIO_USE_SYSTEM_BOOST=ON" - "-DRSTUDIO_USE_SYSTEM_YAML_CPP=ON" - "-DRSTUDIO_DISABLE_CHECK_FOR_UPDATES=ON" - "-DQUARTO_ENABLED=TRUE" - "-DPANDOC_VERSION=${pandoc.version}" - "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/lib/rstudio" - ] - ++ lib.optionals (!server) [ - "-DQT_QMAKE_EXECUTABLE=${libsForQt5.qmake}/bin/qmake" - ]; + nativeBuildInputs = + [ + cmake + unzip + ant + jdk + pandoc + nodejs + ] + ++ lib.optionals (!server) [ + copyDesktopItems + libsForQt5.wrapQtAppsHook + ]; - # Hack RStudio to only use the input R and provided libclang. - patches = [ - ./r-location.patch - ./clang-location.patch - ./use-system-node.patch - ./fix-resources-path.patch - ./pandoc-nix-path.patch - ./use-system-quarto.patch - ./ignore-etc-os-release.patch + buildInputs = + [ + boost183 + zlib + openssl + R + libuuid + yaml-cpp + soci + postgresql + quarto + ] + ++ lib.optionals server [ + sqlite.dev + pam + ] + ++ lib.optionals (!server) [ + libsForQt5.qtbase + libsForQt5.qtxmlpatterns + libsForQt5.qtsensors + libsForQt5.qtwebengine + libsForQt5.qtwebchannel ]; - postPatch = '' - substituteInPlace src/cpp/core/r_util/REnvironmentPosix.cpp --replace-fail '@R@' ${R} + cmakeFlags = + [ + "-DRSTUDIO_TARGET=${if server then "Server" else "Desktop"}" + "-DRSTUDIO_USE_SYSTEM_SOCI=ON" + "-DRSTUDIO_USE_SYSTEM_BOOST=ON" + "-DRSTUDIO_USE_SYSTEM_YAML_CPP=ON" + "-DRSTUDIO_DISABLE_CHECK_FOR_UPDATES=ON" + "-DQUARTO_ENABLED=TRUE" + "-DPANDOC_VERSION=${pandoc.version}" + "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/lib/rstudio" + ] + ++ lib.optionals (!server) [ + "-DQT_QMAKE_EXECUTABLE=${libsForQt5.qmake}/bin/qmake" + ]; + + # Hack RStudio to only use the input R and provided libclang. + patches = [ + ./r-location.patch + ./clang-location.patch + ./use-system-node.patch + ./fix-resources-path.patch + ./pandoc-nix-path.patch + ./use-system-quarto.patch + ./ignore-etc-os-release.patch + ]; - substituteInPlace src/gwt/build.xml \ - --replace-fail '@node@' ${nodejs} \ - --replace-fail './lib/quarto' ${quartoSrc} + postPatch = '' + substituteInPlace src/cpp/core/r_util/REnvironmentPosix.cpp --replace-fail '@R@' ${R} - substituteInPlace src/cpp/conf/rsession-dev.conf \ - --replace-fail '@node@' ${nodejs} + substituteInPlace src/gwt/build.xml \ + --replace-fail '@node@' ${nodejs} \ + --replace-fail './lib/quarto' ${quartoSrc} - substituteInPlace src/cpp/core/libclang/LibClang.cpp \ - --replace-fail '@libclang@' ${lib.getLib llvmPackages.libclang} \ - --replace-fail '@libclang.so@' ${lib.getLib llvmPackages.libclang}/lib/libclang.so + substituteInPlace src/cpp/conf/rsession-dev.conf \ + --replace-fail '@node@' ${nodejs} - substituteInPlace src/cpp/session/CMakeLists.txt \ - --replace-fail '@pandoc@' ${pandoc} \ - --replace-fail '@quarto@' ${quarto} + substituteInPlace src/cpp/core/libclang/LibClang.cpp \ + --replace-fail '@libclang@' ${lib.getLib llvmPackages.libclang} \ + --replace-fail '@libclang.so@' ${lib.getLib llvmPackages.libclang}/lib/libclang.so - substituteInPlace src/cpp/session/include/session/SessionConstants.hpp \ - --replace-fail '@pandoc@' ${pandoc}/bin \ - --replace-fail '@quarto@' ${quarto} - ''; + substituteInPlace src/cpp/session/CMakeLists.txt \ + --replace-fail '@pandoc@' ${pandoc} \ + --replace-fail '@quarto@' ${quarto} - hunspellDictionaries = lib.filter lib.isDerivation (lib.unique (lib.attrValues hunspellDicts)); - # These dicts contain identically-named dict files, so we only keep the - # -large versions in case of clashes - largeDicts = lib.filter (d: lib.hasInfix "-large-wordlist" d.name) hunspellDictionaries; - otherDicts = lib.filter ( - d: !(lib.hasAttr "dictFileName" d && lib.elem d.dictFileName (map (d: d.dictFileName) largeDicts)) - ) hunspellDictionaries; - dictionaries = largeDicts ++ otherDicts; + substituteInPlace src/cpp/session/include/session/SessionConstants.hpp \ + --replace-fail '@pandoc@' ${pandoc}/bin \ + --replace-fail '@quarto@' ${quarto} + ''; - preConfigure = '' - mkdir dependencies/dictionaries - for dict in ${builtins.concatStringsSep " " dictionaries}; do - for i in "$dict/share/hunspell/"*; do - ln -s $i dependencies/dictionaries/ - done + preConfigure = '' + mkdir dependencies/dictionaries + for dict in ${builtins.concatStringsSep " " dictionaries}; do + for i in "$dict/share/hunspell/"*; do + ln -s $i dependencies/dictionaries/ done + done - unzip -q ${mathJaxSrc} -d dependencies/mathjax-27 + unzip -q ${mathJaxSrc} -d dependencies/mathjax-27 - # As of Chocolate Cosmos, node 18.20.3 is used for runtime - # 18.18.2 is still used for build - # see https://github.com/rstudio/rstudio/commit/facb5cf1ab38fe77813aaf36590804e4f865d780 - mkdir -p dependencies/common/node/18.20.3 + # As of Chocolate Cosmos, node 18.20.3 is used for runtime + # 18.18.2 is still used for build + # see https://github.com/rstudio/rstudio/commit/facb5cf1ab38fe77813aaf36590804e4f865d780 + mkdir -p dependencies/common/node/18.20.3 - mkdir -p dependencies/pandoc/${pandoc.version} - cp ${pandoc}/bin/pandoc dependencies/pandoc/${pandoc.version}/pandoc + mkdir -p dependencies/pandoc/${pandoc.version} + cp ${pandoc}/bin/pandoc dependencies/pandoc/${pandoc.version}/pandoc - cp -r ${rsconnectSrc} dependencies/rsconnect - ( cd dependencies && ${R}/bin/R CMD build -d --no-build-vignettes rsconnect ) - ''; + cp -r ${rsconnectSrc} dependencies/rsconnect + ( cd dependencies && ${R}/bin/R CMD build -d --no-build-vignettes rsconnect ) + ''; - postInstall = '' - mkdir -p $out/bin $out/share + postInstall = '' + mkdir -p $out/bin $out/share - ${lib.optionalString (!server) '' - mkdir -p $out/share/icons/hicolor/48x48/apps - ln $out/lib/rstudio/rstudio.png $out/share/icons/hicolor/48x48/apps - ''} + ${lib.optionalString (!server) '' + mkdir -p $out/share/icons/hicolor/48x48/apps + ln $out/lib/rstudio/rstudio.png $out/share/icons/hicolor/48x48/apps + ''} - for f in {${ - if server then - "crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server" - else - "diagnostics,rpostback,rstudio" - }}; do - ln -s $out/lib/rstudio/bin/$f $out/bin - done + for f in {${ + if server then + "crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server" + else + "diagnostics,rpostback,rstudio" + }}; do + ln -s $out/lib/rstudio/bin/$f $out/bin + done - for f in .gitignore .Rbuildignore LICENSE README; do - find . -name $f -delete - done + for f in .gitignore .Rbuildignore LICENSE README; do + find . -name $f -delete + done - rm -r $out/lib/rstudio/{INSTALL,COPYING,NOTICE,README.md,SOURCE,VERSION} - ''; + rm -r $out/lib/rstudio/{INSTALL,COPYING,NOTICE,README.md,SOURCE,VERSION} + ''; - meta = { - broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64); - inherit description; - homepage = "https://www.rstudio.com/"; - license = lib.licenses.agpl3Only; - maintainers = with lib.maintainers; [ - ciil - cfhammill - ]; - mainProgram = "rstudio" + lib.optionalString server "-server"; - platforms = lib.platforms.linux; - }; + qtWrapperArgs = lib.optionals (!server) [ + "--suffix PATH : ${lib.makeBinPath [ gnumake ]}" + ]; - passthru = { - inherit server; - tests = { - inherit (nixosTests) rstudio-server; - }; + passthru = { + inherit server; + tests = { + inherit (nixosTests) rstudio-server; }; - } - // lib.optionalAttrs (!server) { - qtWrapperArgs = [ - "--suffix PATH : ${lib.makeBinPath [ gnumake ]}" - ]; + }; - desktopItems = [ - (makeDesktopItem { - name = pname; - exec = "rstudio %F"; - icon = "rstudio"; - desktopName = "RStudio"; - genericName = "IDE"; - comment = description; - categories = [ "Development" ]; - mimeTypes = [ - "text/x-r-source" - "text/x-r" - "text/x-R" - "text/x-r-doc" - "text/x-r-sweave" - "text/x-r-markdown" - "text/x-r-html" - "text/x-r-presentation" - "application/x-r-data" - "application/x-r-project" - "text/x-r-history" - "text/x-r-profile" - "text/x-tex" - "text/x-markdown" - "text/html" - "text/css" - "text/javascript" - "text/x-chdr" - "text/x-csrc" - "text/x-c++hdr" - "text/x-c++src" - ]; - }) + meta = { + broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64); + description = "Set of integrated tools for the R language"; + homepage = "https://www.rstudio.com/"; + license = lib.licenses.agpl3Only; + maintainers = with lib.maintainers; [ + ciil + cfhammill ]; - } -) + mainProgram = "rstudio" + lib.optionalString server "-server"; + platforms = lib.platforms.linux; + }; + + desktopItems = [ + (makeDesktopItem { + name = "RStudio"; + exec = "rstudio %F"; + icon = "rstudio"; + desktopName = "RStudio"; + genericName = "IDE"; + comment = meta.description; + categories = [ "Development" ]; + mimeTypes = [ + "text/x-r-source" + "text/x-r" + "text/x-R" + "text/x-r-doc" + "text/x-r-sweave" + "text/x-r-markdown" + "text/x-r-html" + "text/x-r-presentation" + "application/x-r-data" + "application/x-r-project" + "text/x-r-history" + "text/x-r-profile" + "text/x-tex" + "text/x-markdown" + "text/html" + "text/css" + "text/javascript" + "text/x-chdr" + "text/x-csrc" + "text/x-c++hdr" + "text/x-c++src" + ]; + }) + ]; +} From e8cc15f2b53ac8c572d785a49479ab6b678b6d10 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sun, 8 Dec 2024 15:45:51 +0100 Subject: [PATCH 4/5] rstudio: refactor patches and deps, use lib.cmake* --- .../editors/rstudio/clang-location.patch | 52 ++--- pkgs/applications/editors/rstudio/default.nix | 200 +++++++----------- .../dont-assume-pandoc-in-quarto.patch | 48 +++++ .../editors/rstudio/dont-yarn-install.patch | 16 ++ .../editors/rstudio/pandoc-nix-path.patch | 18 -- .../editors/rstudio/use-system-node.patch | 81 ------- .../editors/rstudio/use-system-quarto.patch | 46 ---- 7 files changed, 155 insertions(+), 306 deletions(-) create mode 100644 pkgs/applications/editors/rstudio/dont-assume-pandoc-in-quarto.patch create mode 100644 pkgs/applications/editors/rstudio/dont-yarn-install.patch delete mode 100644 pkgs/applications/editors/rstudio/pandoc-nix-path.patch delete mode 100644 pkgs/applications/editors/rstudio/use-system-node.patch delete mode 100644 pkgs/applications/editors/rstudio/use-system-quarto.patch diff --git a/pkgs/applications/editors/rstudio/clang-location.patch b/pkgs/applications/editors/rstudio/clang-location.patch index ea82678d11814..45e5e90cd3d6e 100644 --- a/pkgs/applications/editors/rstudio/clang-location.patch +++ b/pkgs/applications/editors/rstudio/clang-location.patch @@ -1,38 +1,23 @@ +diff --git a/src/cpp/core/libclang/LibClang.cpp b/src/cpp/core/libclang/LibClang.cpp +index f166a43b37..d8024b2ce7 100644 --- a/src/cpp/core/libclang/LibClang.cpp +++ b/src/cpp/core/libclang/LibClang.cpp -@@ -62,7 +62,7 @@ - - // we need to add in the associated libclang headers as - // they are not discovered / used by default during compilation -- FilePath llvmPath = s_libraryPath.getParent().getParent(); -+ FilePath llvmPath("@libclang@"); - boost::format fmt("%1%/lib/clang/%2%/include"); - fmt % llvmPath.getAbsolutePath() % version.asString(); - std::string includePath = fmt.str(); -@@ -74,47 +74,7 @@ - - std::vector systemClangVersions() - { -- std::vector clangVersions; -- --#if defined(__APPLE__) -- // NOTE: the version of libclang.dylib bundled with Xcode -- // doesn't seem to work well when loaded as a library -- // (there seems to be extra orchestration required to get -- // include paths set up; easier to just depend on command -- // line tools since we request their installation in other -- // contexts as well) -- clangVersions = { +@@ -84,34 +84,13 @@ std::vector systemClangVersions() + // line tools since we request their installation in other + // contexts as well) + clangVersions = { - "/Library/Developer/CommandLineTools/usr/lib/libclang.dylib" -- }; --#elif defined(__unix__) -- // default set of versions -- clangVersions = { ++ "@libclang@/lib/libclang.dylib" + }; + #elif defined(__unix__) + // default set of versions + clangVersions = { - "/usr/lib/libclang.so", - "/usr/lib/llvm/libclang.so", - "/usr/lib64/libclang.so", - "/usr/lib64/llvm/libclang.so", -- }; ++ "@libclang@/lib/libclang.so", + }; - - // iterate through the set of available 'llvm' directories - for (const char* prefix : {"/usr/lib", "/usr/lib64"}) @@ -51,11 +36,6 @@ - if (path.getFilename().find("llvm") == 0) - clangVersions.push_back(path.completePath("lib/libclang.so.1").getAbsolutePath()); - } --#endif -- -- return clangVersions; -+ return std::vector { "@libclang.so@" }; - } - - - + #endif + + return clangVersions; diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index 659793a485123..867742d3b7853 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -1,10 +1,9 @@ { lib, stdenv, - fetchurl, + fetchzip, fetchFromGitHub, - makeDesktopItem, - copyDesktopItems, + replaceVars, cmake, boost183, zlib, @@ -14,7 +13,6 @@ quarto, libuuid, hunspellDicts, - unzip, ant, jdk, gnumake, @@ -22,25 +20,20 @@ llvmPackages, yaml-cpp, soci, - postgresql, + sqlite, nodejs, + yarn, + yarnConfigHook, + fetchYarnDeps, server ? false, # build server version - sqlite, pam, nixosTests, }: let - mathJaxSrc = fetchurl { + mathJaxSrc = fetchzip { url = "https://s3.amazonaws.com/rstudio-buildtools/mathjax-27.zip"; - hash = "sha256-xWy6psTOA8H8uusrXqPDEtL7diajYCVHcMvLiPsgQXY="; - }; - - rsconnectSrc = fetchFromGitHub { - owner = "rstudio"; - repo = "rsconnect"; - rev = "v1.2.2"; - hash = "sha256-wvM9Bm7Nb6yU9z0o+uF5lB2kdgjOW5wZSk6y48NPF2U="; + hash = "sha256-J7SZK/9q3HcXTD7WFHxvh++ttuCd89Vc4SEBrUEU0AI="; }; # Ideally, rev should match the rstudio release name. @@ -73,21 +66,20 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "rstudio"; repo = "rstudio"; - rev = "v" + version; + rev = "refs/tags/v${version}"; hash = "sha256-j258eW1MYQrB6kkpjyolXdNuwQ3zSWv9so4q0QLsZuw="; }; nativeBuildInputs = [ cmake - unzip ant jdk - pandoc nodejs + yarn + yarnConfigHook ] ++ lib.optionals (!server) [ - copyDesktopItems libsForQt5.wrapQtAppsHook ]; @@ -100,13 +92,9 @@ stdenv.mkDerivation rec { libuuid yaml-cpp soci - postgresql - quarto - ] - ++ lib.optionals server [ sqlite.dev - pam ] + ++ lib.optionals server [ pam ] ++ lib.optionals (!server) [ libsForQt5.qtbase libsForQt5.qtxmlpatterns @@ -117,97 +105,94 @@ stdenv.mkDerivation rec { cmakeFlags = [ - "-DRSTUDIO_TARGET=${if server then "Server" else "Desktop"}" - "-DRSTUDIO_USE_SYSTEM_SOCI=ON" - "-DRSTUDIO_USE_SYSTEM_BOOST=ON" - "-DRSTUDIO_USE_SYSTEM_YAML_CPP=ON" - "-DRSTUDIO_DISABLE_CHECK_FOR_UPDATES=ON" - "-DQUARTO_ENABLED=TRUE" - "-DPANDOC_VERSION=${pandoc.version}" - "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/lib/rstudio" + (lib.cmakeFeature "RSTUDIO_TARGET" (if server then "Server" else "Desktop")) + (lib.cmakeBool "RSTUDIO_USE_SYSTEM_SOCI" true) + (lib.cmakeBool "RSTUDIO_USE_SYSTEM_BOOST" true) + (lib.cmakeBool "RSTUDIO_USE_SYSTEM_YAML_CPP" true) + (lib.cmakeBool "RSTUDIO_DISABLE_CHECK_FOR_UPDATES" true) + (lib.cmakeBool "QUARTO_ENABLED" true) + (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/lib/rstudio") ] ++ lib.optionals (!server) [ - "-DQT_QMAKE_EXECUTABLE=${libsForQt5.qmake}/bin/qmake" + (lib.cmakeFeature "QT_QMAKE_EXECUTABLE" "${libsForQt5.qmake}/bin/qmake") + (lib.cmakeBool "RSTUDIO_INSTALL_FREEDESKTOP" true) ]; - # Hack RStudio to only use the input R and provided libclang. patches = [ - ./r-location.patch - ./clang-location.patch - ./use-system-node.patch + # Hack RStudio to only use the input R and provided libclang. + (replaceVars ./r-location.patch { + R = lib.getBin R; + }) + (replaceVars ./clang-location.patch { + libclang = lib.getLib llvmPackages.libclang; + }) + ./fix-resources-path.patch - ./pandoc-nix-path.patch - ./use-system-quarto.patch ./ignore-etc-os-release.patch + ./dont-yarn-install.patch + ./dont-assume-pandoc-in-quarto.patch ]; postPatch = '' - substituteInPlace src/cpp/core/r_util/REnvironmentPosix.cpp --replace-fail '@R@' ${R} - - substituteInPlace src/gwt/build.xml \ - --replace-fail '@node@' ${nodejs} \ - --replace-fail './lib/quarto' ${quartoSrc} + # fix .desktop Exec field + substituteInPlace src/node/desktop/resources/freedesktop/rstudio.desktop.in \ + --replace-fail "''${CMAKE_INSTALL_PREFIX}/rstudio" "rstudio" - substituteInPlace src/cpp/conf/rsession-dev.conf \ - --replace-fail '@node@' ${nodejs} + # set install path of freedesktop files + substituteInPlace src/{cpp,node}/desktop/CMakeLists.txt \ + --replace-fail "/usr/share" "$out/share" + ''; - substituteInPlace src/cpp/core/libclang/LibClang.cpp \ - --replace-fail '@libclang@' ${lib.getLib llvmPackages.libclang} \ - --replace-fail '@libclang.so@' ${lib.getLib llvmPackages.libclang}/lib/libclang.so + yarnOfflineCache = fetchYarnDeps { + yarnLock = quartoSrc + "/yarn.lock"; + hash = "sha256-Qw8O1Jzl2EO0DEF3Jrw/cIT9t22zs3jyKgDA5XZbuGA="; + }; - substituteInPlace src/cpp/session/CMakeLists.txt \ - --replace-fail '@pandoc@' ${pandoc} \ - --replace-fail '@quarto@' ${quarto} - - substituteInPlace src/cpp/session/include/session/SessionConstants.hpp \ - --replace-fail '@pandoc@' ${pandoc}/bin \ - --replace-fail '@quarto@' ${quarto} - ''; + dontYarnInstallDeps = true; # will call manually in preConfigure preConfigure = '' - mkdir dependencies/dictionaries - for dict in ${builtins.concatStringsSep " " dictionaries}; do - for i in "$dict/share/hunspell/"*; do - ln -s $i dependencies/dictionaries/ - done - done + # set up node_modules directory inside quarto so that panmirror can be built + mkdir src/gwt/lib/quarto + cp -r --no-preserve=all ${quartoSrc}/* src/gwt/lib/quarto + pushd src/gwt/lib/quarto + yarnConfigHook + popd + + ### set up dependencies that will be copied into the result + # note: only the directory names have to match upstream, the actual versions don't + # note: symlinks are preserved + + mkdir dependencies/dictionaries + for dict in ${builtins.concatStringsSep " " dictionaries}; do + for i in "$dict/share/hunspell/"*; do + ln -s $i dependencies/dictionaries/ + done + done - unzip -q ${mathJaxSrc} -d dependencies/mathjax-27 + ln -s ${quarto} dependencies/quarto - # As of Chocolate Cosmos, node 18.20.3 is used for runtime - # 18.18.2 is still used for build - # see https://github.com/rstudio/rstudio/commit/facb5cf1ab38fe77813aaf36590804e4f865d780 - mkdir -p dependencies/common/node/18.20.3 + # version in dependencies/common/install-mathjax + ln -s ${mathJaxSrc} dependencies/mathjax-27 - mkdir -p dependencies/pandoc/${pandoc.version} - cp ${pandoc}/bin/pandoc dependencies/pandoc/${pandoc.version}/pandoc + # version in CMakeGlobals.txt (PANDOC_VERSION) + mkdir -p dependencies/pandoc/2.18 + ln -s ${lib.getBin pandoc}/bin/* dependencies/pandoc/2.18 - cp -r ${rsconnectSrc} dependencies/rsconnect - ( cd dependencies && ${R}/bin/R CMD build -d --no-build-vignettes rsconnect ) + # version in CMakeGlobals.txt (RSTUDIO_INSTALLED_NODE_VERSION) + mkdir -p dependencies/common/node + ln -s ${nodejs} dependencies/common/node/18.20.3 ''; postInstall = '' - mkdir -p $out/bin $out/share + mkdir -p $out/bin - ${lib.optionalString (!server) '' - mkdir -p $out/share/icons/hicolor/48x48/apps - ln $out/lib/rstudio/rstudio.png $out/share/icons/hicolor/48x48/apps + ${lib.optionalString server '' + ln -s $out/lib/rstudio/bin/{crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server} $out/bin ''} - for f in {${ - if server then - "crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server" - else - "diagnostics,rpostback,rstudio" - }}; do - ln -s $out/lib/rstudio/bin/$f $out/bin - done - - for f in .gitignore .Rbuildignore LICENSE README; do - find . -name $f -delete - done - - rm -r $out/lib/rstudio/{INSTALL,COPYING,NOTICE,README.md,SOURCE,VERSION} + ${lib.optionalString (!server) '' + ln -s $out/lib/rstudio/bin/{diagnostics,rpostback,rstudio} $out/bin + ''} ''; qtWrapperArgs = lib.optionals (!server) [ @@ -233,39 +218,4 @@ stdenv.mkDerivation rec { mainProgram = "rstudio" + lib.optionalString server "-server"; platforms = lib.platforms.linux; }; - - desktopItems = [ - (makeDesktopItem { - name = "RStudio"; - exec = "rstudio %F"; - icon = "rstudio"; - desktopName = "RStudio"; - genericName = "IDE"; - comment = meta.description; - categories = [ "Development" ]; - mimeTypes = [ - "text/x-r-source" - "text/x-r" - "text/x-R" - "text/x-r-doc" - "text/x-r-sweave" - "text/x-r-markdown" - "text/x-r-html" - "text/x-r-presentation" - "application/x-r-data" - "application/x-r-project" - "text/x-r-history" - "text/x-r-profile" - "text/x-tex" - "text/x-markdown" - "text/html" - "text/css" - "text/javascript" - "text/x-chdr" - "text/x-csrc" - "text/x-c++hdr" - "text/x-c++src" - ]; - }) - ]; } diff --git a/pkgs/applications/editors/rstudio/dont-assume-pandoc-in-quarto.patch b/pkgs/applications/editors/rstudio/dont-assume-pandoc-in-quarto.patch new file mode 100644 index 0000000000000..b86ec4079da2a --- /dev/null +++ b/pkgs/applications/editors/rstudio/dont-assume-pandoc-in-quarto.patch @@ -0,0 +1,48 @@ +diff --git a/src/cpp/session/CMakeLists.txt b/src/cpp/session/CMakeLists.txt +index 0202e84..596b9f8 100644 +--- a/src/cpp/session/CMakeLists.txt ++++ b/src/cpp/session/CMakeLists.txt +@@ -59,11 +59,7 @@ endif() + + + # install pandoc +-# - by default, we use quarto + quarto's bundled pandoc +-# - if quarto is not enabled, use pandoc fallback +-if(QUARTO_ENABLED) +- set(RSTUDIO_DEPENDENCIES_PANDOC_DIR "${RSTUDIO_DEPENDENCIES_QUARTO_DIR}/bin/tools") +-elseif(EXISTS "${RSTUDIO_TOOLS_ROOT}/pandoc/${PANDOC_VERSION}") ++if(EXISTS "${RSTUDIO_TOOLS_ROOT}/pandoc/${PANDOC_VERSION}") + set(RSTUDIO_DEPENDENCIES_PANDOC_DIR "${RSTUDIO_TOOLS_ROOT}/pandoc/${PANDOC_VERSION}") + else() + set(RSTUDIO_DEPENDENCIES_PANDOC_DIR "${RSTUDIO_DEPENDENCIES_DIR}/pandoc/${PANDOC_VERSION}") +@@ -733,11 +729,10 @@ if(NOT RSTUDIO_SESSION_WIN32 AND NOT RSESSION_ALTERNATE_BUILD) + PATTERN ".gitignore" + EXCLUDE) + endif() +- else() +- install(DIRECTORY "${RSTUDIO_DEPENDENCIES_PANDOC_DIR}/" +- DESTINATION "${RSTUDIO_INSTALL_BIN}/pandoc" +- USE_SOURCE_PERMISSIONS) + endif() ++ install(DIRECTORY "${RSTUDIO_DEPENDENCIES_PANDOC_DIR}/" ++ DESTINATION "${RSTUDIO_INSTALL_BIN}/pandoc" ++ USE_SOURCE_PERMISSIONS) + + # install embedded packages + foreach(PKG ${RSTUDIO_EMBEDDED_PACKAGES}) +diff --git a/src/cpp/session/include/session/SessionConstants.hpp b/src/cpp/session/include/session/SessionConstants.hpp +index e6aef22..57491ec 100644 +--- a/src/cpp/session/include/session/SessionConstants.hpp ++++ b/src/cpp/session/include/session/SessionConstants.hpp +@@ -147,11 +147,7 @@ + #define kSessionTmpDirEnvVar "RS_SESSION_TMP_DIR" + #define kSessionTmpDir "rstudio-rsession" + +-#ifdef QUARTO_ENABLED +-# define kDefaultPandocPath "bin/quarto/bin/tools" +-#else + # define kDefaultPandocPath "bin/pandoc" +-#endif + + #define kDefaultNodePath "bin/node" + #define kDefaultQuartoPath "bin/quarto" diff --git a/pkgs/applications/editors/rstudio/dont-yarn-install.patch b/pkgs/applications/editors/rstudio/dont-yarn-install.patch new file mode 100644 index 0000000000000..72a5e1c9050bc --- /dev/null +++ b/pkgs/applications/editors/rstudio/dont-yarn-install.patch @@ -0,0 +1,16 @@ +diff --git a/src/gwt/build.xml b/src/gwt/build.xml +index 27ffe33..4218678 100644 +--- a/src/gwt/build.xml ++++ b/src/gwt/build.xml +@@ -139,11 +139,6 @@ + + + +- +- +- +- +- + + + diff --git a/pkgs/applications/editors/rstudio/pandoc-nix-path.patch b/pkgs/applications/editors/rstudio/pandoc-nix-path.patch deleted file mode 100644 index 2782a5a0d7a25..0000000000000 --- a/pkgs/applications/editors/rstudio/pandoc-nix-path.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/src/cpp/session/include/session/SessionConstants.hpp -+++ b/src/cpp/session/include/session/SessionConstants.hpp -@@ -142,13 +142,13 @@ - #define kSessionTmpDir "rstudio-rsession" - - #ifdef QUARTO_ENABLED --# define kDefaultPandocPath "bin/quarto/bin/tools" -+# define kDefaultPandocPath "@pandoc@" - #else - # define kDefaultPandocPath "bin/pandoc" - #endif - - #define kDefaultNodePath "bin/node" --#define kDefaultQuartoPath "bin/quarto" -+#define kDefaultQuartoPath "@quarto@" - #define kDefaultRsclangPath "bin/rsclang" - - #ifdef _WIN32 diff --git a/pkgs/applications/editors/rstudio/use-system-node.patch b/pkgs/applications/editors/rstudio/use-system-node.patch deleted file mode 100644 index 5e8b2170da105..0000000000000 --- a/pkgs/applications/editors/rstudio/use-system-node.patch +++ /dev/null @@ -1,81 +0,0 @@ -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 @@ - - - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -+ - - - -@@ -133,28 +111,11 @@ - - - -- -- -- -- -- - -- -- -- -- -- -- -- -- -- -- -- -- -+ -+ -+ - -- -- -- - - - - diff --git a/pkgs/applications/editors/rstudio/use-system-quarto.patch b/pkgs/applications/editors/rstudio/use-system-quarto.patch deleted file mode 100644 index 89653219dbea6..0000000000000 --- a/pkgs/applications/editors/rstudio/use-system-quarto.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- a/src/cpp/session/CMakeLists.txt -+++ b/src/cpp/session/CMakeLists.txt -@@ -36,18 +36,14 @@ - else() - set(RSTUDIO_DEPENDENCIES_DICTIONARIES_DIR "${RSTUDIO_DEPENDENCIES_DIR}/dictionaries") - endif() -- -+ - if(EXISTS "${RSTUDIO_TOOLS_ROOT}/mathjax-27") - set(RSTUDIO_DEPENDENCIES_MATHJAX_DIR "${RSTUDIO_TOOLS_ROOT}/mathjax-27") - else() - set(RSTUDIO_DEPENDENCIES_MATHJAX_DIR "${RSTUDIO_DEPENDENCIES_DIR}/mathjax-27") - endif() - -- if(EXISTS "${RSTUDIO_TOOLS_ROOT}/quarto") -- set(RSTUDIO_DEPENDENCIES_QUARTO_DIR "${RSTUDIO_TOOLS_ROOT}/quarto") -- else() -- set(RSTUDIO_DEPENDENCIES_QUARTO_DIR "${RSTUDIO_DEPENDENCIES_DIR}/quarto") -- endif() -+ set(RSTUDIO_DEPENDENCIES_QUARTO_DIR "@quarto@") - - endif() - -@@ -56,7 +52,7 @@ - # - by default, we use quarto + quarto's bundled pandoc - # - if quarto is not enabled, use pandoc fallback - if(QUARTO_ENABLED) -- set(RSTUDIO_DEPENDENCIES_PANDOC_DIR "${RSTUDIO_DEPENDENCIES_QUARTO_DIR}/bin/tools") -+ set(RSTUDIO_DEPENDENCIES_PANDOC_DIR "@pandoc@/bin") - elseif(EXISTS "${RSTUDIO_TOOLS_ROOT}/pandoc/${PANDOC_VERSION}") - set(RSTUDIO_DEPENDENCIES_PANDOC_DIR "${RSTUDIO_TOOLS_ROOT}/pandoc/${PANDOC_VERSION}") - else() -@@ -66,11 +62,9 @@ - - # validate our dependencies exist - foreach(VAR RSTUDIO_DEPENDENCIES_DICTIONARIES_DIR -- RSTUDIO_DEPENDENCIES_MATHJAX_DIR -- RSTUDIO_DEPENDENCIES_PANDOC_DIR -- RSTUDIO_DEPENDENCIES_QUARTO_DIR) -+ RSTUDIO_DEPENDENCIES_MATHJAX_DIR) -+ - -- - # skip quarto if not enabled - if("${VAR}" STREQUAL "RSTUDIO_DEPENDENCIES_QUARTO_DIR" AND NOT QUARTO_ENABLED) - continue() From 3ce431ad7af33578901f4013f56d85e293b6dcfa Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Wed, 18 Dec 2024 23:56:21 +0100 Subject: [PATCH 5/5] rstudioWrapper: only symlink share directory if not server --- pkgs/development/r-modules/wrapper-rstudio.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/r-modules/wrapper-rstudio.nix b/pkgs/development/r-modules/wrapper-rstudio.nix index 8088098484f87..3c85657141d16 100644 --- a/pkgs/development/r-modules/wrapper-rstudio.nix +++ b/pkgs/development/r-modules/wrapper-rstudio.nix @@ -37,8 +37,7 @@ runCommand (rstudio.name + "-wrapper") } ( '' - mkdir -p $out/bin - ln -s ${rstudio}/share $out + mkdir -p $out echo "# Autogenerated by wrapper-rstudio.nix from R_LIBS_SITE" > $out/$fixLibsR echo -n ".libPaths(c(.libPaths(), \"" >> $out/$fixLibsR echo -n $R_LIBS_SITE | sed -e 's/:/", "/g' >> $out/$fixLibsR @@ -56,6 +55,7 @@ runCommand (rstudio.name + "-wrapper") '' else '' + ln -s ${rstudio}/share $out makeQtWrapper ${rstudio}/bin/rstudio $out/bin/rstudio \ --set R_PROFILE_USER $out/$fixLibsR ''