2018-01-07 21:50:32 +01:00
# This port opens too many files during build, more than the default setting.
2021-09-04 23:09:38 +02:00
# Its build is known to succeed with MAX_FILES_RStudio=4096 in poudriere.conf
2017-12-02 04:32:16 +01:00
PORTNAME = RStudio
DISTVERSIONPREFIX = v
2021-06-10 19:09:41 +02:00
DISTVERSION = 1.4.1717
2021-09-04 23:09:38 +02:00
PORTREVISION = 2
2017-12-02 04:32:16 +01:00
CATEGORIES = devel math java
2020-02-18 18:47:25 +01:00
MASTER_SITES = https://s3.amazonaws.com/rstudio-buildtools/dictionaries/:dictionaries \
2017-12-02 04:32:16 +01:00
https://s3.amazonaws.com/rstudio-buildtools/:buildtools
DISTFILES = core-dictionaries.zip:dictionaries \
gin-${ GIN_VERSION } .zip:buildtools \
gwt-${ GWT_VERSION } .zip:buildtools \
2020-05-23 20:20:01 +02:00
mathjax-27.zip:buildtools
2019-09-25 20:15:04 +02:00
2017-12-02 04:32:16 +01:00
MAINTAINER = yuri@FreeBSD.org
COMMENT = Integrated development environment ( IDE) for R
LICENSE = GPLv3
LICENSE_FILE = ${ WRKSRC } /COPYING
2019-12-26 18:10:54 +01:00
BROKEN_i386 = [ ERROR] Line 101: Failed to resolve 'org.rstudio.studio.client.workbench.views.vcs.common.diff.LineActionButtonRenderer.GrayResources' via deferred binding
2017-12-02 04:32:16 +01:00
BUILD_DEPENDS = ant:devel/apache-ant \
${ LOCALBASE } /include/sys/sysinfo.h:devel/libsysinfo \
2021-06-10 19:09:41 +02:00
node:www/node \
2020-02-18 18:47:25 +01:00
pandoc:textproc/hs-pandoc \
R-cran-rstudioapi>0:devel/R-cran-rstudioapi
2017-12-02 04:32:16 +01:00
LIB_DEPENDS = libR.so:math/R \
libboost_thread.so:devel/boost-libs \
libinotify.so:devel/libinotify \
2021-06-10 19:09:41 +02:00
libsoci_core.so:databases/soci \
libuuid.so:misc/e2fsprogs-libuuid \
libyaml-cpp.so:devel/yaml-cpp
2017-12-02 04:32:16 +01:00
2021-02-06 03:43:24 +01:00
FLAVORS = desktop server
FLAVOR ?= ${ FLAVORS : [1] }
server_PKGNAMESUFFIX = -server
2021-06-10 19:09:41 +02:00
USES = cmake fortran localbase:ldflags pgsql pkgconfig sqlite ssl
2020-04-23 05:28:12 +02:00
USE_JAVA = yes
JAVA_VERSION = 8
2017-12-02 04:32:16 +01:00
JAVA_BUILD = yes
USE_GITHUB = yes
2017-12-06 12:55:20 +01:00
GH_PROJECT = ${ PORTNAME : tl }
2018-05-31 09:29:11 +02:00
GH_TUPLE = rstudio:r2d3:v0.2.0:r2d3/dependencies/common/r2d3 \
rstudio:rmarkdown:aed26ac:rmarkdown/dependencies/common/rmarkdown \
2018-06-09 16:31:19 +02:00
rstudio:rsconnect:03c379b:rsconnect/dependencies/common/rsconnect \
trestletech:plumber:v0.4.6:plumber/dependencies/common/plumber
2017-12-02 04:32:16 +01:00
2021-02-06 03:43:24 +01:00
CMAKE_ARGS = -DFREEBSD_RSTUDIO_VERSION:STRING= ${ PORTVERSION } \
2017-12-02 04:32:16 +01:00
-DFREEBSD_LIBDIR:STRING= ${ PREFIX } /lib
2019-10-17 09:07:11 +02:00
CMAKE_ARGS += -DQT_QMAKE_EXECUTABLE:STRING= ${ QMAKE }
CMAKE_ARGS += -DRSTUDIO_BOOST_SIGNALS_VERSION= 2
CMAKE_ARGS += -DFREEBSD_PORT_VERSION:STRING= ${ DISTVERSION }
2021-06-10 19:09:41 +02:00
CMAKE_ARGS += -DFREEBSD_LOCALBASE:STRING= ${ LOCALBASE } # SOCI package is looked up here, see patch patch-src_cpp_CMakeLists.txt
CMAKE_ON = RSTUDIO_USE_SYSTEM_YAML_CPP \
RSTUDIO_USE_SYSTEM_SOCI
2017-12-02 04:32:16 +01:00
MAKE_ENV = HOME = ${ WRKDIR } \
2019-12-04 07:21:42 +01:00
JAVA_HOME = ${ JAVA_HOME } \
2020-02-18 18:47:25 +01:00
PATH = ${ JAVA_HOME } /bin:${ PATH } \
2017-12-02 04:32:16 +01:00
ANT_OPTS = " -Duser.home= ${ WRKDIR } "
2018-05-31 09:29:11 +02:00
GWT_VERSION = 2.8.1
GIN_VERSION = 2.1.2
2017-12-02 04:32:16 +01:00
2021-02-06 03:43:24 +01:00
.if ${FLAVOR : U } == desktop
2021-03-24 14:34:35 +01:00
DEPRECATED = Uses EOL Python 2.7 via www/qt5-webengine
EXPIRATION_DATE = 2021-06-23
2021-02-07 06:42:13 +01:00
COMMENT += ( desktop UI version)
USES += desktop-file-utils qt:5 shared-mime-info
USE_QT = core dbus declarative gui location network opengl printsupport quickcontrols sensors \
sql svg webchannel webengine webkit widgets xml xmlpatterns buildtools_build qmake_build
2021-02-06 03:43:24 +01:00
CMAKE_ARGS += -DRSTUDIO_TARGET= Desktop
INSTALL_SUBDIR = ${ PORTNAME : tl }
EXECUTABLE = ${ PORTNAME : tl }
. e n d i f
.if ${FLAVOR : U } == server
COMMENT += ( web UI version)
CMAKE_ARGS += -DRSTUDIO_TARGET= Server
2021-06-10 19:09:41 +02:00
LDFLAGS += -linotify
2021-02-06 03:43:24 +01:00
INSTALL_SUBDIR = ${ PORTNAME : tl } -server
EXECUTABLE = rserver
2021-02-07 06:42:13 +01:00
USER = nobody
SUB_LIST = USER = ${ USER }
USE_RC_SUBR = ${ PORTNAME : tl } -server
2021-02-06 03:43:24 +01:00
. e n d i f
2017-12-02 04:32:16 +01:00
post-extract :
2021-06-10 19:09:41 +02:00
@${ MKDIR } ${ WRKSRC } /dependencies/dictionaries && ${ MV } ${ WRKDIR } /en_* ${ WRKSRC } /dependencies/dictionaries/
@${ MV } ${ WRKDIR } /mathjax-* ${ WRKSRC } /dependencies/
2017-12-02 04:32:16 +01:00
@${ MKDIR } ${ WRKSRC } /src/gwt/lib/gwt && ${ MV } ${ WRKDIR } /gwt-${ GWT_VERSION } ${ WRKSRC } /src/gwt/lib/gwt/${ GWT_VERSION }
2020-02-18 18:47:25 +01:00
@${ MKDIR } ${ WRKSRC } /src/gwt/lib/gin/${ GIN_VERSION } && ${ MV } ${ WRKDIR } /*.jar ${ WRKSRC } /src/gwt/lib/gin/${ GIN_VERSION } /
2017-12-02 04:32:16 +01:00
post-patch :
@${ REINPLACE_CMD } -e ' \
2018-05-31 09:29:11 +02:00
s| target_link_libraries( rstudio| target_link_libraries( rstudio procstat| ; \
2017-12-02 04:32:16 +01:00
s| get_filename_component| #get_filename_component|; \
s| set( CMAKE_PREFIX_PATH " $$ {QT_BIN_DIR}//..//lib//cmake " ) | set( CMAKE_PREFIX_PATH " ${ LOCALBASE } /lib/cmake " ) | ; \
s| /usr/share/| ${ PREFIX } /share/| g' \
${ WRKSRC } /src/cpp/desktop/CMakeLists.txt
@${ REINPLACE_CMD } -e ' \
s| </java>| <jvmarg value = " -Duser.home= ${ WRKDIR } " /></java>| ' \
${ WRKSRC } /src/gwt/build.xml
2021-06-10 19:09:41 +02:00
@${ REINPLACE_CMD } -e ' \
2017-12-02 04:32:16 +01:00
s| rHomePaths.push_back| //rHomePaths.push_back| ; \
s| //rHomePaths.push_back( FilePath( "/usr/local/lib/|rHomePaths.push_back(FilePath(" ${ PREFIX } /lib/| ' \
${ WRKSRC } /src/cpp/core/r_util/RVersionsPosix.cpp
2021-06-10 19:09:41 +02:00
@${ REINPLACE_CMD } -e ' \
s| <condition property = "node.bin" value = " ../../../ $$ {node.dir}/bin/node " >| <condition property = "node.bin" value = " ${ LOCALBASE } /bin/node " >| ' \
${ WRKSRC } /src/gwt/build.xml
2017-12-02 04:32:16 +01:00
pre-build :
@${ CP } ${ FILESDIR } /global-setenv.h ${ WRKSRC } /src/cpp/desktop/
@${ REINPLACE_CMD } -e 's|%%PREFIX%%|${PREFIX}|g' ${ WRKSRC } /src/cpp/desktop/global-setenv.h
post-install :
2018-02-26 09:16:59 +01:00
@( echo "#!/bin/sh" ; \
2018-04-23 07:50:26 +02:00
echo "" ; \
echo "if ! [ -d /proc/curproc ]; then" ; \
echo " echo \" ${ PORTNAME } needs /proc to be mounted as procfs\" >&2 " ; \
echo " exit 1" ; \
echo "fi" ; \
echo "" ; \
2018-02-26 09:16:59 +01:00
echo "# workaround for the problem that RStudio passes /lib with LD_LIBRARY_PATH that causes the /lib/libgcc_s.so.1 conflict with gcc" ; \
2021-02-06 03:43:24 +01:00
echo " LD_PRELOAD= ${ PREFIX } /lib/gcc ${ GCC_DEFAULT } /libgcc_s.so JAVA_HOME= ${ JAVA_HOME } ${ PREFIX } /lib/ ${ INSTALL_SUBDIR } /bin/ ${ EXECUTABLE } \" $$ " @"\"" \
) > ${ STAGEDIR } ${ PREFIX } /bin/${ EXECUTABLE }
@${ CHMOD } +x ${ STAGEDIR } ${ PREFIX } /bin/${ EXECUTABLE }
.if ${FLAVOR : U } == desktop
2021-02-07 06:42:13 +01:00
${ REINPLACE_CMD } -e 's|^Exec=.*/rstudio|Exec=${PREFIX}/bin/${EXECUTABLE}|' ${ STAGEDIR } ${ PREFIX } /share/applications/${ EXECUTABLE } .desktop
. e n d i f
.if ${FLAVOR : U } == server
${ RM } ${ STAGEDIR } ${ LOCALBASE } /lib/${ INSTALL_SUBDIR } /bin/rstudio-server # not compatible with FreeBSD
2021-02-06 03:43:24 +01:00
. e n d i f
2018-03-01 07:16:12 +01:00
# Some functions expect the pandoc symlink.
2021-02-06 03:43:24 +01:00
@${ MKDIR } ${ STAGEDIR } ${ PREFIX } /lib/${ INSTALL_SUBDIR } /bin/pandoc
@cd ${ STAGEDIR } ${ PREFIX } /lib/${ INSTALL_SUBDIR } /bin/pandoc && ${ LN } -s ../../../../bin/pandoc
2021-09-04 23:09:38 +02:00
# Add $LOCALBASE/bin to PATH to allow RStudio-server to run gmake (R_HOME/etc/Renviron.site is installed, see https://stat.ethz.ch/R-manual/R-devel/library/base/html/Startup.html)
.if ${FLAVOR : U } == server
#@${MKDIR} ${STAGEDIR}${LOCALBASE}/lib/R/etc
#@${ECHO} "PATH=\"${LOCALBASE}/bin:\$$PATH\"" > ${STAGEDIR}${LOCALBASE}/lib/R/etc/Renviron.site # it should be this way, but this fails: https://github.com/rstudio/rstudio/issues/9815
@${ LN } -s ${ LOCALBASE } /bin/${ GMAKE } ${ STAGEDIR } ${ PREFIX } /lib/rstudio-server/bin/postback/${ GMAKE } # hack, should be as above, but at least gmake is in the path now
. e n d i f
2021-02-06 03:43:24 +01:00
# There is a variability in .js file names due to use of random numbers, so we use the automatic plist.
@${ SETENV } ${ CO_ENV } ${ SH } ${ SCRIPTSDIR } /check-stagedir.sh makeplist | ${ GREP } -v ^\/ | ${ SED } -e 's|%%WWWDIR%%|www/rstudio| ; s|%%CMAKE_BUILD_TYPE%%|${CMAKE_BUILD_TYPE:tl}|' > ${ TMPPLIST }
2017-12-02 04:32:16 +01:00
. i n c l u d e < b s d . p o r t . m k >