diff options
author | Yuri Victorovich <yuri@FreeBSD.org> | 2021-02-06 02:43:24 +0000 |
---|---|---|
committer | Yuri Victorovich <yuri@FreeBSD.org> | 2021-02-06 02:43:24 +0000 |
commit | d059b7d1ea0866c067eb0bdcfa82a0761c09b89b (patch) | |
tree | e9c86e3c5e379817dfdba99375e867ba8fb5f6c0 /devel/RStudio | |
parent | c714c25600b345ae9b65c7eca8d716a752cbb9d4 (diff) | |
download | ports-d059b7d1ea0866c067eb0bdcfa82a0761c09b89b.tar.gz ports-d059b7d1ea0866c067eb0bdcfa82a0761c09b89b.zip |
Notes
Diffstat (limited to 'devel/RStudio')
-rw-r--r-- | devel/RStudio/Makefile | 47 | ||||
-rw-r--r-- | devel/RStudio/files/patch-src_cpp_core_system_PosixSystem.cpp | 32 | ||||
-rw-r--r-- | devel/RStudio/files/patch-src_cpp_shared__core_system_User.cpp | 13 | ||||
-rw-r--r-- | devel/RStudio/pkg-message | 9 |
4 files changed, 82 insertions, 19 deletions
diff --git a/devel/RStudio/Makefile b/devel/RStudio/Makefile index 294e41a07c73..c9e7367318e9 100644 --- a/devel/RStudio/Makefile +++ b/devel/RStudio/Makefile @@ -1,11 +1,12 @@ # $FreeBSD$ # This port opens too many files during build, more than the default setting. -# Its build is known to succeed with MAX_FILES_RStudio=4096 in poudriere.conf +# Its build is known to succeed with MAX_FILES_RStudio=4096 and MAX_FILES_RStudio_server=4096 in poudriere.conf PORTNAME= RStudio DISTVERSIONPREFIX= v DISTVERSION= 1.3.1093 +PORTREVISION= 1 CATEGORIES= devel math java MASTER_SITES= https://s3.amazonaws.com/rstudio-buildtools/dictionaries/:dictionaries \ https://s3.amazonaws.com/rstudio-buildtools/:buildtools @@ -31,7 +32,11 @@ LIB_DEPENDS= libR.so:math/R \ libinotify.so:devel/libinotify \ libuuid.so:misc/e2fsprogs-libuuid -USES= cmake desktop-file-utils fortran localbase:ldflags pkgconfig qt:5 shared-mime-info ssl +FLAVORS= desktop server +FLAVOR?= ${FLAVORS:[1]} +server_PKGNAMESUFFIX= -server + +USES= cmake fortran localbase:ldflags pkgconfig qt:5 ssl USE_QT= core dbus declarative gui location network opengl printsupport quickcontrols sensors \ sql svg webchannel webengine webkit widgets xml xmlpatterns buildtools_build qmake_build USE_JAVA= yes @@ -44,8 +49,7 @@ GH_TUPLE= rstudio:r2d3:v0.2.0:r2d3/dependencies/common/r2d3 \ rstudio:rsconnect:03c379b:rsconnect/dependencies/common/rsconnect \ trestletech:plumber:v0.4.6:plumber/dependencies/common/plumber -CMAKE_ARGS= -DRSTUDIO_TARGET=Desktop \ - -DFREEBSD_RSTUDIO_VERSION:STRING=${PORTVERSION} \ +CMAKE_ARGS= -DFREEBSD_RSTUDIO_VERSION:STRING=${PORTVERSION} \ -DFREEBSD_LIBDIR:STRING=${PREFIX}/lib CMAKE_ARGS+= -DQT_QMAKE_EXECUTABLE:STRING=${QMAKE} CMAKE_ARGS+= -DRSTUDIO_BOOST_SIGNALS_VERSION=2 @@ -58,6 +62,23 @@ MAKE_ENV= HOME=${WRKDIR} \ GWT_VERSION= 2.8.1 GIN_VERSION= 2.1.2 +.if ${FLAVOR:U} == desktop +USES+= desktop-file-utils shared-mime-info +CMAKE_ARGS+= -DRSTUDIO_TARGET=Desktop +INSTALL_SUBDIR= ${PORTNAME:tl} +EXECUTABLE= ${PORTNAME:tl} +.endif + +.if ${FLAVOR:U} == server +COMMENT+= (web UI version) +USES+= shebangfix +SHEBANG_FILES= src/cpp/server/extras/admin/rstudio-server.in +CMAKE_ARGS+= -DRSTUDIO_TARGET=Server +INSTALL_SUBDIR= ${PORTNAME:tl}-server +EXECUTABLE= rserver +RUN_DEPENDS+= bash:shells/bash +.endif + post-extract: @${MKDIR} ${WRKSRC}/dependencies/common/dictionaries && ${MV} ${WRKDIR}/en_* ${WRKSRC}/dependencies/common/dictionaries/ @${MV} ${WRKDIR}/mathjax-* ${WRKSRC}/dependencies/common/ @@ -92,14 +113,16 @@ post-install: echo "fi"; \ echo ""; \ echo "# workaround for the problem that RStudio passes /lib with LD_LIBRARY_PATH that causes the /lib/libgcc_s.so.1 conflict with gcc"; \ - echo "LD_PRELOAD=${PREFIX}/lib/gcc${GCC_DEFAULT}/libgcc_s.so JAVA_HOME=${JAVA_HOME} ${PREFIX}/lib/rstudio/bin/rstudio \"$$"@"\"" \ - ) > ${STAGEDIR}${PREFIX}/bin/rstudio - @${CHMOD} +x ${STAGEDIR}${PREFIX}/bin/rstudio - @${REINPLACE_CMD} -e 's|^Exec=.*/rstudio|Exec=${PREFIX}/bin/rstudio|' ${STAGEDIR}${PREFIX}/share/applications/rstudio.desktop + 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 + @${REINPLACE_CMD} -e 's|^Exec=.*/rstudio|Exec=${PREFIX}/bin/${EXECUTABLE}|' ${STAGEDIR}${PREFIX}/share/applications/${EXECUTABLE}.desktop +.endif # Some functions expect the pandoc symlink. - @${MKDIR} ${STAGEDIR}${PREFIX}/lib/rstudio/bin/pandoc - @cd ${STAGEDIR}${PREFIX}/lib/rstudio/bin/pandoc && ${LN} -s ../../../../bin/pandoc - # There is a variability in .js file names due to the 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|' > ${TMPPLIST} + @${MKDIR} ${STAGEDIR}${PREFIX}/lib/${INSTALL_SUBDIR}/bin/pandoc + @cd ${STAGEDIR}${PREFIX}/lib/${INSTALL_SUBDIR}/bin/pandoc && ${LN} -s ../../../../bin/pandoc + # 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} .include <bsd.port.mk> diff --git a/devel/RStudio/files/patch-src_cpp_core_system_PosixSystem.cpp b/devel/RStudio/files/patch-src_cpp_core_system_PosixSystem.cpp index 1402a3305f50..5f0def0c79fb 100644 --- a/devel/RStudio/files/patch-src_cpp_core_system_PosixSystem.cpp +++ b/devel/RStudio/files/patch-src_cpp_core_system_PosixSystem.cpp @@ -1,4 +1,6 @@ ---- src/cpp/core/system/PosixSystem.cpp.orig 2020-05-18 18:11:10 UTC +- one of the patches is a workaround for access to /proc/{pid}/fd : https://github.com/rstudio/rstudio/issues/8912 + +--- src/cpp/core/system/PosixSystem.cpp.orig 2020-09-17 18:16:48 UTC +++ src/cpp/core/system/PosixSystem.cpp @@ -40,20 +40,25 @@ @@ -28,7 +30,23 @@ #include <boost/thread.hpp> #include <boost/format.hpp> #include <boost/lexical_cast.hpp> -@@ -917,7 +922,7 @@ Error executablePath(const char * argv0, +@@ -575,6 +580,7 @@ Error getOpenFds(std::vector<uint32_t>* pFds) + #ifndef __APPLE__ + Error getOpenFds(pid_t pid, std::vector<uint32_t>* pFds) + { ++#if !defined(__FreeBSD__) + std::string pidStr = safe_convert::numberToString(pid); + boost::format fmt("/proc/%1%/fd"); + FilePath filePath(boost::str(fmt % pidStr)); +@@ -601,6 +607,7 @@ Error getOpenFds(pid_t pid, std::vector<uint32_t>* pFd + pFds->push_back(fd.get()); + } + } ++#endif + + return Success(); + } +@@ -922,7 +929,7 @@ Error executablePath(const char * argv0, #elif defined(HAVE_PROCSELF) @@ -37,7 +55,7 @@ #else -@@ -1426,7 +1431,7 @@ Error osResourceLimit(ResourceLimit limit, int* pLimit +@@ -1431,7 +1438,7 @@ Error osResourceLimit(ResourceLimit limit, int* pLimit case CpuLimit: *pLimit = RLIMIT_CPU; break; @@ -46,7 +64,7 @@ case NiceLimit: *pLimit = RLIMIT_NICE; break; -@@ -1499,7 +1504,7 @@ Error systemInformation(SysInfo* pSysInfo) +@@ -1504,7 +1511,7 @@ Error systemInformation(SysInfo* pSysInfo) { pSysInfo->cores = boost::thread::hardware_concurrency(); @@ -55,7 +73,7 @@ struct sysinfo info; if (::sysinfo(&info) == -1) return systemError(errno, ERROR_LOCATION); -@@ -1939,7 +1944,7 @@ Error restrictCoreDumps() +@@ -1944,7 +1951,7 @@ Error restrictCoreDumps() return error; // no ptrace core dumps permitted @@ -64,7 +82,7 @@ int res = ::prctl(PR_SET_DUMPABLE, 0); if (res == -1) return systemError(errno, ERROR_LOCATION); -@@ -1950,7 +1955,7 @@ Error restrictCoreDumps() +@@ -1955,7 +1962,7 @@ Error restrictCoreDumps() Error enableCoreDumps() { @@ -73,7 +91,7 @@ int res = ::prctl(PR_SET_DUMPABLE, 1); if (res == -1) return systemError(errno, ERROR_LOCATION); -@@ -1976,7 +1981,7 @@ void printCoreDumpable(const std::string& context) +@@ -1981,7 +1988,7 @@ void printCoreDumpable(const std::string& context) ostr << " hard limit: " << rLimitHard << std::endl; // ptrace diff --git a/devel/RStudio/files/patch-src_cpp_shared__core_system_User.cpp b/devel/RStudio/files/patch-src_cpp_shared__core_system_User.cpp new file mode 100644 index 000000000000..dc2aacfdae43 --- /dev/null +++ b/devel/RStudio/files/patch-src_cpp_shared__core_system_User.cpp @@ -0,0 +1,13 @@ +- Workaround for https://github.com/rstudio/rstudio/issues/8908 + +--- src/cpp/shared_core/system/User.cpp.orig 2021-02-05 21:40:04 UTC ++++ src/cpp/shared_core/system/User.cpp +@@ -64,6 +64,8 @@ struct User::Impl + + // Get the maximum size of a passwd for this system. + long buffSize = ::sysconf(_SC_GETPW_R_SIZE_MAX); ++ if (buffSize == -1) ++ buffSize = 4096; + if (buffSize == 1) + buffSize = 4096; // some systems return -1, be conservative! + diff --git a/devel/RStudio/pkg-message b/devel/RStudio/pkg-message index 8f10ba49c238..a87ffb9f562e 100644 --- a/devel/RStudio/pkg-message +++ b/devel/RStudio/pkg-message @@ -10,6 +10,15 @@ proc /proc procfs rw 0 0 and then run this command as root: # mount /proc + +In order to run RStudio Server please run: +$ sudo rserver --server-daemonize 0 --server-user nobody + +and then navigate to http://localhost:8787/ in your browser. + +The rc script will be added later to start RStudio Server as +a service. + EOM } ] |