Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
formulae: fix with/without usage.
Closes Homebrew/legacy-homebrew#27275.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
  • Loading branch information
MikeMcQuaid committed Mar 8, 2014
1 parent 7f000e4 commit eefdf6b
Show file tree
Hide file tree
Showing 102 changed files with 267 additions and 270 deletions.
2 changes: 1 addition & 1 deletion Formula/apple-gcc42.rb
Expand Up @@ -36,7 +36,7 @@ class AppleGcc42 < Formula
def install
safe_system "pax --insecure -rz -f Payload.gz -s ',./usr,#{prefix},'"

if build.include? 'with-gfortran-symlink'
if build.with? "gfortran-symlink"
safe_system "ln -sf #{bin}/gfortran-4.2 #{bin}/gfortran"
safe_system "ln -sf #{man1}/gfortran-4.2.1 #{man1}/gfortran.1"
end
Expand Down
4 changes: 2 additions & 2 deletions Formula/atari++.rb
Expand Up @@ -12,8 +12,8 @@ class Atarixx < Formula

def install
args = ["--prefix=#{prefix}"]
args << "--disable-CURSES" unless build.include? 'with-curses'
args << "--disable-SDL" unless build.include? 'with-sdl'
args << "--disable-CURSES" if build.without? "curses"
args << "--disable-SDL" if build.without? "sdl"

system "./configure", *args
system "make"
Expand Down
2 changes: 1 addition & 1 deletion Formula/berkeley-db.rb
Expand Up @@ -32,7 +32,7 @@ def install
--enable-cxx
--enable-compat185
]
args << "--enable-java" if build.include? "with-java"
args << "--enable-java" if build.with? "java"
args << "--enable-sql" if build.include? "enable-sql"

# BerkeleyDB requires you to build everything from the build_unix subdirectory
Expand Down
14 changes: 7 additions & 7 deletions Formula/boost.rb
Expand Up @@ -64,7 +64,7 @@ class Boost < Formula

def install
# https://svn.boost.org/trac/boost/ticket/8841
if build.with? 'mpi' and not build.without? 'single'
if build.with? 'mpi' and build.with? 'single'
raise <<-EOS.undent
Building MPI support for both single and multi-threaded flavors
is not supported. Please use '--with-mpi' together with
Expand Down Expand Up @@ -150,16 +150,16 @@ def install
"--user-config=user-config.jam",
"install"]

if build.include? 'without-single'
args << "threading=multi"
else
if build.with? "single"
args << "threading=multi,single"
else
args << "threading=multi"
end

if build.include? 'without-static'
args << "link=shared"
else
if build.with? "static"
args << "link=shared,static"
else
args << "link=shared"
end

args << "address-model=32_64" << "architecture=x86" << "pch=off" if build.universal?
Expand Down
2 changes: 1 addition & 1 deletion Formula/cairomm.rb
Expand Up @@ -21,7 +21,7 @@ class Cairomm < Formula
depends_on 'libsigc++'
end
depends_on 'cairo'
depends_on :x11 unless build.include? 'without-x'
depends_on :x11 if build.with? "x"

def install
ENV.cxx11 if build.cxx11?
Expand Down
6 changes: 3 additions & 3 deletions Formula/cgal.rb
Expand Up @@ -22,7 +22,7 @@ class Cgal < Formula
depends_on 'mpfr'

depends_on 'qt' if build.include? 'imaging'
depends_on 'eigen' if build.include? 'with-eigen3'
depends_on 'eigen' if build.with? "eigen3"

def patches
# Allows to compile with clang 425: http://goo.gl/y9Dg2y
Expand All @@ -38,10 +38,10 @@ def install
unless build.include? 'imaging'
args << "-DWITH_CGAL_Qt3=OFF" << "-DWITH_CGAL_Qt4=OFF" << "-DWITH_CGAL_ImageIO=OFF"
end
if build.include? 'with-eigen3'
if build.with? "eigen3"
args << "-DWITH_Eigen3=ON"
end
if build.include? 'with-lapack'
if build.with? "lapack"
args << "-DWITH_LAPACK=ON"
end
args << '.'
Expand Down
5 changes: 2 additions & 3 deletions Formula/chromaprint.rb
Expand Up @@ -8,15 +8,15 @@ class Chromaprint < Formula
option 'without-examples', "Don't build examples (including fpcalc)"

