[R-SIG-Mac] Some suggestions for R.app

stefano iacus jago at mclink.it
Mon May 10 14:37:50 CEST 2004


On May 10, 2004, at 1:59 PM, Kjell Konis wrote:

> Hello,
>
> I have been playing around with R-1.9.0 for a few days now and I have 
> a few suggestions.
>
> 1) Why not put R.framework in R.app/Contents/Frameworks?  I tried this 
> and everything seems to work fine.  Here is the modification to 
> R.app/Contents/MacOS/R to get it to work:
did you try to use prebuilt binary packages from CRAN ? I wonder if 
they can work at all, if so, please let me know.

the idea is to have a real framework that any application can use to, 
for example, embedd R in itself.
A linker flag like -framework R is what is needed in this case. If you 
move the R.framework out of the standard Frameworks path, than 
configuring can be a mess.
The demo Cocoa GUI we are writing is built this way, using the 
-framework R flag.


R.app can be moved anywhere on the system, and if you change the 
location of the R.app with the R.framework inside, then you have to use 
install_tool or similar to hard code the path of the libR.dylib, and 
you need a script for this. Also, any R contributed package need to 
know where to find the R.framework and moving the framework around the 
system, causes troubles (again unless using a script every time you 
move R.app with the R.framework inside)

As a general idea, you should consider (for the various ports) the 
R.framework and the R.app as two separate guys. R.framework does not 
need to know where R.app is, but R.app needs to know where the 
R.framework is installed. So, for fink installer (for example), it 
suffices to put the right dependency. [this is for point 3)]

as for point 2). I think it can be a good idea to move from ~/Library/R 
for ~/Library/Application Support/R
and I can do this in r-devel (aka R 2.0.0) not in r-patched.
I'll add the other two paths also.

In 2.0.0 we will also have the opportunity to specify the path of 
contributed packages, allowing for an installation inside the R. 
framework (you can do this from the shell but not from the GUI at the 
moment)


>
> #!/bin/sh
> # Shell wrapper for R executable.
>
> R_HOME_DIR=$0
> R_HOME_DIR=`dirname ${R_HOME_DIR}`
> R_HOME_DIR=`dirname ${R_HOME_DIR}`
> R_HOME_DIR=${R_HOME_DIR}/Frameworks/R.framework/Resources
>
> #R_HOME_DIR=/Library/Frameworks/R.framework/Resources
>
> <...>
>
> 2) Put the library in ~/Library/Application Support/R/library rather 
> than ~/Library/R/library.  Also, does the library function search in 
> /Library/Application Support/R/library and 
> /Network/Library/Application Support/R/library (without the 
> Application Support I guess) for packages when lib.loc is NULL?
>
> 3) Use the prefix from the configure stage when installing R.app (i.e. 
> install it at ${prefix}/R.app).  This will allow maintainers of fink / 
> darwinports / portage to package R.app more easily.
>
> I hope these are helpful.

surely they are.
stefano
>
> Kjell
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://www.stat.math.ethz.ch/mailman/listinfo/r-sig-mac
>



More information about the R-SIG-Mac mailing list