Skip to content

Commit

Permalink
devel/RStudio: Update 1.3.1093 -> 1.4.1717
Browse files Browse the repository at this point in the history
  • Loading branch information
yurivict committed Jun 10, 2021
1 parent 3217bf9 commit ade17ad
Show file tree
Hide file tree
Showing 13 changed files with 151 additions and 115 deletions.
23 changes: 16 additions & 7 deletions devel/RStudio/Makefile
Expand Up @@ -3,8 +3,7 @@

PORTNAME= RStudio
DISTVERSIONPREFIX= v
DISTVERSION= 1.3.1093
PORTREVISION= 2
DISTVERSION= 1.4.1717
CATEGORIES= devel math java
MASTER_SITES= https://s3.amazonaws.com/rstudio-buildtools/dictionaries/:dictionaries \
https://s3.amazonaws.com/rstudio-buildtools/:buildtools
Expand All @@ -23,18 +22,21 @@ BROKEN_i386= [ERROR] Line 101: Failed to resolve 'org.rstudio.studio.client.work

BUILD_DEPENDS= ant:devel/apache-ant \
${LOCALBASE}/include/sys/sysinfo.h:devel/libsysinfo \
node:www/node \
pandoc:textproc/hs-pandoc \
R-cran-rstudioapi>0:devel/R-cran-rstudioapi
LIB_DEPENDS= libR.so:math/R \
libboost_thread.so:devel/boost-libs \
libinotify.so:devel/libinotify \
libuuid.so:misc/e2fsprogs-libuuid
libsoci_core.so:databases/soci \
libuuid.so:misc/e2fsprogs-libuuid \
libyaml-cpp.so:devel/yaml-cpp

FLAVORS= desktop server
FLAVOR?= ${FLAVORS:[1]}
server_PKGNAMESUFFIX= -server

USES= cmake fortran localbase:ldflags pkgconfig ssl
USES= cmake fortran localbase:ldflags pgsql pkgconfig sqlite ssl
USE_JAVA= yes
JAVA_VERSION= 8
JAVA_BUILD= yes
Expand All @@ -50,6 +52,9 @@ CMAKE_ARGS= -DFREEBSD_RSTUDIO_VERSION:STRING=${PORTVERSION} \
CMAKE_ARGS+= -DQT_QMAKE_EXECUTABLE:STRING=${QMAKE}
CMAKE_ARGS+= -DRSTUDIO_BOOST_SIGNALS_VERSION=2
CMAKE_ARGS+= -DFREEBSD_PORT_VERSION:STRING=${DISTVERSION}
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
MAKE_ENV= HOME=${WRKDIR} \
JAVA_HOME=${JAVA_HOME} \
PATH=${JAVA_HOME}/bin:${PATH} \
Expand All @@ -73,6 +78,7 @@ EXECUTABLE= ${PORTNAME:tl}
.if ${FLAVOR:U} == server
COMMENT+= (web UI version)
CMAKE_ARGS+= -DRSTUDIO_TARGET=Server
LDFLAGS+= -linotify
INSTALL_SUBDIR= ${PORTNAME:tl}-server
EXECUTABLE= rserver
USER= nobody
Expand All @@ -81,8 +87,8 @@ USE_RC_SUBR= ${PORTNAME:tl}-server
.endif

