This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge branch 'master' of https://github.com/mxcl/homebrew

  • Loading branch information...
Dennis Luxen
Dennis Luxen committed Sep 13, 2012
2 parents ed718c7 + 3b3b54f commit 34c0484368b8ad36897fda92c25e0e73c085f214
View
@@ -41,7 +41,12 @@ class Cmd
def tool
@tool ||= case @arg0
when 'ld' then 'ld'
- when 'cc' then ENV['HOMEBREW_CC']
+ when 'cc', 'c99', 'c89'
+ # Ideally we would run `cx9`, however these tools are POSIX compliant
+ # and don't support many flags. We need -isystem for instance, but also
+ # reliability is generally much higher if we just get clang/gcc to do
+ # the work since Makefiles are dumb and include a lot of excess flags.
+ ENV['HOMEBREW_CC']
when 'c++'
if ENV['HOMEBREW_CC'] =~ /gcc/
'g++'
@@ -120,12 +125,14 @@ class Cmd
if cccfg? 'Ob'
%w{-mtune=generic -Oz}
elsif cccfg? 'O'
- u = %w{-arch i386 -arch x86_64} if cccfg? 'u'
- c = '-march=native' if tool =~ /clang/
- %w{-pipe -w -Os} << u << c
+ args = %w{-pipe -w -Os}
+ args << '-march=native' if tool =~ /clang/
+ args += %w{-arch i386 -arch x86_64} if cccfg? 'u'
+ args << "--std=#{@arg0}" if @arg0 =~ /c[89]9/
+ args
else
[]
- end.flatten
+ end
end
def syslibpath
# We reject brew's lib as we explicitly add this as a -L flag, thus it
@@ -160,7 +167,9 @@ class Cmd
def make_fuss args
dels = @args - args
adds = args - @args
+ dups = dels & args
puts "brew: Superenv removed: #{dels*' '}" unless dels.empty?
+ puts "brew: Superenv deduped: #{dels}" unless dups.empty?
puts "brew: Superenv added: #{adds*' '}" unless adds.empty?
end
end
View
@@ -2,7 +2,10 @@
export HOMEBREW_CCCFG="O$HOMEBREW_CCCFG"
if [ $(basename "$0") == "bsdmake" ]; then
pwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
- exec "$pwd/../../../bin/bsdmake" "$@"
+ bsd="$pwd/../../../bin/bsdmake"
+ # bsdmake used to be keg-only: support users who don't run brew doctor
+ [ -x "$bsd" ] || bsd="$(brew --prefix bsdmake)/bin/bsdmake"
+ exec "$bsd" "$@"
else
exec xcrun make "$@"
fi
View
@@ -12,6 +12,7 @@ def install
system "cmake", "..",
"-DBOX2D_INSTALL=ON",
"-DBOX2D_BUILD_SHARED=ON",
+ "-DBOX2D_BUILD_EXAMPLES=OFF",
*std_cmake_args
system "make install"
end
View
@@ -9,8 +9,6 @@ class Clisp < Formula
depends_on 'libsigsegv'
depends_on 'readline'
- skip_clean :all # otherwise abort trap
-
fails_with :llvm do
build 2334
cause "Configure fails on XCode 4/Snow Leopard."
@@ -13,9 +13,6 @@ class Cppcheck < Formula
depends_on 'pcre' unless build.include? 'no-rules'
depends_on 'qt' if build.include? 'with-gui'
- # Do not strip binaries, or else it fails to run.
- skip_clean :all
-
def install
# Man pages aren't installed as they require docbook schemas.
View
@@ -9,9 +9,6 @@ class Ekg2 < Formula
depends_on 'readline'
depends_on 'libgadu' if build.include? "with-libgadu"
- # stripping breaks loading shared objects
- skip_clean :all
-
option "with-libgadu", "Compiles ekg2 with gadu-gadu support"
def install
@@ -8,9 +8,6 @@ class Fcgiwrap < Formula
depends_on :autoconf
depends_on 'fcgi'
- # Do not strip binaries, or else it fails to run.
- skip_clean :all
-
def install
system "autoreconf", "-i"
system "./configure", "--prefix=#{prefix}"
@@ -59,9 +59,6 @@ def download_strategy
GfortranPkgDownloadStrategy
end
- # Shouldn't strip compiler binaries.
- skip_clean :all
-
def install
if MacOS::Xcode.version >= '4.2' and MacOS.version >= :lion
ohai "Installing gfortran 4.2.4 for XCode 4.2 (build 5666) or higher"
View
@@ -41,7 +41,7 @@ def install
# Force detection of X libs on 64-bit kernel
"--extra-ldflags=-L#{MacOS::X11.lib}"]
- system "chmod +x configure"
+ chmod 0700, "configure"
system "./configure", *args
system "make"
system "make install"
@@ -6,9 +6,6 @@ class MitScheme < Formula
mirror 'http://ftp.gnu.org/gnu/mit-scheme/stable.pkg/9.1.1/mit-scheme-c-9.1.1.tar.gz'
sha1 '8f175a40061bdfc0248535e198cc7f5b5a0dce32'
- # Do not strip the binaries, this will cause missing symbol errors on launch
- skip_clean :all
-
def patches
# fix installation issue with OS X 10.7 and Xcode in /Applications
# http://savannah.gnu.org/patch/?7775
View
@@ -27,6 +27,7 @@ def install
(prefix+'mongod.conf').write mongodb_conf
# Homebrew: it just works.
+ # NOTE plist updated to use prefix/mongodb!
mv (sh = bin/'mongod'), prefix
sh.write <<-EOS.undent
#!/usr/bin/env ruby
@@ -41,20 +42,30 @@ def install
def caveats
bn = plist_path.basename
- plist_path = "#{HOMEBREW_PREFIX}/opt/#{name}/*.plist"
- <<-EOS.undent
- If this is your first install, automatically load on login with:
- mkdir -p ~/Library/LaunchAgents
- ln -s #{plist_path} ~/Library/LaunchAgents/
- launchctl load -w ~/Library/LaunchAgents/#{bn}
+ la = Pathname.new("#{ENV['HOME']}/Library/LaunchAgents")
+ prettypath = "~/Library/LaunchAgents/#{bn}"
+ domain = plist_path.basename('.plist')
+ load = "launchctl load -w #{prettypath}"
+ s = []
- If this is an upgrade and you already have the plist loaded:
- launchctl unload -w ~/Library/LaunchAgents/#{bn}
- launchctl load -w ~/Library/LaunchAgents/#{bn}
-
- Or just start it manually:
- mongod
- EOS
+ # we readlink because this path probably doesn't exist since caveats
+ # occurs before the link step of installation
+ if not (la/bn).file?
+ s << "To have launchd start #{name} at login:"
+ s << " mkdir -p ~/Library/LaunchAgents" unless la.directory?
+ s << " ln -s #{HOMEBREW_PREFIX}/opt/#{name}/*.plist ~/Library/LaunchAgents/"
+ s << "Then to load #{name} now:"
+ s << " #{load}"
+ s << "Or, if you don't want/need launchctl, you can just run:"
+ s << " mongod"
+ elsif Kernel.system "/bin/launchctl list #{domain} &>/dev/null"
+ s << "You should reload #{name}:"
+ s << " launchctl unload -w #{prettypath}"
+ s << " #{load}"
+ else
+ s << "To load #{name}:"
+ s << " #{load}"
+ end
end
def mongodb_conf; <<-EOS.undent
@@ -80,7 +91,7 @@ def startup_plist
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
- <string>#{HOMEBREW_PREFIX}/bin/mongod</string>
+ <string>#{opt_prefix}/mongod</string>
<string>run</string>
<string>--config</string>
<string>#{etc}/mongod.conf</string>
@@ -33,8 +33,6 @@ class MysqlCluster < Formula
cause "http://article.gmane.org/gmane.comp.db.mysql.cluster/2085"
end
- skip_clean :all # So "INSTALL PLUGIN" can work.
-
def options
[
['--with-tests', "Build with unit tests."],
View
@@ -61,9 +61,6 @@ class Node < Formula
build 2326
end
- # Stripping breaks dynamic loading
- skip_clean :all
-
def install
args = %W{--prefix=#{prefix}}
args << "--debug" if build.include? 'enable-debug'
@@ -21,8 +21,6 @@ class PerconaServer < Formula
conflicts_with 'mariadb',
:because => "percona-server and mariadb install the same binaries."
- skip_clean :all # So "INSTALL PLUGIN" can work.
-
fails_with :llvm do
build 2334
cause "https://github.com/mxcl/homebrew/issues/issue/144"
@@ -5,9 +5,6 @@ class Polyml < Formula
homepage 'http://www.polyml.org'
sha1 'a037cd8cf4ce4a43b685b0e0d80f3f1e20d7c9fa'
- # Or dynamic linking breaks
- skip_clean :all
-
def install
# for whatever reason, the configure script fails to find c++ if CXX is defined.
# this overrides configure so that it won't check for c++ and will assume it exists.
@@ -32,10 +32,6 @@ def options
]
end
- # PostGIS command line tools intentionally have unused symbols in
- # them---these are callbacks for liblwgeom.
- skip_clean :all
-
def postgresql
# Follow the PostgreSQL linked keg back to the active Postgres installation
# as it is common for people to avoid upgrading Postgres.
@@ -15,8 +15,6 @@ class Postgresql < Formula
option 'no-perl', 'Build without Perl support'
option 'enable-dtrace', 'Build with DTrace support'
- skip_clean :all
-
# Fix PL/Python build: https://github.com/mxcl/homebrew/issues/11162
# Fix uuid-ossp build issues: http://archives.postgresql.org/pgsql-general/2012-07/msg00654.php
def patches
@@ -7,9 +7,6 @@ class Rubinius < Formula
sha1 'c39c4fb1e62e0fb418453811636177e6ccf6a936'
head 'https://github.com/rubinius/rubinius.git'
- # Do not strip binaries, or else it fails to run.
- skip_clean :all
-
def install
# Let Rubinius define its own flags; messing with these causes build breaks.
ENV.remove_cc_etc
@@ -5,8 +5,6 @@ class Synfigstudio < Formula
url 'http://downloads.sourceforge.net/project/synfig/synfigstudio/0.63.05/synfigstudio-0.63.05.tar.gz'
sha1 '3e8f590b2b1b3cfdef7ecc898fcef3c9254f21e2'
- skip_clean :all # So modules will load
-
depends_on 'gettext'
depends_on 'libsigc++'
depends_on 'gtkmm'
@@ -5,9 +5,6 @@ class Uptimed < Formula
homepage 'http://podgorny.cz/moin/Uptimed'
sha1 '753ab59bb99d7b88a35174ce83081ad0bb224e56'
- # Stripping symbols breaks uptimed
- skip_clean :all
-
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
@@ -8,9 +8,6 @@ class Varnish < Formula
depends_on 'pkg-config' => :build
depends_on 'pcre'
- # If stripped, the magic string end pointer isn't found.
- skip_clean :all
-
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
View
@@ -14,8 +14,6 @@ class Vtk < Formula
depends_on 'pyqt'
end
- skip_clean :all # Otherwise vtkpython complains can't find symbol _environ
-
option 'examples', 'Compile and install various examples'
option 'python', 'Enable python wrapping of VTK classes'
option 'pyqt', 'Make python wrapped classes available to SIP/PyQt'
View
@@ -8,8 +8,6 @@ class Zsh < Formula
depends_on 'gdbm'
depends_on 'pcre'
- skip_clean :all
-
option 'disable-etcdir', 'Disable the reading of Zsh rc files in /etc'
def install
@@ -3,7 +3,7 @@ def __prefix
if ARGV.named.empty?
puts HOMEBREW_PREFIX
else
- puts ARGV.formulae.map{ |f| "#{HOMEBREW_PREFIX}/opt/#{f}" }
+ puts ARGV.formulae.map{ |f| f.opt_prefix.exist? ? f.opt_prefix : f.installed_prefix }
end
end
end
@@ -231,6 +231,16 @@ def check_for_latest_xcode
end
end
+def check_for_stray_developer_directory
+ if MacOS::Xcode.version >= "4.3" and File.exist? "/Developer/Library"
+ return <<-EOS.undent
+ You have leftover files from an older version of Xcode.
+ You should delete them using:
+ /Developer/Library/uninstall-developer-folder
+ EOS
+ end
+end
+
def check_cc
unless MacOS::CLT.installed?
if MacOS::Xcode.version >= "4.3"
@@ -13,9 +13,10 @@ def edit
# If no brews are listed, open the project root in an editor.
if ARGV.named.empty?
editor = File.basename which_editor
- if editor == "mate"
- # If the user is using TextMate, give a nice project view instead.
- exec 'mate', HOMEBREW_REPOSITORY+"bin/brew",
+ if editor == "mate" or editor == "subl"
+ # If the user is using TextMate or Sublime Text,
+ # give a nice project view instead.
+ exec editor, HOMEBREW_REPOSITORY+"bin/brew",
HOMEBREW_REPOSITORY+'README.md',
HOMEBREW_REPOSITORY+".gitignore",
*library_folders
@@ -140,7 +140,7 @@ def determine_cmake_include_path
# TODO prolly shouldn't always do this?
paths << "#{sdk}/System/Library/Frameworks/Python.framework/Versions/Current/include/python2.7"
end
- paths << "#{sdk}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/"
+ paths << "#{sdk}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/" unless x11?
paths << "#{MacSystem.x11_prefix}/include" if x11?
paths.to_path_s
end
@@ -149,7 +149,7 @@ def determine_cmake_library_path
sdk = MacOS.sdk_path if MacSystem.xcode43_without_clt?
paths = []
# things expect to find GL headers since X11 used to be a default, so we add them
- paths << "#{sdk}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries"
+ paths << "#{sdk}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries" unless x11?
paths << "#{MacSystem.x11_prefix}/lib" if x11?
paths.to_path_s
end

0 comments on commit 34c0484

Please sign in to comment.