user/rstudio-desktop: new aport

This commit is contained in:
Antoine Martin 2023-05-03 00:32:53 -04:00
parent 6dcc6e872e
commit 50556c3a4e
Signed by: forge
GPG key ID: D62A472A4AA7D541
8 changed files with 268 additions and 0 deletions

View file

@ -0,0 +1,33 @@
From 17a9562b352f9a726188f570dec55e683a663c91 Mon Sep 17 00:00:00 2001
From: Kevin Ushey <kevinushey@gmail.com>
Date: Tue, 18 Apr 2023 21:53:42 -0700
Subject: [PATCH] support system yaml-cpp (closes #12317)
---
src/cpp/CMakeLists.txt | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
index 68e333af935..1518ca2a0e5 100644
--- a/src/cpp/CMakeLists.txt
+++ b/src/cpp/CMakeLists.txt
@@ -225,11 +225,17 @@ else()
find_package(yaml-cpp REQUIRED)
endif()
-if(NOT EXISTS "${YAML_CPP_INCLUDE_DIR}")
+if(yaml-cpp_FOUND AND NOT YAML_CPP_LIBRARIES)
+ set(YAML_CPP_LIBRARIES yaml-cpp)
+endif()
+
+if(NOT RSTUDIO_USE_SYSTEM_YAML_CPP AND NOT EXISTS "${YAML_CPP_INCLUDE_DIR}")
message(FATAL_ERROR "yaml-cpp not found (re-run dependencies script to install)")
endif()
-include_directories(SYSTEM "${YAML_CPP_INCLUDE_DIR}")
+if(YAML_CPP_INCLUDE_DIR)
+ include_directories(SYSTEM "${YAML_CPP_INCLUDE_DIR}")
+endif()
# determine whether we should statically link boost. we always do this
# unless we are building a non-packaged build on linux (in which case

View file

@ -0,0 +1,139 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=rstudio-desktop
pkgver=2023.3
_gittag=v2023.03.0+386
_panmirrortag=aea3027882718af657d60221818c3ff35f413219
pkgrel=0
pkgdesc="A powerful and productive integrated development environment (IDE) for R programming language"
arch="x86_64"
url="https://www.rstudio.com/products/rstudio/"
license='AGPL3'
options="!check" # No testsuite
# missing quarto-cli
depends="
R>=3.0.1
clang14
hunspell-en
libldap
lxqt-config
mathjax2
pandoc
sqlite
"
makedepends="
apache-ant
boost-dev
cmake>=3.1.0
cups-libs
desktop-file-utils
grep
libxml2-dev
musl-dev
openjdk8
openssl
patchelf
postgresql-dev
qt5-qtbase-dev
qt5-qtlocation-dev
qt5-qtsensors-dev
qt5-qtsvg-dev
qt5-qtwebchannel-dev
qt5-qtwebengine-dev
qt5-qtxmlpatterns-dev
R-dev
soci-dev
unzip
yaml-cpp-dev
yarn
"
source="
$pkgname-$pkgver.tar.gz::https://github.com/rstudio/rstudio/archive/refs/tags/$_gittag.tar.gz
$pkgname-$pkgver-panmirror.tar.gz::https://github.com/quarto-dev/quarto/archive/$_panmirrortag.tar.gz
12317_support-system-yaml-cpp.patch
cran_multithread.patch
desktop-main-skip-nosandbox-on-musl.patch
filepath-use-unistd.patch
nodejs-external.patch
sessionhistoryarchive-use-ctime.patch
qt.conf
"
builddir="$srcdir"/rstudio-${_gittag/v}
builddir=${builddir/+/-}
prepare() {
default_prepare
sed "s/@@proc_num@@/$JOBS/" -i $builddir/dependencies/common/install-packages
cd "$builddir"/dependencies/common
_pandocver=$(grep -oP "(?<=PANDOC_VERSION=\").*(?=\"$)" install-pandoc)
install -d pandoc/$_pandocver
ln -sfT /usr/share/hunspell dictionaries
ln -sfT /usr/share/mathjax2 mathjax-27
# ln -sfT /opt/quarto quarto
ln -sfT /usr/bin/pandoc pandoc/$_pandocver/pandoc
ln -sfT /usr/bin/pandoc-citeproc pandoc/$_pandocver/pandoc-citeproc
# Fix links for src/cpp/session/CMakeLists.txt
cd "$builddir"/dependencies
ln -sfT common/dictionaries dictionaries
ln -sfT common/mathjax-27 mathjax-27
# ln -sfT common/quarto quarto
ln -sfT common/pandoc pandoc
# Panmirror is picked up now from Quarto repo
mkdir -p "$builddir"/src/gwt/lib
cp -r "$srcdir/"quarto-$_panmirrortag "$builddir"/src/gwt/lib/quarto
}
build() {
msg "Downloading and installing R packages..."
R_LIBS_USER="$srcdir"/R/library/ R_USER="$srcdir"/R bash "$builddir"/dependencies/common/install-packages
export PATH=/usr/lib/jvm/java-8-openjdk/jre/bin/:$PATH
export JAVA_TOOL_OPTIONS="-Djava.util.prefs.userRoot=$srcdir"
export BUILD_ID="local"
export PACKAGE_OS="Alpine Linux"
cmake -S "$builddir" \
-B build \
-DRSTUDIO_TARGET=Desktop \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/lib/rstudio \
-DRSTUDIO_USE_SYSTEM_BOOST=yes \
-DRSTUDIO_USE_SYSTEM_YAML_CPP=yes \
-DQT_QMAKE_EXECUTABLE=/usr/bin/qmake \
-DBoost_NO_BOOST_CMAKE=ON \
-DQUARTO_ENABLED=false \
-DRSTUDIO_USE_SYSTEM_SOCI=yes \
-DRSTUDIO_BUNDLE_QT=FALSE
make -C build
}
package() {
# Install the program
make -C build DESTDIR="$pkgdir" install
# Install the license
install -Dm 644 "$builddir"/COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
# Symlink main binary
install -d "$pkgdir/usr/bin"
ln -sfT "/usr/lib/rstudio/bin/rstudio" "$pkgdir/usr/bin/rstudio"
# BUGFIX: qt5-webengine isn't init'ing properly. Likely an Rstudio bug.
install -Dm 644 "$srcdir/qt.conf" "$pkgdir/usr/lib/qt/libexec/qt.conf"
}
sha512sums="
64794b753bb366993d981a4df0a342a1d643a3c0105b80cca22a39a4665a47a0bb0573fbef2d1339a3a23652af67810b1afd842b8d407a4e3d622d5a5e4007c3 rstudio-desktop-2023.3.tar.gz
fc51164e454480e3bc4a1a4ebdc09bb71fca3a41d7eac1f3b1ac6e773d40a147f95a835f3733a19c8f5b30cb9e1be083c5b1671b1a5a01fc63439b5f282a7873 rstudio-desktop-2023.3-panmirror.tar.gz
bc02f3541e7c8b8bff296e9d9f627d6908d2464bdf6a2cb091795083721c89232fe45ade7b54af8b6532fed183b83838307396283ac9ae230a49014842e7b6da 12317_support-system-yaml-cpp.patch
eb0c023916babdbb3871bd7212c065ad16363e1b0c94db29eb283c4051681aa443bbe2fefd3bce286bf8b149aba1405bc09521b53fd16c31a566d463273ec969 cran_multithread.patch
54625810117dea0287a8184babde409e579ffc3cc0a138136a23ca088d5c4cb5ad1885d4d1cb123683a7bece43f9cf0c64ef43f79885a336b44000eca1e67647 desktop-main-skip-nosandbox-on-musl.patch
1a3da5f17dfed7463d7a7abadb167eacc784d0c2861fdfa9392a088e658778b45216de3e52940b0b150bed3b9236e4207b77ec82458d947642949315f466fe2f filepath-use-unistd.patch
2a400a12886028f60ebeb56c0fc20799ab3ed641824497c93f2e935076172aefc199b7df9a5d8fdf0deb23089a183b8408d6ee6ced78bafb7a129ede75652c00 nodejs-external.patch
16a4445be211316ed890709cc068519d217210ee8e492509a0d1ae9883e61779c717ba04902d14c0f0a4ad19f46b527658f0eadd73876ba74e2e769d9103bbca sessionhistoryarchive-use-ctime.patch
bd348f2ac6f1620ca0d8192e0deb2c2334c7f185da4cab72725119c5a0734b920230868aac2aaf0b211f842f114066cded54f616c1df83b47f0bd3d44df61b89 qt.conf
"

View file

@ -0,0 +1,13 @@
diff --git a/dependencies/common/install-packages.orig b/dependencies/common/install-packages
index 4acca62..85eb31b 100755
--- a/dependencies/common/install-packages.orig
+++ b/dependencies/common/install-packages
@@ -107,7 +107,7 @@ fi
# install packages needed to run tests
for RPKG in purrr rmarkdown renv testthat xml2 yaml; do
- RINSTALLCMD="if("'!'"require($RPKG, quietly = TRUE)) { install.packages('$RPKG', lib='$RPKGLIB', repos='https://cran.rstudio.com/') }"
+ RINSTALLCMD="if("'!'"require($RPKG, quietly = TRUE)) { options(Ncpus = @@proc_num@@ ); install.packages('$RPKG', lib='$RPKGLIB', repos='https://cran.rstudio.com/') }"
echo "> $RINSTALLCMD"
Rscript -e "$RINSTALLCMD"
done

View file

@ -0,0 +1,13 @@
diff --git a/src/cpp/desktop/DesktopMain.cpp.orig b/src/cpp/desktop/DesktopMain.cpp
index d80919b..5ed17a5 100644
--- a/src/cpp/desktop/DesktopMain.cpp.orig
+++ b/src/cpp/desktop/DesktopMain.cpp
@@ -632,7 +632,7 @@ int main(int argc, char* argv[])
}
#endif
-#if defined(Q_OS_LINUX)
+#if defined(Q_OS_LINUX) && defined(__GLIBC__)
static char noSandbox[] = "--no-sandbox";

View file

@ -0,0 +1,13 @@
diff --git a/src/cpp/shared_core/FilePath.cpp.orig b/src/cpp/shared_core/FilePath.cpp
index 0259d1d..f3c8956 100644
--- a/src/cpp/shared_core/FilePath.cpp.orig
+++ b/src/cpp/shared_core/FilePath.cpp
@@ -36,7 +36,7 @@
#include <shared_core/system/Win32StringUtils.hpp>
#else
#include <sys/stat.h>
-#include <sys/unistd.h>
+#include <unistd.h>
#include <shared_core/system/PosixSystem.hpp>
#endif

View file

@ -0,0 +1,37 @@
diff --git a/src/gwt/build.xml.orig b/src/gwt/build.xml
index 83e9433..cbe46cf 100644
--- a/src/gwt/build.xml.orig
+++ b/src/gwt/build.xml
@@ -85,31 +85,7 @@
<!-- panmirror typescript library -->
<!-- ensure version matches RSTUDIO_NODE_VERSION -->
- <property name="node.version" value="16.14.0"/>
- <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="yarn.bin" value="/usr/bin/yarn"/>
<property name="panmirror.dir" value="./lib/quarto/apps/panmirror"/>
<property name="panmirror.build.dir" value="./www/js/panmirror"/>

View file

@ -0,0 +1,8 @@
[Paths]
Headers = /usr/include/qt/
Data = /usr/share/qt/
Libraries = /usr/lib/qt/
LibraryExecutables = /usr/lib/qt/libexec/
Plugins = /usr/lib/qt/plugins/
Qml2Imports = /usr/lib/qt/qml/
Translations = /usr/share/qt/translations/

View file

@ -0,0 +1,12 @@
diff --git a/src/cpp/session/modules/SessionHistoryArchive.hpp.orig b/src/cpp/session/modules/SessionHistoryArchive.hpp
index 3f17c00..96f3095 100644
--- a/src/cpp/session/modules/SessionHistoryArchive.hpp.orig
+++ b/src/cpp/session/modules/SessionHistoryArchive.hpp
@@ -20,6 +20,7 @@
#include <vector>
#include <boost/utility.hpp>
+#include <ctime>
namespace rstudio {
namespace core {