post-extract:
@${MKDIR} ${WRKSRC}/dependencies/common/dictionaries && ${MV} ${WRKDIR}/en_* ${WRKSRC}/dependencies/common/dictionaries/
@${MV} ${WRKDIR}/mathjax-* ${WRKSRC}/dependencies/common/
@${MKDIR} ${WRKSRC}/dependencies/dictionaries && ${MV} ${WRKDIR}/en_* ${WRKSRC}/dependencies/dictionaries/
@${MV} ${WRKDIR}/mathjax-* ${WRKSRC}/dependencies/
@${MKDIR} ${WRKSRC}/src/gwt/lib/gwt && ${MV} ${WRKDIR}/gwt-${GWT_VERSION} ${WRKSRC}/src/gwt/lib/gwt/${GWT_VERSION}
@${MKDIR} ${WRKSRC}/src/gwt/lib/gin/${GIN_VERSION} && ${MV} ${WRKDIR}/*.jar ${WRKSRC}/src/gwt/lib/gin/${GIN_VERSION}/

Expand All @@ -96,10 +102,13 @@ post-patch:
@${REINPLACE_CMD} -e ' \
s|</java>|<jvmarg value="-Duser.home=${WRKDIR}"/></java>|' \
${WRKSRC}/src/gwt/build.xml
@${REINPLACE_CMD} -e '\
@${REINPLACE_CMD} -e ' \
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
@${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

pre-build:
@${CP} ${FILESDIR}/global-setenv.h ${WRKSRC}/src/cpp/desktop/
Expand Down
6 changes: 3 additions & 3 deletions devel/RStudio/distinfo
@@ -1,4 +1,4 @@
TIMESTAMP = 1600502392
TIMESTAMP = 1623197060
SHA256 (core-dictionaries.zip) = 4341a9630efb9dcf7f215c324136407f3b3d6003e1c96f2e5e1f9f14d5787494
SIZE (core-dictionaries.zip) = 876339
SHA256 (gin-2.1.2.zip) = b98e704164f54be596779696a3fcd11be5785c9907a99ec535ff6e9525ad5f9a
Expand All @@ -7,8 +7,8 @@ SHA256 (gwt-2.8.1.zip) = 0b7af89fdadb4ec51cdb400ace94637d6fe9ffa401b168e2c3d3723
SIZE (gwt-2.8.1.zip) = 95650299
SHA256 (mathjax-27.zip) = c56cbaa6c4ce03c1fcbaeb2b5ea3c312d2fb7626a360254770cbcb88fb204176
SIZE (mathjax-27.zip) = 3285230
SHA256 (RStudio-rstudio-v1.3.1093_GH0.tar.gz) = af8dc5e71ee934043856938af2e2065d1f1efef08aba37962ed03f6ccb8201bb
SIZE (RStudio-rstudio-v1.3.1093_GH0.tar.gz) = 89554292
SHA256 (RStudio-rstudio-v1.4.1717_GH0.tar.gz) = 3af234180fd7cef451aef40faac2c7b52860f14a322244c1c7aede029814d261
SIZE (RStudio-rstudio-v1.4.1717_GH0.tar.gz) = 96928031
SHA256 (rstudio-r2d3-v0.2.0_GH0.tar.gz) = 6355a7632134c8c9487056019a9c458db2c98d10388cf66b018d5461d0a947af
SIZE (rstudio-r2d3-v0.2.0_GH0.tar.gz) = 21977747
SHA256 (rstudio-rmarkdown-aed26ac_GH0.tar.gz) = b6f6f48dd9930514204739d8957c2737f0b1d110aebf9f89fa31de10598cb29b
Expand Down
24 changes: 21 additions & 3 deletions devel/RStudio/files/patch-CMakeGlobals.txt
@@ -1,6 +1,6 @@
--- CMakeGlobals.txt.orig 2020-01-23 23:30:24 UTC
--- CMakeGlobals.txt.orig 2021-05-24 22:22:25 UTC
+++ CMakeGlobals.txt
@@ -84,7 +84,7 @@ endif()
@@ -118,7 +118,7 @@ endif()

# record git revision hash (cache it since we don't use this in development
# mode and we don't want it to force rebuilds there)
Expand All @@ -9,11 +9,29 @@
find_program(GIT_EXECUTABLE git)
if(GIT_EXECUTABLE)
execute_process(
@@ -95,6 +95,7 @@ if(NOT RSTUDIO_SESSION_WIN32 AND NOT RSTUDIO_GIT_REVIS
@@ -129,6 +129,7 @@ if(NOT RSTUDIO_SESSION_WIN32 AND NOT RSTUDIO_GIT_REVIS
SET(RSTUDIO_GIT_REVISION_HASH "${RSTUDIO_GIT_REVISION_HASH}" CACHE STRING "Git Revision Hash")
endif()
endif()
+SET(RSTUDIO_VERSION "${FREEBSD_RSTUDIO_VERSION}" CACHE STRING "FreeBSD RStudio version")

# record these from Jenkins if available
if("$ENV{GIT_COMMIT}" STREQUAL "")
@@ -238,14 +239,14 @@ else()
endif()

# if the install prefix is /usr/local then tweak as appropriate
-if(NOT DEFINED CMAKE_INSTALL_PREFIX)
+if(TRUE OR NOT DEFINED CMAKE_INSTALL_PREFIX) # force to set deeper CMAKE_INSTALL_PREFIX because many files are installed into its root
if(APPLE)
set(CMAKE_INSTALL_PREFIX "/Applications")
elseif(UNIX)
if(RSTUDIO_DESKTOP)
- set(CMAKE_INSTALL_PREFIX "/usr/local/lib/rstudio")
+ set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/rstudio")
else()
- set(CMAKE_INSTALL_PREFIX "/usr/local/lib/rstudio-server")
+ set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/rstudio-server")
endif()
endif()
endif()
18 changes: 18 additions & 0 deletions devel/RStudio/files/patch-src_cpp_CMakeLists.txt
@@ -0,0 +1,18 @@
--- src/cpp/CMakeLists.txt.orig 2021-05-24 22:22:25 UTC
+++ src/cpp/CMakeLists.txt
@@ -433,11 +433,11 @@ endif()
if(UNIX)
set(SOCI_LIBRARY_DIR "${RSTUDIO_TOOLS_SOCI}/build/lib")
if(NOT APPLE AND RSTUDIO_USE_SYSTEM_SOCI)
- set(SOCI_LIBRARY_DIR "/usr/lib")
+ set(SOCI_LIBRARY_DIR "${FREEBSD_LOCALBASE}/lib")
endif()
- find_library(SOCI_CORE_LIB NAMES "libsoci_core.a" "soci_core" PATHS "${SOCI_LIBRARY_DIR}" NO_DEFAULT_PATH)
- find_library(SOCI_SQLITE_LIB NAMES "libsoci_sqlite3.a" "soci_sqlite3" PATHS "${SOCI_LIBRARY_DIR}" NO_DEFAULT_PATH)
- find_library(SOCI_POSTGRESQL_LIB NAMES "libsoci_postgresql.a" "soci_postgresql" PATHS "${SOCI_LIBRARY_DIR}" NO_DEFAULT_PATH)
+ find_library(SOCI_CORE_LIB NAMES "libsoci_core.so" "soci_core" PATHS "${SOCI_LIBRARY_DIR}" NO_DEFAULT_PATH)
+ find_library(SOCI_SQLITE_LIB NAMES "libsoci_sqlite3.so" "soci_sqlite3" PATHS "${SOCI_LIBRARY_DIR}" NO_DEFAULT_PATH)
+ find_library(SOCI_POSTGRESQL_LIB NAMES "libsoci_postgresql.so" "soci_postgresql" PATHS "${SOCI_LIBRARY_DIR}" NO_DEFAULT_PATH)
find_library(DL_LIB "dl")
find_library(SQLITE_LIB "sqlite3")
get_filename_component(SQLITE_LIB "${SQLITE_LIB}" REALPATH)
29 changes: 10 additions & 19 deletions devel/RStudio/files/patch-src_cpp_core_system_PosixSystem.cpp
@@ -1,10 +1,10 @@
- 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.orig 2021-05-24 22:22:25 UTC
+++ src/cpp/core/system/PosixSystem.cpp
@@ -40,20 +40,25 @@
@@ -41,20 +41,25 @@

#include <uuid/uuid.h>
#include <shared_core/system/PosixSystem.hpp>

-#ifdef __APPLE__
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
Expand All @@ -30,23 +30,23 @@
#include <boost/thread.hpp>
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
@@ -575,6 +580,7 @@ Error getOpenFds(std::vector<uint32_t>* pFds)
@@ -560,6 +565,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
@@ -586,6 +592,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,
@@ -911,7 +918,7 @@ Error executablePath(const char * argv0,

#elif defined(HAVE_PROCSELF)

Expand All @@ -55,7 +55,7 @@

#else

@@ -1431,7 +1438,7 @@ Error osResourceLimit(ResourceLimit limit, int* pLimit
@@ -1420,7 +1427,7 @@ Error osResourceLimit(ResourceLimit limit, int* pLimit
case CpuLimit:
*pLimit = RLIMIT_CPU;
break;
Expand All @@ -64,7 +64,7 @@
case NiceLimit:
*pLimit = RLIMIT_NICE;
break;
@@ -1504,7 +1511,7 @@ Error systemInformation(SysInfo* pSysInfo)
@@ -1493,7 +1500,7 @@ Error systemInformation(SysInfo* pSysInfo)
{
pSysInfo->cores = boost::thread::hardware_concurrency();

Expand All @@ -73,7 +73,7 @@
struct sysinfo info;
if (::sysinfo(&info) == -1)
return systemError(errno, ERROR_LOCATION);
@@ -1944,7 +1951,7 @@ Error restrictCoreDumps()
@@ -1897,7 +1904,7 @@ Error restrictCoreDumps()
return error;

// no ptrace core dumps permitted
Expand All @@ -82,16 +82,7 @@
int res = ::prctl(PR_SET_DUMPABLE, 0);
if (res == -1)
return systemError(errno, ERROR_LOCATION);
@@ -1955,7 +1962,7 @@ Error restrictCoreDumps()

Error enableCoreDumps()
{
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
int res = ::prctl(PR_SET_DUMPABLE, 1);
if (res == -1)
return systemError(errno, ERROR_LOCATION);
@@ -1981,7 +1988,7 @@ void printCoreDumpable(const std::string& context)
@@ -1928,7 +1935,7 @@ void printCoreDumpable(const std::string& context)
ostr << " hard limit: " << rLimitHard << std::endl;

// ptrace
Expand Down
12 changes: 6 additions & 6 deletions devel/RStudio/files/patch-src_cpp_desktop_DesktopMain.cpp
@@ -1,6 +1,6 @@
--- src/cpp/desktop/DesktopMain.cpp.orig 2020-05-18 18:11:10 UTC
--- src/cpp/desktop/DesktopMain.cpp.orig 2021-05-24 22:22:25 UTC
+++ src/cpp/desktop/DesktopMain.cpp
@@ -47,6 +47,8 @@
@@ -49,6 +49,8 @@
#include "DesktopActivationOverlay.hpp"
#include "DesktopSessionServersOverlay.hpp"

Expand All @@ -9,16 +9,16 @@
#ifdef _WIN32
#include <core/system/RegistryKey.hpp>
#include <Windows.h>
@@ -372,7 +374,7 @@ QString inferDefaultRenderingEngine()
@@ -349,7 +351,7 @@ QString inferDefaultRenderingEngineMac()

#endif
#endif /* Q_OS_MAC */

