NEW: math/rstudio

2020-06-26 Thread Brian Callahan
Hi ports --

Attached is a new port, math/rstudio. RStudio is the IDE for R.

---
pkg/DESCR:
RStudio is an integrated development environment (IDE) for R.
It includes a console, syntax-highlighting editor that supports direct
code execution, as well as tools for plotting, history, debugging and
workspace management.
---

This is a rather big port, and I am not certain that it is ready for
import just yet. But it is clearly at the point where it needs to be
shared. Looking for comments and suggestions.

Some notes/caveats:
1. The binary lives as /usr/local/lib/rstudio/bin/rstudio. A simple
script exists to allow console users easy access.

2. There are no precompiled packages other than what comes with the
IDE. Trying to build some (igraph, notably) exposed some potential
issues with R--like how R thinks the fortran compiler is named
gfortran when it should be egfortran.

3. Fonts don't render in the Plots window. Not sure why. Help
appreciated.

4. I am only a Desktop user but I did provide the Server as well. If
you use the server I'd be interested in knowing how it works.

5. There are undoubtedly improvements to be made here, so I'm open to
whatever comes down the pipeline.

OK?

~Brian


rstudio.tgz
Description: application/compressed-tar


Re: NEW: math/rstudio

2020-06-29 Thread Zé Loff
On Sat, Jun 27, 2020 at 01:30:13AM +, Brian Callahan wrote:
> Hi ports --
> 
> Attached is a new port, math/rstudio. RStudio is the IDE for R.

First of all, kudos for the effort.  I tried and gave up quite a few
times before.

> ---
> pkg/DESCR:
> RStudio is an integrated development environment (IDE) for R.
> It includes a console, syntax-highlighting editor that supports direct
> code execution, as well as tools for plotting, history, debugging and
> workspace management.
> ---
> 
> This is a rather big port, and I am not certain that it is ready for
> import just yet. But it is clearly at the point where it needs to be
> shared. Looking for comments and suggestions.
> 
> Some notes/caveats:
> 1. The binary lives as /usr/local/lib/rstudio/bin/rstudio. A simple
> script exists to allow console users easy access.
> 
> 2. There are no precompiled packages other than what comes with the
> IDE. Trying to build some (igraph, notably) exposed some potential
> issues with R--like how R thinks the fortran compiler is named
> gfortran when it should be egfortran.

Enviroment variables for compiling packages can be setup (need to?) in 
~/.R/Makevars.  Maybe this can help with the gfortran issue.

