Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/mxcl/homebrew into powerpc
Browse files Browse the repository at this point in the history
  • Loading branch information
robert914 committed Mar 7, 2012
2 parents 5aba729 + bbc5fed commit c62f480
Show file tree
Hide file tree
Showing 20 changed files with 248 additions and 153 deletions.
4 changes: 2 additions & 2 deletions Library/Formula/closure-compiler.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require 'formula'

class ClosureCompiler < Formula
url 'http://closure-compiler.googlecode.com/files/compiler-20110615.tar.gz'
homepage 'http://code.google.com/p/closure-compiler/'
md5 '7ba597fa67b187df23413eb0ca50f4cb'
url 'http://closure-compiler.googlecode.com/files/compiler-20120305.tar.gz'
md5 '513344df6f18bfa00b17f034cabf897d'

def install
libexec.install "compiler.jar"
Expand Down
31 changes: 16 additions & 15 deletions Library/Formula/colorsvn.rb
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
require 'formula'

class Colorsvn < Formula
url 'http://www.console-colors.de/downloads/colorsvn/colorsvn-0.3.2.tar.gz'
homepage 'http://colorsvn.tigris.org/'
url 'http://www.console-colors.de/downloads/colorsvn/colorsvn-0.3.2.tar.gz'
md5 'f6f59439f56c0ce664a0a832052cdc06'

def patches
DATA
end

def install
system "./configure", "--prefix=#{prefix}", "--mandir=#{man}", "--sysconfdir=#{etc}"
inreplace "colorsvn.1", "/etc", etc
system "./configure", "--prefix=#{prefix}",
"--mandir=#{man}",
"--sysconfdir=#{etc}"
inreplace ["colorsvn.1", "colorsvn-original"], "/etc", etc
system "make"
system "make install"
end

def caveats
<<-END_CAVEATS
You probably want to set an alias to svn in your bash profile.
So source #{etc}/profile.d/colorsvn-env.sh or add the line
alias svn=colorsvn
def caveats; <<-EOS.undent
You probably want to set an alias to svn in your bash profile.
So source #{etc}/profile.d/colorsvn-env.sh or add the line
to your bash profile.
alias svn=colorsvn
So when you type "svn" you'll run "colorsvn".
END_CAVEATS
end
to your bash profile.
def patches
DATA
So when you type "svn" you'll run "colorsvn".
EOS
end
end

Expand Down
25 changes: 0 additions & 25 deletions Library/Formula/dotless.rb

This file was deleted.

4 changes: 2 additions & 2 deletions Library/Formula/doxygen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

class Doxygen < Formula
homepage 'http://www.doxygen.org/'
url 'http://ftp.stack.nl/pub/users/dimitri/doxygen-1.7.6.1.src.tar.gz'
sha1 '6203d4423d12315f1094b56a4d7393347104bc4a'
url 'http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.0.src.tar.gz'
sha1 '7f4348418dc3efefd357b32a2b5c8010211ab284'

head 'https://doxygen.svn.sourceforge.net/svnroot/doxygen/trunk'

Expand Down
6 changes: 3 additions & 3 deletions Library/Formula/dwarf-fortress.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'formula'

class DwarfFortress < Formula
url 'http://www.bay12games.com/dwarves/df_34_02_osx.tar.bz2'
url 'http://www.bay12games.com/dwarves/df_34_05_osx.tar.bz2'
homepage 'http://www.bay12games.com/dwarves/'
md5 'a3ca35ec3d74f1c179db48a70be648b5'
version '0.34.02'
md5 '470dd5b1f75bdc2f567a10127b3708bf'
version '0.34.05'

def script; <<-EOS.undent
#!/bin/sh
Expand Down
34 changes: 34 additions & 0 deletions Library/Formula/freeciv.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
require 'formula'

class Freeciv < Formula
homepage 'http://freeciv.wikia.com'
url 'http://downloads.sourceforge.net/project/freeciv/Freeciv%202.3/2.3.1/freeciv-2.3.1.tar.bz2'
md5 'efce9b2cd8b7a36017f1ebce59236dcb'
head 'svn://svn.gna.org/svn/freeciv/trunk', :using => :svn

def options
[['--disable-nls', 'Disable NLS support.']]
end

depends_on 'pkg-config' => :build
depends_on "gtk+"
depends_on "gettext" unless ARGV.include? "--disable-nls"

def install
args = ["--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"]

unless ARGV.include? '--disable-nls'
gettext = Formula.factory('gettext')
args << "CFLAGS=-I#{gettext.include}"
args << "LDFLAGS=-L#{gettext.lib}"
end