-#ifdef Q_OS_LINUX
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)

QString inferDefaultRenderingEngine()
QString inferDefaultRenderingEngineLinux()
{
@@ -461,6 +463,7 @@ std::string getSessionUrl()
@@ -477,6 +479,7 @@ std::string getSessionUrl()

int main(int argc, char* argv[])
{
Expand Down
29 changes: 0 additions & 29 deletions devel/RStudio/files/patch-src_cpp_desktop_DesktopWebView.cpp

This file was deleted.

4 changes: 2 additions & 2 deletions devel/RStudio/files/patch-src_cpp_diagnostics_CMakeLists.txt
@@ -1,10 +1,10 @@
--- src/cpp/diagnostics/CMakeLists.txt.orig 2020-01-23 23:30:24 UTC
--- src/cpp/diagnostics/CMakeLists.txt.orig 2021-05-24 22:22:25 UTC
+++ src/cpp/diagnostics/CMakeLists.txt
@@ -57,6 +57,7 @@ add_stripped_executable(diagnostics
# set link dependencies
target_link_libraries(diagnostics
rstudio-core
+ procstat
)

if(NOT RSTUDIO_SESSION_WIN32)
install(TARGETS diagnostics DESTINATION ${RSTUDIO_INSTALL_BIN})
6 changes: 3 additions & 3 deletions devel/RStudio/files/patch-src_cpp_server_CMakeLists.txt
@@ -1,8 +1,8 @@
--- src/cpp/server/CMakeLists.txt.orig 2020-01-23 23:30:24 UTC
--- src/cpp/server/CMakeLists.txt.orig 2021-05-24 22:22:25 UTC
+++ src/cpp/server/CMakeLists.txt
@@ -156,6 +156,9 @@ include_directories(
@@ -137,6 +137,9 @@ include_directories(
# define executable
add_stripped_executable(rserver ${SERVER_SOURCE_FILES} ${SERVER_HEADER_FILES})
add_stripped_executable(rserver ServerMain.cpp ${SERVER_SOURCE_FILES} ${SERVER_HEADER_FILES})

+# additional libraries
+target_link_libraries(rserver -L${FREEBSD_LIBDIR} -linotify)
Expand Down

0 comments on commit ade17ad

Please sign in to comment.