From owner-svn-ports-head@freebsd.org Sat Feb 6 02:43:26 2021 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4BBA553146D; Sat, 6 Feb 2021 02:43:26 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXc6Q1fC7z3C0P; Sat, 6 Feb 2021 02:43:26 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B3FD17C7; Sat, 6 Feb 2021 02:43:26 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 1162hPNq051785; Sat, 6 Feb 2021 02:43:25 GMT (envelope-from yuri@FreeBSD.org) Received: (from yuri@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 1162hP4v051781; Sat, 6 Feb 2021 02:43:25 GMT (envelope-from yuri@FreeBSD.org) Message-Id: <202102060243.1162hP4v051781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuri set sender to yuri@FreeBSD.org using -f From: Yuri Victorovich Date: Sat, 6 Feb 2021 02:43:25 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r564182 - in head/devel/RStudio: . files X-SVN-Group: ports-head X-SVN-Commit-Author: yuri X-SVN-Commit-Paths: in head/devel/RStudio: . files X-SVN-Commit-Revision: 564182 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 02:43:26 -0000 Author: yuri Date: Sat Feb 6 02:43:24 2021 New Revision: 564182 URL: https://svnweb.freebsd.org/changeset/ports/564182 Log: devel/RStudio: Flavorize into 'desktop' and 'server' flavors The RStudio project builds in two modes: Desktop and Server. These modes are now reflected as port flavors. Added: head/devel/RStudio/files/patch-src_cpp_shared__core_system_User.cpp (contents, props changed) Modified: head/devel/RStudio/Makefile head/devel/RStudio/files/patch-src_cpp_core_system_PosixSystem.cpp head/devel/RStudio/pkg-message Modified: head/devel/RStudio/Makefile ============================================================================== --- head/devel/RStudio/Makefile Sat Feb 6 02:16:14 2021 (r564181) +++ head/devel/RStudio/Makefile Sat Feb 6 02:43:24 2021 (r564182) @@ -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 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 Modified: head/devel/RStudio/files/patch-src_cpp_core_system_PosixSystem.cpp ============================================================================== --- head/devel/RStudio/files/patch-src_cpp_core_system_PosixSystem.cpp Sat Feb 6 02:16:14 2021 (r564181) +++ head/devel/RStudio/files/patch-src_cpp_core_system_PosixSystem.cpp Sat Feb 6 02:43:24 2021 (r564182) @@ -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,8 +30,24 @@ #include #include #include -@@ -917,7 +922,7 @@ Error executablePath(const char * argv0, +@@ -575,6 +580,7 @@ Error getOpenFds(std::vector* pFds) + #ifndef __APPLE__ + Error getOpenFds(pid_t pid, std::vector* 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* pFd + pFds->push_back(fd.get()); + } + } ++#endif + return Success(); + } +@@ -922,7 +929,7 @@ Error executablePath(const char * argv0, + #elif defined(HAVE_PROCSELF) - executablePath = std::string("/proc/self/exe"); @@ -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 Added: head/devel/RStudio/files/patch-src_cpp_shared__core_system_User.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/RStudio/files/patch-src_cpp_shared__core_system_User.cpp Sat Feb 6 02:43:24 2021 (r564182) @@ -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! + Modified: head/devel/RStudio/pkg-message ============================================================================== --- head/devel/RStudio/pkg-message Sat Feb 6 02:16:14 2021 (r564181) +++ head/devel/RStudio/pkg-message Sat Feb 6 02:43:24 2021 (r564182) @@ -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 } ]