Skip to content

Instantly share code, notes, and snippets.

@stefanschmidt
Forked from woahdae/r_app.rb
Last active December 24, 2015 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanschmidt/6842577 to your computer and use it in GitHub Desktop.
Save stefanschmidt/6842577 to your computer and use it in GitHub Desktop.
Homebrew formula for GNU R GUI
require 'formula'
class RApp < Formula
ARCHS = "x86_64"
SYSTEM = "SnowLeopard64"
url 'http://cran.r-project.org/bin/macosx/Mac-GUI-1.62.tar.gz'
homepage 'http://cran.r-project.org/bin/macosx/'
sha1 '3f7ef605076cf537b304a05d979ae44d3cb054ab'
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.
# This won't execute in Homebrew, so just create the link manually
if !File.exist?("/Library/Frameworks/R.framework")
ln_s "#{HOMEBREW_PREFIX}/Cellar/r/3.0.1/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