Make it working with recent quarto versions

This commit is contained in:
Aleksandr Beliaev 2022-04-27 23:34:10 +12:00
parent 1b3b28ab7b
commit 9d3dcd9388
4 changed files with 146 additions and 9 deletions

View file

@ -1,7 +1,7 @@
pkgbase = rstudio-desktop
pkgdesc = A powerful and productive integrated development environment (IDE) for R programming language
pkgver = 2022.02.1+461
pkgrel = 1
pkgrel = 2
url = https://www.rstudio.com/products/rstudio/
arch = x86_64
license = AGPL3
@ -49,6 +49,8 @@ pkgbase = rstudio-desktop
source = qt.conf
source = cran_multithread.patch
source = sigstksz_gcc11.patch
source = 10952.patch
source = quarto_pandoc_location.patch
sha256sums = 41e48e21ddc0a9c1ebf06ff16d846b0389720f2ee66d3fcfd5ff0707578b597d
sha256sums = b98e704164f54be596779696a3fcd11be5785c9907a99ec535ff6e9525ad5f9a
sha256sums = 970701dacc55170088f5eb327137cb4a7581ebb4734188dfcc2fad9941745d1b
@ -56,5 +58,7 @@ pkgbase = rstudio-desktop
sha256sums = 723626bfe05dafa545e135e8e61a482df111f488583fef155301acc5ecbbf921
sha256sums = c907e6eec5ef324ad498b44fb9926bb5baafc4e0778ca01f6ba9b49dd3a2a980
sha256sums = 7b8420db08f848f7baac0f3104c879ac7ce6e27e463f96a6b1c6589cd4b8df82
sha256sums = 71c41818d099c07d928aa9689a5fd57bb3dc187b9788a8d5cc528ef6208b7726
sha256sums = f496c8d012ec7211b7d76240932c1b33fc76c5bb756b354eb00dd5c4344baeab
pkgname = rstudio-desktop

112
10952.patch Normal file
View file

@ -0,0 +1,112 @@
From 8fc8516d9a707d047a4b02168b59828ed8ea51f6 Mon Sep 17 00:00:00 2001
From: Tim Mok <tim.mok@rstudio.com>
Date: Mon, 11 Apr 2022 10:52:13 -0400
Subject: [PATCH] Update Quarto to v0.9.230
Change default and Mac Pandoc lookup locations when using packaged Quarto
---
dependencies/common/install-quarto | 2 +-
dependencies/tools/upload-quarto.sh | 2 +-
dependencies/windows/install-dependencies.cmd | 2 +-
src/cpp/session/CMakeLists.txt | 2 +-
src/cpp/session/SessionOptions.cpp | 2 +-
src/cpp/session/include/session/SessionConstants.hpp | 2 +-
src/cpp/session/modules/quarto/SessionQuarto.cpp | 4 ++--
src/cpp/session/session-options.json | 2 +-
8 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dependencies/common/install-quarto b/dependencies/common/install-quarto
index fb96028a713..2003fc2dbba 100755
--- a/dependencies/common/install-quarto
+++ b/dependencies/common/install-quarto
@@ -26,7 +26,7 @@ if [ "$(arch)" = "aarch64" ]; then
fi
# variables that control download + installation process
-QUARTO_VERSION="0.9.80"
+QUARTO_VERSION="0.9.230"
QUARTO_SUBDIR="quarto"
QUARTO_URL_BASE="https://s3.amazonaws.com/rstudio-buildtools/quarto/${QUARTO_VERSION}"
diff --git a/dependencies/tools/upload-quarto.sh b/dependencies/tools/upload-quarto.sh
index ad4140988d8..e6e6ae6773c 100755
--- a/dependencies/tools/upload-quarto.sh
+++ b/dependencies/tools/upload-quarto.sh
@@ -5,7 +5,7 @@
# tools (awscli) installed, and configured with a valid AWS account.
# Modify to set the Quarto version to upload
-QUARTO_VERSION=0.9.80
+QUARTO_VERSION=0.9.230
BASEURL="https://github.com/quarto-dev/quarto-cli/releases/download/"
AWS_BUCKET="s3://rstudio-buildtools"
diff --git a/dependencies/windows/install-dependencies.cmd b/dependencies/windows/install-dependencies.cmd
index 15660710524..0511a94dfea 100644
--- a/dependencies/windows/install-dependencies.cmd
+++ b/dependencies/windows/install-dependencies.cmd
@@ -39,7 +39,7 @@ set PANDOC_VERSION=2.16.2
set PANDOC_NAME=pandoc-%PANDOC_VERSION%
set PANDOC_FILE=%PANDOC_NAME%-windows-x86_64.zip
-set QUARTO_VERSION=0.9.80
+set QUARTO_VERSION=0.9.230
set QUARTO_FILE=quarto-%QUARTO_VERSION%-win.zip
set LIBCLANG_VERSION=5.0.2
diff --git a/src/cpp/session/CMakeLists.txt b/src/cpp/session/CMakeLists.txt
index 0485e3e6ca8..a2aebf8a7bd 100644
--- a/src/cpp/session/CMakeLists.txt
+++ b/src/cpp/session/CMakeLists.txt
@@ -56,7 +56,7 @@ endif()
# - 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")
+ set(RSTUDIO_DEPENDENCIES_PANDOC_DIR "${RSTUDIO_DEPENDENCIES_QUARTO_DIR}/bin/tools")
elseif(EXISTS "${RSTUDIO_TOOLS_ROOT}/pandoc/${PANDOC_VERSION}")
set(RSTUDIO_DEPENDENCIES_PANDOC_DIR "${RSTUDIO_TOOLS_ROOT}/pandoc/${PANDOC_VERSION}")
else()
diff --git a/src/cpp/session/include/session/SessionConstants.hpp b/src/cpp/session/include/session/SessionConstants.hpp
index 13e72e5a5b5..69b29685252 100644
--- a/src/cpp/session/include/session/SessionConstants.hpp
+++ b/src/cpp/session/include/session/SessionConstants.hpp
@@ -138,7 +138,7 @@
#define kSessionTmpDir "rstudio-rsession"
#ifdef QUARTO_ENABLED
-# define kDefaultPandocPath "bin/quarto/bin"
+# define kDefaultPandocPath "bin/quarto/bin/tools"
#else
# define kDefaultPandocPath "bin/pandoc"
#endif
diff --git a/src/cpp/session/modules/quarto/SessionQuarto.cpp b/src/cpp/session/modules/quarto/SessionQuarto.cpp
index abea5b8620c..d359adf4e95 100644
--- a/src/cpp/session/modules/quarto/SessionQuarto.cpp
+++ b/src/cpp/session/modules/quarto/SessionQuarto.cpp
@@ -207,10 +207,10 @@ void detectQuartoInstallation()
{
#ifdef QUARTO_ENABLED
// required quarto version (quarto features don't work w/o it)
- const Version kQuartoRequiredVersion("0.9.80");
+ const Version kQuartoRequiredVersion("0.9.230");
// recommended quarto version (a bit more pestery than required)
- const Version kQuartoRecommendedVersion("0.9.80");
+ const Version kQuartoRecommendedVersion("0.9.230");
// reset
s_userInstalledPath = FilePath();
diff --git a/src/cpp/session/session-options.json b/src/cpp/session/session-options.json
index e79189b8196..ac1f16ba07d 100644
--- a/src/cpp/session/session-options.json
+++ b/src/cpp/session/session-options.json
@@ -694,7 +694,7 @@
"name": "external-pandoc-path",
"type": "core::FilePath",
"memberName": "pandocPath_",
- "defaultValue": {"code": "kDefaultPandocPath", "description": "bin/quarto/bin"},
+ "defaultValue": {"code": "kDefaultPandocPath", "description": "bin/quarto/bin/tools"},
"description": "Specifies the path to pandoc binaries."
},
{

View file

@ -16,7 +16,7 @@ _ginver=2.1.2
_nodever=14.17.5
_quarto="FALSE"
pkgrel=1
pkgrel=2
pkgdesc="A powerful and productive integrated development environment (IDE) for R programming language"
arch=('x86_64')
url="https://www.rstudio.com/products/rstudio/"
@ -36,7 +36,9 @@ source=("rstudio-$pkgver.tar.gz::https://github.com/rstudio/rstudio/archive/refs
"https://nodejs.org/dist/v${_nodever}/node-v${_nodever}-linux-x64.tar.gz"
"qt.conf"
"cran_multithread.patch"
"sigstksz_gcc11.patch")
"sigstksz_gcc11.patch"
"10952.patch"
"quarto_pandoc_location.patch")
sha256sums=('41e48e21ddc0a9c1ebf06ff16d846b0389720f2ee66d3fcfd5ff0707578b597d'
'b98e704164f54be596779696a3fcd11be5785c9907a99ec535ff6e9525ad5f9a'
@ -44,7 +46,9 @@ sha256sums=('41e48e21ddc0a9c1ebf06ff16d846b0389720f2ee66d3fcfd5ff0707578b597d'
'dc04c7e60235ff73536ba0d9e50638090f60cacabfd83184082dce3b330afc6e'
'723626bfe05dafa545e135e8e61a482df111f488583fef155301acc5ecbbf921'
'c907e6eec5ef324ad498b44fb9926bb5baafc4e0778ca01f6ba9b49dd3a2a980'
'7b8420db08f848f7baac0f3104c879ac7ce6e27e463f96a6b1c6589cd4b8df82')
'7b8420db08f848f7baac0f3104c879ac7ce6e27e463f96a6b1c6589cd4b8df82'
'71c41818d099c07d928aa9689a5fd57bb3dc187b9788a8d5cc528ef6208b7726'
'f496c8d012ec7211b7d76240932c1b33fc76c5bb756b354eb00dd5c4344baeab')
noextract=("gin-${_ginver}.zip")
@ -54,6 +58,11 @@ prepare() {
sed "s/@@proc_num@@/${JOBS}/" -i ${srcdir}/cran_multithread.patch
patch -p1 < ${srcdir}/cran_multithread.patch
patch -p1 < ${srcdir}/sigstksz_gcc11.patch
# Fix for quarto/pandoc location
# https://github.com/rstudio/rstudio/pull/10952
patch -p1 < ${srcdir}/10952.patch
# Fix for missed path to new pandoc location in upstream
patch -p1 < ${srcdir}/quarto_pandoc_location.patch
msg "Extracting dependencies..."
cd "${srcdir}/${_srcname}/src/gwt"
@ -79,9 +88,9 @@ prepare() {
# Fix links for src/cpp/session/CMakeLists.txt
cd "${srcdir}/${_srcname}/dependencies"
ln -sfT common/dictionaries dictionaries
ln -sfT common/mathjax-27 mathjax-27
ln -sfT common/pandoc pandoc
ln -sfT /usr/share/myspell/dicts dictionaries
ln -sfT /usr/share/mathjax2 mathjax-27
#ln -sfT /usr/bin/pandoc pandoc
}
build() {
@ -93,9 +102,9 @@ build() {
msg "Enabling Quarto support..."
_quarto="TRUE"
cd "${srcdir}/${_srcname}/dependencies"
install -d quarto/bin
install -d quarto/bin/tools
ln -sfT /usr/bin/quarto quarto/bin/quarto
ln -sfT /usr/bin/pandoc quarto/bin/pandoc
ln -sfT /usr/bin/pandoc quarto/bin/tools/pandoc
fi
cd ${srcdir}

View file

@ -0,0 +1,12 @@
diff -ur a/src/cpp/session/modules/quarto/SessionQuartoXRefs.cpp b/src/cpp/session/modules/quarto/SessionQuartoXRefs.cpp
--- a/src/cpp/session/modules/quarto/SessionQuartoXRefs.cpp 2022-04-27 22:28:07.480284489 +1200
+++ b/src/cpp/session/modules/quarto/SessionQuartoXRefs.cpp 2022-04-27 20:59:01.396159620 +1200
@@ -188,7 +188,7 @@
core::system::ProcessResult result;
error = module_context::runPandoc(
- FilePath(config.bin_path).completeChildPath("pandoc").getAbsolutePath(),
+ FilePath(config.bin_path).completeChildPath("tools/pandoc").getAbsolutePath(),
args,
contents,
options,