depends_on 'cmake' => :build
depends_on 'ffmpeg' unless build.include? 'without-examples'
depends_on 'ffmpeg' if build.with? "examples"

# Upstream patch:
# https://bitbucket.org/acoustid/chromaprint/commits/d0a8d8bc7c1ad5bda3294836f49184fe34a92454
def patches; DATA; end

def install
args = std_cmake_args
args << '-DBUILD_EXAMPLES=ON' unless build.include? 'without-examples'
args << '-DBUILD_EXAMPLES=ON' if build.with? "examples"
system "cmake", ".", *args
system "make install"
end
Expand All @@ -34,4 +34,3 @@ def install
+#include <algorithm>
#include <limits>
#include <iterator>

6 changes: 3 additions & 3 deletions Formula/clasp.rb
Expand Up @@ -7,10 +7,10 @@ class Clasp < Formula

option 'with-mt', 'Enable multi-thread support'

depends_on 'tbb' if build.include? 'with-mt'
depends_on 'tbb' if build.with? "mt"

def install
if build.include? 'with-mt'
if build.with? "mt"
ENV['TBB30_INSTALL_DIR'] = Formula["tbb"].opt_prefix
build_dir = 'build/release_mt'
else
Expand All @@ -21,7 +21,7 @@ def install
--config=release
--prefix=#{prefix}
]
args << "--with-mt" if build.include? 'with-mt'
args << "--with-mt" if build.with? "mt"

bin.mkpath
system "./configure.sh", *args
Expand Down
2 changes: 1 addition & 1 deletion Formula/clutter.rb
Expand Up @@ -16,7 +16,7 @@ class Clutter < Formula
depends_on 'atk'
depends_on 'pango'
depends_on 'json-glib'
depends_on :x11 => '2.5.1' unless build.without? 'x'
depends_on :x11 => '2.5.1' if build.with? 'x'

def install
args = %W[
Expand Down
7 changes: 3 additions & 4 deletions Formula/cogl.rb
Expand Up @@ -13,7 +13,7 @@ class Cogl < Formula
depends_on 'cairo'
depends_on 'glib'
depends_on 'pango'
depends_on :x11 => '2.5.1' unless build.without? 'x'
depends_on :x11 => '2.5.1' if build.with? 'x'

def patches
# Patch from MacPorts, reported upstream at https://bugzilla.gnome.org/show_bug.cgi?id=708825
Expand Down Expand Up @@ -48,7 +48,7 @@ def install
+#include <mach/mach_time.h>
+#define CLOCK_REALTIME 0
+#define CLOCK_MONOTONIC 0
+static int
+static int
+clock_gettime(int clk_id, struct timespec *t){
+ mach_timebase_info_data_t timebase;
+ mach_timebase_info(&timebase);
Expand All @@ -63,6 +63,5 @@ def install
+#else
#include <time.h>
+#endif

#include <glib/gi18n-lib.h>

4 changes: 2 additions & 2 deletions Formula/cppcheck.rb
Expand Up @@ -11,7 +11,7 @@ class Cppcheck < Formula
option 'with-gui', "Build the cppcheck gui (requires Qt)"

depends_on 'pcre' unless build.include? 'no-rules'
depends_on 'qt' if build.include? 'with-gui'
depends_on 'qt' if build.with? "gui"

def install
# Man pages aren't installed as they require docbook schemas.
Expand All @@ -26,7 +26,7 @@ def install
system "make", "DESTDIR=#{prefix}", "BIN=#{bin}", "CFGDIR=#{prefix}/cfg", "install"
prefix.install "cfg"

if build.include? 'with-gui'
if build.with? "gui"
cd "gui" do
if build.include? 'no-rules'
system "qmake", "HAVE_RULES=no"
Expand Down
6 changes: 3 additions & 3 deletions Formula/dcmtk.rb
Expand Up @@ -10,7 +10,7 @@ class Dcmtk < Formula
depends_on 'cmake' => :build
depends_on "libpng"
depends_on 'libtiff'
depends_on 'doxygen' if build.include? 'with-docs'
depends_on 'doxygen' if build.with? "docs"

# This roughly corresponds to thefollowing upstream patch:
#
Expand All @@ -31,12 +31,12 @@ def install
ENV.m64 if MacOS.prefer_64_bit?

args = std_cmake_args
args << '-DDCMTK_WITH_DOXYGEN=YES' if build.include? 'with-docs'
args << '-DDCMTK_WITH_DOXYGEN=YES' if build.with? "docs"
args << '..'

mkdir 'build' do
system 'cmake', *args
system 'make DOXYGEN' if build.include? 'with-docs'
system 'make DOXYGEN' if build.with? "docs"
system 'make install'
end
end
Expand Down
4 changes: 2 additions & 2 deletions Formula/dnsmasq.rb
Expand Up @@ -13,7 +13,7 @@ class Dnsmasq < Formula

option 'with-idn', 'Compile with IDN support'

depends_on "libidn" if build.include? 'with-idn'
depends_on "libidn" if build.with? "idn"
depends_on 'pkg-config' => :build

def install
Expand All @@ -23,7 +23,7 @@ def install
inreplace "src/config.h", "/etc/dnsmasq.conf", "#{etc}/dnsmasq.conf"

# Optional IDN support
if build.include? 'with-idn'
if build.with? "idn"
inreplace "src/config.h", "/* #define HAVE_IDN */", "#define HAVE_IDN"
end

Expand Down
2 changes: 1 addition & 1 deletion Formula/ejabberd.rb
Expand Up @@ -33,7 +33,7 @@ def install
args << "--with-openssl=#{openssl.prefix}"
end

args << "--enable-odbc" if build.include? 'with-odbc'
args << "--enable-odbc" if build.with? "odbc"

system "./configure", *args
system "make"
Expand Down
2 changes: 1 addition & 1 deletion Formula/emacs-clang-complete-async.rb
Expand Up @@ -17,7 +17,7 @@ def patches; DATA; end
def install
system "make"
bin.install "clang-complete"
share.install "auto-complete-clang-async.el" if build.include? 'with-elisp'
share.install "auto-complete-clang-async.el" if build.with? "elisp"
end
end

Expand Down
4 changes: 2 additions & 2 deletions Formula/emacs.rb
Expand Up @@ -34,7 +34,7 @@ class Emacs < Formula
end

depends_on 'pkg-config' => :build
depends_on :x11 if build.include? "with-x"
depends_on :x11 if build.with? "x"
depends_on 'gnutls' => :optional

fails_with :llvm do
Expand Down Expand Up @@ -114,7 +114,7 @@ def install
#{prefix}/Emacs.app/Contents/MacOS/Emacs -nw "$@"
EOS
else
if build.include? "with-x"
if build.with? "x"
# These libs are not specified in xft's .pc. See:
# https://trac.macports.org/browser/trunk/dports/editors/emacs/Portfile#L74
# https://github.com/Homebrew/homebrew/issues/8156
Expand Down
6 changes: 3 additions & 3 deletions Formula/evas.rb
Expand Up @@ -14,15 +14,15 @@ class Evas < Formula
depends_on :fontconfig
depends_on 'fribidi'
depends_on 'harfbuzz'
depends_on 'doxygen' if build.include? 'with-docs'
depends_on 'doxygen' if build.with? "docs"

def install
args = ["--prefix=#{prefix}", "--disable-dependency-tracking"]
args << "--with-doxygen-file=#{HOMEBREW_PREFIX}/bin/doxygen" if build.include? 'with-docs'
args << "--with-doxygen-file=#{HOMEBREW_PREFIX}/bin/doxygen" if build.with? "docs"

system "./configure", *args

system "make install"
system "make install-doc" if build.include? 'with-docs'
system "make install-doc" if build.with? "docs"
end
end
10 changes: 5 additions & 5 deletions Formula/fantom.rb
Expand Up @@ -13,8 +13,8 @@ def patches; DATA; end

def install
rm_f Dir["bin/*.exe", "lib/dotnet/*"]
rm_rf "examples" unless build.include? 'with-examples'
rm_rf "src" unless build.include? 'with-src'
rm_rf "examples" if build.without? "examples"
rm_rf "src" if build.without? "src"

libexec.install Dir['*']
system "chmod 0755 #{libexec}/bin/*"
Expand All @@ -26,16 +26,16 @@ def install
diff --git a/etc/build/config.props b/etc/build/config.props
index 368bce3..ebbff42 100755
--- a/etc/build/config.props
+++ b/etc/build/config.props
+++ b/etc/build/config.props
@@ -22,8 +22,8 @@ buildVersion=1.0.65
javacParams=-target 1.5

// Windows setup
-jdkHome=/C:/Program Files/Java/jdk1.6/
-dotnetHome=/C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/
+//jdkHome=/C:/Program Files/Java/jdk1.6/
+//dotnetHome=/C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/

// Mac setup
-//jdkHome=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/
\ No newline at end of file
Expand Down
8 changes: 4 additions & 4 deletions Formula/ffmbc.rb
Expand Up @@ -32,10 +32,10 @@ def install
"--enable-nonfree",
"--cc=#{ENV.cc}"]

args << "--enable-libx264" unless build.without? 'x264'
args << "--enable-libfaac" unless build.without? 'faac'
args << "--enable-libmp3lame" unless build.without? 'lame'
args << "--enable-libxvid" unless build.without? 'xvid'
args << "--enable-libx264" if build.with? 'x264'
args << "--enable-libfaac" if build.with? 'faac'
args << "--enable-libmp3lame" if build.with? 'lame'
args << "--enable-libxvid" if build.with? 'xvid'

args << "--enable-libfreetype" if build.with? 'freetype'
args << "--enable-libtheora" if build.with? 'theora'
Expand Down
6 changes: 3 additions & 3 deletions Formula/ffmpeg.rb
Expand Up @@ -46,7 +46,7 @@ class Ffmpeg < Formula
depends_on 'libvo-aacenc' => :optional
depends_on 'libass' => :optional
depends_on 'openjpeg' => :optional
depends_on 'sdl' if build.include? 'with-ffplay'
depends_on 'sdl' if build.with? "ffplay"
depends_on 'speex' => :optional
depends_on 'schroedinger' => :optional
depends_on 'fdk-aac' => :optional
Expand Down Expand Up @@ -84,7 +84,7 @@ def install
args << "--enable-libopencore-amrnb" << "--enable-libopencore-amrwb" if build.with? 'opencore-amr'
args << "--enable-libvo-aacenc" if build.with? 'libvo-aacenc'
args << "--enable-libass" if build.with? 'libass'
args << "--enable-ffplay" if build.include? 'with-ffplay'
args << "--enable-ffplay" if build.with? "ffplay"
args << "--enable-libspeex" if build.with? 'speex'
args << '--enable-libschroedinger' if build.with? 'schroedinger'
args << "--enable-libfdk-aac" if build.with? 'fdk-aac'
Expand Down Expand Up @@ -116,7 +116,7 @@ def install

system "make install"

if build.include? 'with-tools'
if build.with? "tools"
system "make alltools"
bin.install Dir['tools/*'].select {|f| File.executable? f}
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/fftw.rb
Expand Up @@ -26,7 +26,7 @@ def install
simd_args = ["--enable-sse2"]
simd_args << "--enable-avx" if ENV.compiler == :clang and Hardware::CPU.avx? and !build.bottle?

args << "--disable-fortran" unless build.with? "fortran"
args << "--disable-fortran" if build.without? "fortran"

ENV.universal_binary if build.universal?

Expand Down
2 changes: 1 addition & 1 deletion Formula/fontforge.rb
Expand Up @@ -61,7 +61,7 @@ def install
args << "--without-cairo" if build.without? "cairo"
args << "--without-pango" if build.without? "pango"
end
args << "--without-x" unless build.with? 'x'
args << "--without-x" if build.without? 'x'

# To avoid "dlopen(/opt/local/lib/libpng.2.dylib, 1): image not found"
args << "--with-static-imagelibs"
Expand Down
4 changes: 2 additions & 2 deletions Formula/freediameter.rb
Expand Up @@ -15,7 +15,7 @@ class Freediameter < Formula
depends_on 'libgcrypt'
depends_on 'libidn'

if build.include? 'with-all-extensions'
if build.with? "all-extensions"
depends_on :postgresql
depends_on :mysql
depends_on 'swig' => :build
Expand All @@ -28,7 +28,7 @@ def install
-DDISABLE_SCTP=ON
]

args << '-DALL_EXTENSIONS=ON' if build.include? 'with-all-extensions'
args << '-DALL_EXTENSIONS=ON' if build.with? "all-extensions"
args << '..'

mkdir 'build' do
Expand Down

0 comments on commit eefdf6b

Please sign in to comment.