Last active
December 24, 2015 07:39
-
-
Save stefanschmidt/6764957 to your computer and use it in GitHub Desktop.
Homebrew formula for RubyCocoa
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 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