Skip to content

Instantly share code, notes, and snippets.

@yyolk
Created August 4, 2012 16: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 yyolk/3258648 to your computer and use it in GitHub Desktop.
Save yyolk/3258648 to your computer and use it in GitHub Desktop.
RubyCocoa homebrew formula
require 'formula'
class Rubycocoa <Formula
url 'http://downloads.sourceforge.net/project/rubycocoa/RubyCocoa/1.0.2/RubyCocoa-1.0.2.tar.gz'
homepage 'http://rubycocoa.sourceforge.net/'
md5 'eb6127054b808c2700c6253c8a4793c3'
def keg_only?
:provided_by_osx
end
def install
# Preinstall hook installs Xcode docs and templates
rm "pre-install.rb"
system "ruby", "install.rb", "config",
"--prefix=#{prefix}",
"--frameworks=#{prefix}/Frameworks"
system "ruby", "install.rb", "setup"
system "ruby", "install.rb", "install"
ln_sf "#{prefix}/Frameworks/RubyCocoa.framework", "/Library/Frameworks"
ruby_prefix = `ruby -rrbconfig -e "puts Config::CONFIG['prefix']"`.chomp
Dir["#{prefix}/lib/**/*"].each do |src|
dest = src.sub(/^#{prefix}/, ruby_prefix)
if File.file?(src)
mkdir_p File.dirname(dest)
ln_sf src, dest
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment