Skip to content

Instantly share code, notes, and snippets.

@stefanschmidt
Last active December 24, 2015 07:39
Show Gist options
  • Save stefanschmidt/6764957 to your computer and use it in GitHub Desktop.
Save stefanschmidt/6764957 to your computer and use it in GitHub Desktop.
Homebrew formula for RubyCocoa
require 'formula'
class Rubycocoa <Formula
url 'http://downloads.sourceforge.net/project/rubycocoa/RubyCocoa/1.0.5/RubyCocoa-1.0.5.tar.gz'
homepage 'http://rubycocoa.sourceforge.net/'
sha1 '7e176eebb4ee59e2b45f03de0b9ae38028876236'
depends_on 'libxml2'
def keg_only?
:provided_by_osx
end
def install
# Preinstall hook installs Xcode docs and templates
rm "pre-install.rb"
homebrew_ruby = "#{HOMEBREW_PREFIX}/bin/ruby"
system homebrew_ruby, "install.rb", "config",
"--prefix=#{prefix}",
"--frameworks=#{prefix}/Frameworks"
system homebrew_ruby, "install.rb", "setup"
system homebrew_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