Opened 9 years ago

# New port: RStudio

Reported by: Owned by: kjellpk (Kjell Konis) larryv (Lawrence Velázquez) Normal ports cooljeanius (Eric Gallager), martin.prebio@…, roger.filmyer@…, petrrr RStudio

### Description

RStudio is a powerful IDE for R.

Note that as part of the build process, RStudio downloads and installs 3 dependencies. I put this is the post-extract phase. The 3 pieces are

These are used in a way where it is not at all convenient to put them in separate (or even sub) ports.

### comment:1 Changed 9 years ago by ryandesign (Ryan Schmidt)

Some observations:

• Line 2 should be "# $Id$" as usual.
• You don't need to list "depends_build cmake"; the cmake portgroup does that for you.
• Since you fetch from github, consider using the github portgroup.
• The port appears to fetch the latest version from the git repository. It must instead fetch a specific commit that you've tested, so that the process is repeatable. Even better would be to fetch a git tag instead, which is what the github portgroup does by default. Perhaps "v0.98.133" which was created yesterday. Naturally your version number would change as well. So with the github portgroup, this would be "github.setup rstudio rstudio 0.98.133 v", and then remove the fetch.type and git.url, and add checksums.
• Instead of "system 'cd … && …'" you should use "system -W … '…'"
• I don't like the script that downloads and installs additional dependencies in post-extract, but I don't suppose I'd like it any better anywhere else either. One slight improvement might be if the scripts were patched to not download any files, and to instead list the files to be downloaded in the Portfile as usual with checksums.
• The last line of the script is "sudo cp /etc/pam.d/ftpd /etc/pam.d/rstudio". Certainly MacPorts does not permit ports to touch files outside of ${workpath} except in the activate and deactivate phases. If MacPorts doesn't interrupt the install at this point, it will at least prevent action from having happened. So if this action is important to the port, you'll have to perform it in a post-activate block. However I would hope a port wouldn't put files in /etc;${prefix}/etc would be more appropriate.

### comment:2 Changed 9 years ago by kjellpk (Kjell Konis)

Thanks for the comments. I was able to take care of the first 5 without too much trouble.

The 'sudo cp /etc/pam.d/ftpd /etc/pam.d/rstudio' should get commented out during the post-extract phase but it looks like the dependencies scrips are getting changed so whether that works depends on the specific tag (which makes your github suggestion even more useful).

It turns out there is a download function in each of the dependency installer scripts. I'll see if I can patch those to just copy from distfiles.

Anyway, I'll keep working on this but it might be a while.

Cc Me!

### comment:4 Changed 8 years ago by kjellpk (Kjell Konis)

Well, after a brief 4 month delay, I think I have addressed all of the bullet points. I couldn't get file downloads from multiple sites to work with the github portgroup but it looks like the only downside to not using that is a weirdly named worksrcdir. All downloads now occur during fetch and have checksums.

### comment:5 Changed 8 years ago by larryv (Lawrence Velázquez)

Owner: changed from macports-tickets@… to larryv@… RStudio added new → assigned 2.1.3

Sorry for the delay on this. I’ll take a look sometime this week.

### comment:6 Changed 8 years ago by kjellpk (Kjell Konis)

Let me update the portfile to the current version of RStudio first.

### comment:7 follow-up:  8 Changed 8 years ago by seanfarley (Sean Farley)

Could we separate MathJax into its own port so that #39216 could use it as well?

### comment:8 in reply to:  7 Changed 8 years ago by kjellpk (Kjell Konis)

Could we separate MathJax into its own port so that #39216 could use it as well?

Sounds like a good idea to me. I wanted to get this port out the door quickly so I kinda hacked the RStudio build into MacPorts as quick as possible but it definitely makes sense to have the dependencies as separate (or sub) ports.

### comment:9 follow-up:  10 Changed 8 years ago by kjellpk (Kjell Konis)

RStudio's reliance on Boost 1.50 (1.55 is current in Macports) is a showstopper. I'm not going to be able to move forward until I figure out a way to resolve this.

### comment:10 in reply to:  9 Changed 8 years ago by seanfarley (Sean Farley)

RStudio's reliance on Boost 1.50 (1.55 is current in Macports) is a showstopper. I'm not going to be able to move forward until I figure out a way to resolve this.

Ouch. Well, we could at least get the mathjax and ipython ports updated. I don't know off the top of my head how to link to an external installation of mathjax for ipython nor for RStudio but can try if anyone can provide some pointers.

Cc Me!

Cc Me!

### comment:13 Changed 8 years ago by howarth@…

On fink I got rstudio-0.98.826 to build against boost 1.55 with the following change gleaned from a Google search…

--- rstudio-0.98.826/src/cpp/desktop-mac/MainFrameController.h.orig     2014-05-08 08:29:46.000000000 -0400
+++ rstudio-0.98.826/src/cpp/desktop-mac/MainFrameController.h  2014-05-08 08:31:28.000000000 -0400
@@ -13,6 +13,11 @@
*
*/

+#ifdef check
+#undef check
+#endif
+#import "boost/type_traits.hpp"
+
#import "WebViewController.h"



### comment:14 Changed 8 years ago by kjellpk (Kjell Konis)

Thanks, this is really helpful. I'll see if I can get this working in mp this weekend.

### comment:15 Changed 8 years ago by kjellpk (Kjell Konis)

I had a chat with the RStudio developers and they told me they are sticking with Boost 1.50 and QT 4.8.0. Using the latest versions of these dependencies breaks things and they don't currently have the resources to deal with that. I think this port will have to be put on hold until RStudio can put some effort into portability.

### comment:16 Changed 6 years ago by roger.filmyer@…

According to their github page, it looks like it's now possible to use Boost 1.56 and QT 5.4.0. Is it worth looking at this again? Is this being discussed on another ticket?

Last edited 6 years ago by roger.filmyer@… (previous) (diff)

### comment:17 Changed 6 years ago by kjellpk (Kjell Konis)

I'm not aware of another ticket. There is still the remaining problem that during the build, Rstudio was downloading and installing some (prebuilt) binaries (GWT and Mathjax). I'll take another look and see if I can satisfy these dependencies using MacPorts.

### comment:18 Changed 6 years ago by roger.filmyer@…

Isn't GWT in macports as webtoolkit-java-sdk? That version is only 2.4.0 though, RStudio looks like it uses 2.7.0, which is the newest version.

### comment:19 Changed 6 years ago by roger.filmyer@…

Looks like Mathjax is something we keep discussing and never get around to fixing - I didn't notice we'd talked a bit and referenced py-ipython earlier. Whoops!

(original post: Mathjax doesn't look like it exists as a MacPorts port. There is another port, py-ipython #39216, which has a possible dependency on mathjax and a better discussion of it.)

Last edited 6 years ago by roger.filmyer@… (previous) (diff)

Cc Me!

### comment:21 Changed 6 years ago by roger.filmyer@…

I submitted a ticket to update webtoolkit-java-sdk. Should bring us closer to the finish line.

### comment:22 Changed 6 years ago by roger.filmyer@…

Okay. Webtoolkit-java-sdk is now at 2.7, the required version for Rstudio to build. What else do we need to do?

### comment:23 Changed 6 years ago by kjellpk (Kjell Konis)

Thanks for updating Webtoolkit-java-sdk. It looks like some more dependencies have popped up. These are installed by the script .../dependencies/commoninstall-common. The important bit is

./install-gwt
./install-dictionaries
./install-mathjax
./install-boost
./install-pandoc
./install-libclang
./install-packages


There are ports for gwt, boost, and pandoc. The last one, packages, is just an R package. Mathjax will probably need it's own port. I still need to investigate dictionaries and libclang.

### comment:24 Changed 6 years ago by roger.filmyer@…

I'll try working on Mathjax. It looks like RStudio is using version 2.3.1 (tagged in github as v2.3-latest), so I'll try and make a port with 2 versions - 2.3.1 and the current one (2.5.3).