I use clang for most of them, but I have one in my R library (apologies,
I can't remember which) that needs gcc.  This is my ~/.R/Makevars for
compiling with GCC:

# GCC
# Compilers
CC=/usr/local/bin/egcc
CXX=/usr/local/bin/eg++
CXX11=/usr/local/bin/eg++
# Compiler flags
CFLAGS=-Wall -pedantic -O2 -pipe -std=c99 -DHAVE_SYS_SELECT_H -fPIC
CXX11FLAGS=-Wall -pedantic -O2 -pipe -std=c++11 -DHAVE_SYS_SELECT_H -fPIC
CXXFLAGS=-Wall -O2 -pipe

LIB_DIR=/usr/local/lib

And this is for compiling with clang (my default).  A big note about
wxneeded in LDFLAGS: some packages need this during build, and only
during build -- IIRC due to some configure check, without it configure
complains that we're cross-compiling, never took the time to investigate
this properly -- not during runtime.  This means that while building
(which happens in /tmp, by R's default) /tmp must be mounted wxallowed.
Again this is just because of a couple of packages, YMMV and you'll
probably won't need it.  But I digress...  Again, here's ~/.R/Makevars
for clang:

# clang
CC=/usr/bin/clang
CXX=/usr/bin/clang
CXX11=/usr/bin/clang
# Compiler flags
CFLAGS=-Wall -pedantic -O2 -std=c99 -DHAVE_SYS_SELECT_H -fPIC
CXX11FLAGS=-Wall -pedantic -O2 -std=c++11 -DHAVE_SYS_SELECT_H -fPIC
CXXFLAGS=-Wall -pedantic -O2 -DHAVE_SYS_SELECT_H -fPIC

LIB_DIR=/usr/local/lib
LIBS=-lgfortran -lkvm
# Preprocessor flags (C and FORTRAN)
CPPFLAGS=-fPIC -I/usr/include -I/usr/local/include
# Linker flags
LDFLAGS=-L/usr/lib -L/usr/local/lib -lkvm -Wl,-R/usr/local/lib/R/lib,-z,wxneeded


> 3. Fonts don't render in the Plots window. Not sure why. Help
> appreciated.

pango/harfbuzz fallout, probably.  Pango stopped supporting Type 1
fonts.  I have the same issue with R itself.  My solution it to add

  options.X11(family = "DejaVu Sans")

or some other TrueType family.

> 4. I am only a Desktop user but I did provide the Server as well. If
> you use the server I'd be interested in knowing how it works.

The server is basically the same this but with the entire GUI served
over HTTP, and with session control.  When you login you get a new R
session, just like with the desktop, with the added bonus of being able
to leave it running, logout, and come back later to the same session.

I think this is a prime candidate for a -no_x11 flavor, since it would
probably be much lighter and perhaps easier to port, since it won't pull
GUI dependencies (I think), but hey, I'm happy enough with this being
ported as it is.

> 5. There are undoubtedly improvements to be made here, so I'm open to
> whatever comes down the pipeline.
> 
> OK?
> 
> ~Brian



-- 
 



Re: NEW: math/rstudio

2020-06-29 Thread Brian Callahan


On Monday, June 29, 2020 6:00 AM, Zé Loff  wrote:

> On Sat, Jun 27, 2020 at 01:30:13AM +, Brian Callahan wrote:
>
> > Hi ports --
> > Attached is a new port, math/rstudio. RStudio is the IDE for R.
>
> First of all, kudos for the effort. I tried and gave up quite a few
> times before.
>
> > pkg/DESCR:
> > RStudio is an integrated development environment (IDE) for R.
> > It includes a console, syntax-highlighting editor that supports direct
> > code execution, as well as tools for plotting, history, debugging and
> > workspace management.
> >
> > 
> >
> > This is a rather big port, and I am not certain that it is ready for
> > import just yet. But it is clearly at the point where it needs to be
> > shared. Looking for comments and suggestions.
> > Some notes/caveats:
> >
> > 1.  The binary lives as /usr/local/lib/rstudio/bin/rstudio. A simple
> > script exists to allow console users easy access.
> >
> > 2.  There are no precompiled packages other than what comes with the
> > IDE. Trying to build some (igraph, notably) exposed some potential
> > issues with R--like how R thinks the fortran compiler is named
> > gfortran when it should be egfortran.
> >
>
> Enviroment variables for compiling packages can be setup (need to?) in
> ~/.R/Makevars. Maybe this can help with the gfortran issue.
>

I found /usr/local/lib/R/etc/Makeconf, which I edited to change gfortran to 
egfortran. Perhaps that file should be amended for that one small change since 
the binary is always called egfortran on OpenBSD. But I'll leave that up to the 
R people. I had no idea one could override with ~/.R/Makevars.

>
> > 3.  Fonts don't render in the Plots window. Not sure why. Help
> > appreciated.
> >
>
> pango/harfbuzz fallout, probably. Pango stopped supporting Type 1
> fonts. I have the same issue with R itself. My solution it to add
>
> options.X11(family = "DejaVu Sans")
>
> or some other TrueType family.
>

Yup, this was already mentioned to me. So not an issue with RStudio (at least, 
not directly).

> > 4.  I am only a Desktop user but I did provide the Server as well. If
> > you use the server I'd be interested in knowing how it works.
> >
>
> The server is basically the same this but with the entire GUI served
> over HTTP, and with session control. When you login you get a new R
> session, just like with the desktop, with the added bonus of being able
> to leave it running, logout, and come back later to the same session.
>
> I think this is a prime candidate for a -no_x11 flavor, since it would
> probably be much lighter and perhaps easier to port, since it won't pull
> GUI dependencies (I think), but hey, I'm happy enough with this being
> ported as it is.
>

The Server still pulls in all the Boost libs. That leaves us with only amd64 
and arm64 being able to build RStudio. A complete wash in terms of ease of 
porting.

However, it would give us some degree of protection against qtwebengine, so 
that's something I'll look into.

~Brian