Skip to content

Instantly share code, notes, and snippets.

@woahdae
Created February 26, 2011 23:31
Show Gist options
  • Save woahdae/845739 to your computer and use it in GitHub Desktop.
Save woahdae/845739 to your computer and use it in GitHub Desktop.
R.app brew script
require 'formula'
class RApp < Formula
# i386 or x86_64
ARCHS = "x86_64"
# Leopard, Leopard64, SnowLeopard
SYSTEM = "SnowLeopard"
url 'http://cran.r-project.org/bin/macosx/Mac-GUI-1.36.tar.gz'
homepage 'http://cran.r-project.org/bin/macosx/'
md5 '671b916ee3d1c42253541b4addb292c2'
keg_only "This is a gui app (and a brew antipattern as such, but whatev)"
depends_on 'r'
def install
# R.app has its R framework path hardcoded. I wouldn't hardcode brew's R
# framework path either if I could find a way to get the path to it.
if !File.exist?("/Library/Frameworks/R.framework")
ln_s "#{HOMEBREW_PREFIX}/Cellar/r/2.12.2/R.framework",
"/Library/Frameworks/R.framework"
end
system "xcodebuild -target R -configuration #{SYSTEM} -project R.xcodeproj"+
" ARCHS=#{ARCHS}"
mv "build/#{SYSTEM}/R.app", "/Applications/R.app"
end
end
@joshbode
Copy link

Thanks for sharing this :)

I have generalised it and created a formula in the Homebrew/homebrew-science Tap based on this.

$ brew tap Homebrew/homebrew-science
$ brew install r-gui
$ brew linkapps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment