Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Feb 2021 05:42:14 +0000 (UTC)
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r564604 - in head/devel/RStudio: . files
Message-ID:  <202102070542.1175gETb078061@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuri
Date: Sun Feb  7 05:42:13 2021
New Revision: 564604
URL: https://svnweb.freebsd.org/changeset/ports/564604

Log:
  devel/RStudio: Add rc script for the 'server' flavor/mode
  
  Also
  * Remove redundant dependencies for the 'server' flavor
  * Improve COMMENT for the 'desktop' flavor
  * Remove unnecessary shebang and file in the 'server' flavor

Added:
  head/devel/RStudio/files/rstudio-server.in   (contents, props changed)
Modified:
  head/devel/RStudio/Makefile
  head/devel/RStudio/pkg-message

Modified: head/devel/RStudio/Makefile
==============================================================================
--- head/devel/RStudio/Makefile	Sun Feb  7 05:19:58 2021	(r564603)
+++ head/devel/RStudio/Makefile	Sun Feb  7 05:42:13 2021	(r564604)
@@ -6,7 +6,7 @@
 PORTNAME=	RStudio
 DISTVERSIONPREFIX=	v
 DISTVERSION=	1.3.1093
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	devel math java
 MASTER_SITES=	https://s3.amazonaws.com/rstudio-buildtools/dictionaries/:dictionaries \
 		https://s3.amazonaws.com/rstudio-buildtools/:buildtools
@@ -36,9 +36,7 @@ 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
+USES=		cmake fortran localbase:ldflags pkgconfig ssl
 USE_JAVA=	yes
 JAVA_VERSION=	8
 JAVA_BUILD=	yes
@@ -63,7 +61,10 @@ GWT_VERSION=	2.8.1
 GIN_VERSION=	2.1.2
 
 .if ${FLAVOR:U} == desktop
-USES+=		desktop-file-utils shared-mime-info
+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
 CMAKE_ARGS+=	-DRSTUDIO_TARGET=Desktop
 INSTALL_SUBDIR=	${PORTNAME:tl}
 EXECUTABLE=	${PORTNAME:tl}
@@ -71,12 +72,12 @@ EXECUTABLE=	${PORTNAME:tl}
 
 .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
+USER=		nobody
+SUB_LIST=	USER=${USER}
+USE_RC_SUBR=	${PORTNAME:tl}-server
 .endif
 
 post-extract:
@@ -117,7 +118,10 @@ post-install:
 	) > ${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
+	${REINPLACE_CMD} -e 's|^Exec=.*/rstudio|Exec=${PREFIX}/bin/${EXECUTABLE}|' ${STAGEDIR}${PREFIX}/share/applications/${EXECUTABLE}.desktop
+.endif
+.if ${FLAVOR:U} == server
+	${RM} ${STAGEDIR}${LOCALBASE}/lib/${INSTALL_SUBDIR}/bin/rstudio-server # not compatible with FreeBSD
 .endif
 	# Some functions expect the pandoc symlink.
 	@${MKDIR} ${STAGEDIR}${PREFIX}/lib/${INSTALL_SUBDIR}/bin/pandoc

Added: head/devel/RStudio/files/rstudio-server.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/RStudio/files/rstudio-server.in	Sun Feb  7 05:42:13 2021	(r564604)
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# $FreeBSD: head/net/dhcpd/files/dhcpd.in 470842 2018-05-25 14:04:06Z tz $
+#
+# PROVIDE: rstudio-server
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable rstudio_server:
+# rstudio_server_enable : set to "YES" to enable theb daemon, default is "NO"
+# rstudio_server_flags  : any extra flags, default is ""
+
+. /etc/rc.subr
+
+name=rstudio_server
+rcvar=rstudio_server_enable
+
+load_rc_config $name
+
+rstudio_server_enable=${rstudio_server_enable:-"NO"}
+rstudio_server_flags=${rstudio_server_flags:-""}
+
+procname=%%PREFIX%%/lib/rstudio-server/bin/rserver
+command=%%PREFIX%%/lib/rstudio-server/bin/rserver
+command_args="--server-user %%USER%% ${rstudio_server_flags}"
+
+stop_postcmd=stop_postcmd
+
+stop_postcmd()
+{
+	# workaround for https://github.com/rstudio/rstudio/issues/8917
+	killall rsession rworkspaces 2>/dev/null # process list is taken from src/cpp/server/extras/admin/rstudio-server.in
+}
+
+run_rc_command "$1"

Modified: head/devel/RStudio/pkg-message
==============================================================================
--- head/devel/RStudio/pkg-message	Sun Feb  7 05:19:58 2021	(r564603)
+++ head/devel/RStudio/pkg-message	Sun Feb  7 05:42:13 2021	(r564604)
@@ -11,13 +11,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
+In order to enable RStudio Server service at startup and start it please run:
+# sysrc rstudio_server_enable="YES"
+# service rstudio-server start
+and then navigate to http://localhost:8787/ in your browser.
 
+You can also start the RStudio Server service once with:
+# service rstudio-server onestart
 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
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102070542.1175gETb078061>