Created
February 26, 2011 23:31
-
-
Save woahdae/845739 to your computer and use it in GitHub Desktop.
R.app brew script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing this :)
I have generalised it and created a formula in the
Homebrew/homebrew-science
Tap based on this.