system "./configure", *args
system "make install"
end

def test
system "#{bin}/freeciv-server -v"
end
end
9 changes: 4 additions & 5 deletions Library/Formula/go-gui.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
require 'formula'

class GoGui < Formula
url 'http://downloads.sourceforge.net/project/gogui/gogui/1.2.2/gogui-1.2.2.zip'
homepage 'http://gogui.sourceforge.net'
md5 'a222d7f5f654341dc55016fd4c1d512f'
url 'http://downloads.sourceforge.net/project/gogui/gogui/1.4.2/gogui-1.4.2.zip'
md5 '0f5e95deff548699c368b71e088bea58'

def install
system "ant"
system "ant", "gogui.app"
prefix.install ['build/GoGui.app']
system "ant", "gogui.app", "-Ddoc-uptodate=true"
prefix.install 'build/GoGui.app'
end

def caveats; <<-EOS.undent
Expand Down
24 changes: 24 additions & 0 deletions Library/Formula/hg-flow.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require 'formula'

class HgFlow < Formula
homepage 'https://bitbucket.org/yinwm/hgflow/wiki/Home'
url 'https://bitbucket.org/yinwm/hgflow/get/v0.3.tar.gz'
md5 '0c3305bc349be31da76ef82460019d09'

head "http://bitbucket.org/yinwm/hgflow", :using => :hg

def install
prefix.install 'src/hgflow/hgflow.py'
end

def caveats; <<-EOS.undent
1. Put following lines into your ~/.hgrc
2. Restart your shell and try "hg flow".
3. For more information go to http://bitbucket.org/yinwm/hgflow
[extensions]
hgflow = #{prefix}/hgflow.py
EOS
end
end
4 changes: 2 additions & 2 deletions Library/Formula/percona-toolkit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

class PerconaToolkit < Formula
homepage 'http://www.percona.com/software/percona-toolkit/'
url 'http://www.percona.com/redir/downloads/percona-toolkit/2.0.2/percona-toolkit-2.0.2.tar.gz'
md5 '74f55df529b2527853d4d907f0175c0d'
url 'http://www.percona.com/redir/downloads/percona-toolkit/2.0.3/percona-toolkit-2.0.3.tar.gz'
md5 '10f394c101067b6bf28427c5d4833330'

depends_on 'Time::HiRes' => :perl
depends_on 'DBD::mysql' => :perl
Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/cmd/cleanup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def cleanup_formula f

def clean_cache
HOMEBREW_CACHE.children.each do |pn|
next unless pn.file?
pn.stem =~ /^(.+)-(.+)$/ # greedy so works even if formula-name has hyphens in it
if $1 and $2
f = Formula.factory($1) rescue nil
Expand Down
7 changes: 6 additions & 1 deletion Library/Homebrew/cmd/doctor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,11 @@ def check_xcode_select_path
path = `xcode-select -print-path 2>/dev/null`.chomp
unless File.directory? path and File.file? "#{path}/usr/bin/xcodebuild"
# won't guess at the path they should use because it's too hard to get right
# We specify /Applications/Xcode.app/Contents/Developer even though
# /Applications/Xcode.app should work because people don't install the new CLI
# tools and then it doesn't work. Lets hope the location doesn't change in the
# future.

<<-EOS.undent
Your Xcode is configured with an invalid path.
You should change it to the correct path. Please note that there is no correct
Expand All @@ -357,7 +362,7 @@ def check_xcode_select_path
these is (probably) what you want:
sudo xcode-select -switch /Developer
sudo xcode-select -switch /Applications/Xcode.app
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
EOS
end
end
Expand Down
23 changes: 3 additions & 20 deletions Library/Homebrew/cmd/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ def install
raise "No available formula for #{name}\n#{msg}" if msg
end unless ARGV.force?

ARGV.formulae.each do |f|
opoo "#{f} already installed" if f.linked_keg.directory?
end unless ARGV.force?

if Process.uid.zero? and not File.stat(HOMEBREW_BREW_FILE).uid.zero?
# note we only abort if Homebrew is *not* installed as sudo and the user
# calls brew as root. The fix is to chown brew to root.
Expand Down Expand Up @@ -83,29 +79,16 @@ def install_formulae formulae
unless formulae.empty?
perform_preinstall_checks
formulae.each do |f|
# Check formula status and skip if necessary---a formula passed on the
# command line may have been installed to satisfy a dependency.
next if f.installed? unless ARGV.force?

