contrib/rstudio/Pkgfile

63 lines
2.2 KiB
Plaintext

# Description: RStudio - an Interface for GNU R
# URL: https://www.rstudio.com/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: ant boost hyphen libevent libsoci mathjax nodejs openjdk8 pandoc-bin qtwebengine r yaml-cpp yarn
name=rstudio
version=1.4.1717
release=2
source=(https://github.com/rstudio/rstudio/archive/v$version/$name-$version.tar.gz
# https://src.fedoraproject.org/rpms/rstudio/tree/rawhide
0000-unbundle-dependencies-common.patch 0003-fix-resources-path.patch
0004-use-system-node.patch)
git=(https://github.com/rstudio/rstudio.git)
build() {
## if you want your git snapshot to be a particular version
## uncomment below and change every occurance of $name-$version to $name
#git checkout v$version $name
export R_LIBS_USER="$PKG/usr/lib/R/library/"
(pushd $name-$version/dependencies/common
install -d pandoc node/10.19.0/bin
ln -sfT /usr/share/myspell/dicts dictionaries
ln -sfT /usr/share/mathjax mathjax-27
ln -sfT /usr/bin/ "pandoc/2.11.4"
ln -sfT /usr/bin/node node/10.19.0/bin/node
bash install-packages)
patch -Np1 -d $name-$version -i $SRC/0000-unbundle-dependencies-common.patch
patch -Np1 -d $name-$version -i $SRC/0003-fix-resources-path.patch
patch -Np1 -d $name-$version -i $SRC/0004-use-system-node.patch
export PATH="/usr/lib/java/openjdk8/jre/bin/:${PATH}"
cmake -S $name-$version -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr/lib/rstudio \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
-D QT_QMAKE_EXECUTABLE=/usr/lib/qt5/bin/qmake \
-D RSTUDIO_TARGET=Desktop \
-D RSTUDIO_USE_SYSTEM_BOOST=ON \
-D RSTUDIO_USE_SYSTEM_SOCI=ON \
-D RSTUDIO_USE_SYSTEM_YAML_CPP=ON \
-D Boost_NO_BOOST_CMAKE=ON \
-D RSTUDIO_BUNDLE_QT=FALSE \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
install -dm755 $PKG/usr/bin/
ln -s /usr/lib/$name/bin/$name $PKG/usr/bin/$name
sed -i 's|/usr/lib/rstudio/bin/rstudio|/usr/bin/rstudio|g' $PKG/usr/share/applications/rstudio.desktop
find $PKG \(\
-iname '*README*' -o \
-iname '*COPYING*' -o \
-iname 'INSTALL' \
\) -delete || true
}