# Building head-only without --HEAD is an error
if not ARGV.build_head? and f.standard.nil?
raise "This is a head-only formula; install with `brew install --HEAD #{f.name}`"
end

# Building stable-only with --HEAD is an error
if ARGV.build_head? and f.unstable.nil?
raise "No head is defined for #{f.name}"
end

begin
fi = FormulaInstaller.new(f)
fi.install
fi.caveats
fi.finish
rescue FormulaAlreadyInstalledError => e
opoo e.message
rescue CannotInstallFormulaError => e
onoe e.message
end
end
end
end

end
50 changes: 40 additions & 10 deletions Library/Homebrew/cmd/upgrade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,23 @@ def plural_s

module Homebrew extend self
def upgrade
if Process.uid.zero? and not File.stat(HOMEBREW_BREW_FILE).uid.zero?
# note we only abort if Homebrew is *not* installed as sudo and the user
# calls brew as root. The fix is to chown brew to root.
abort "Cowardly refusing to `sudo brew upgrade'"
end

Homebrew.perform_preinstall_checks

outdated = if ARGV.named.empty?
Homebrew.outdated_brews
else
ARGV.formulae.each do |f|
raise "#{f} already upgraded" if f.installed?
raise "#{f} not installed" unless f.rack.exist? and not f.rack.children.empty?
ARGV.formulae.select do |f|
unless f.rack.exist? and not f.rack.children.empty?
onoe "#{f} not installed"
else
true
end
end
end

Expand All @@ -35,13 +44,34 @@ def upgrade
end

outdated.each do |f|
installer = FormulaInstaller.new f
installer.show_header = false
oh1 "Upgrading #{f.name}"
installer.install
Keg.new(f.linked_keg.realpath).unlink if f.linked_keg.directory?
installer.caveats
installer.finish # includes link step
upgrade_formula f
end
end

def upgrade_formula f
outdated_keg = Keg.new(f.linked_keg.realpath) rescue nil

installer = FormulaInstaller.new f
installer.show_header = false

oh1 "Upgrading #{f.name}"

# first we unlink the currently active keg for this formula otherwise it is
# possible for the existing build to interfere with the build we are about to
# do! Seriously, it happens!
outdated_keg.unlink if outdated_keg

installer.install
installer.caveats
installer.finish
rescue CannotInstallFormulaError => e
onoe e
rescue BuildError => e
e.dump
puts
ensure
# restore previous installation state if build failed
outdated_keg.link if outdated_keg and not f.installed? rescue nil
end

end
41 changes: 37 additions & 4 deletions Library/Homebrew/exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ def initialize formula, message=""
end
end

class FormulaAlreadyInstalledError < Homebrew::InstallationError
def message
"Formula already installed: #{formula}"
end
class CannotInstallFormulaError < RuntimeError
end

class FormulaInstallationAlreadyAttemptedError < Homebrew::InstallationError
Expand Down Expand Up @@ -121,6 +118,42 @@ def initialize formula, cmd, args, es
def was_running_configure?
@command == './configure'
end

def dump
e = self

require 'cmd/--config'
require 'cmd/--env'

e.backtrace[1] =~ %r{Library/Formula/(.+)\.rb:(\d+)}
formula_name = $1
error_line = $2

ohai "Exit Status: #{e.exit_status}"
puts "http://github.com/mxcl/homebrew/blob/master/Library/Formula/#{formula_name}.rb#L#{error_line}"
ohai "Environment"
puts Homebrew.config_s
ohai "Build Flags"
puts %["--use-clang" was specified] if ARGV.include? '--use-clang'
puts %["--use-llvm" was specified] if ARGV.include? '--use-llvm'
puts %["--use-gcc" was specified] if ARGV.include? '--use-gcc'
Homebrew.dump_build_env e.env
puts
onoe e
issues = GitHub.issues_for_formula formula_name
if issues.empty?
puts "If `brew doctor' does not help diagnose the issue, please report the bug:"
puts " #{Tty.em}#{ISSUES_URL}#{Tty.reset}"
else
puts "These existing issues may help you:", *issues.map{ |s| " #{Tty.em}#{s}#{Tty.reset}" }
puts "Otherwise, please report the bug:"
puts " #{Tty.em}#{ISSUES_URL}#{Tty.reset}"
end
if e.was_running_configure?
puts "We saved the configure log, please gist it if you report the issue:"
puts " ~/Library/Logs/Homebrew/config.log"
end
end
end

# raised in CurlDownloadStrategy.fetch
Expand Down
Loading

0 comments on commit c62f480

Please sign in to comment.