aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Formula/asymptote.rb28
-rw-r--r--Library/Formula/auctex.rb26
-rw-r--r--Library/Formula/dbslayer.rb45
-rw-r--r--Library/Formula/git-hg.rb24
-rw-r--r--Library/Formula/jstalk.rb26
-rw-r--r--Library/Formula/lilypond.rb26
-rw-r--r--Library/Formula/mydumper.rb33
-rw-r--r--Library/Formula/mysql-proxy.rb33
-rw-r--r--Library/Formula/pg_top.rb34
-rw-r--r--Library/Formula/pgtap.rb33
-rw-r--r--Library/Formula/skytools.rb33
11 files changed, 221 insertions, 120 deletions
diff --git a/Library/Formula/asymptote.rb b/Library/Formula/asymptote.rb
index 19b536be7..a873b416c 100644
--- a/Library/Formula/asymptote.rb
+++ b/Library/Formula/asymptote.rb
@@ -1,24 +1,32 @@
require 'formula'
+class TexInstalled < Requirement
+ def message; <<-EOS.undent
+ A TeX/LaTeX installation is required to install.
+ You can obtain the TeX distribution for Mac OS X from:
+ http://www.tug.org/mactex/
+ EOS
+ end
+ def satisfied?
+ which 'latex'
+ end
+ def fatal?
+ true
+ end
+end
+
class Asymptote < Formula
homepage 'http://asymptote.sourceforge.net/'
url 'http://downloads.sourceforge.net/asymptote/asymptote-2.15.src.tgz'
md5 '1adb969a4d7b17a3ae98728d1956bd77'
+ depends_on TexInstalled.new
+
depends_on 'readline'
depends_on 'bdw-gc'
def install
- unless which 'latex'
- onoe <<-EOS.undent
- Asymptote requires a TeX/LaTeX installation; aborting now.
- You can obtain the TeX distribution for Mac OS X from
- http://www.tug.org/mactex/
- EOS
- exit 1
- end
-
- texmfhome = share + 'texmf'
+ texmfhome = share+'texmf'
# see: https://sourceforge.net/tracker/?func=detail&aid=3486838&group_id=120000&atid=685683
inreplace 'configure', '--no-var-tracking', '' if ENV.compiler == :clang
diff --git a/Library/Formula/auctex.rb b/Library/Formula/auctex.rb
index d36b3df3c..2a199c264 100644
--- a/Library/Formula/auctex.rb
+++ b/Library/Formula/auctex.rb
@@ -1,11 +1,28 @@
require 'formula'
+class TexInstalled < Requirement
+ def message; <<-EOS.undent
+ A TeX/LaTeX installation is required to install.
+ You can obtain the TeX distribution for Mac OS X from:
+ http://www.tug.org/mactex/
+ EOS
+ end
+ def satisfied?
+ which 'latex'
+ end
+ def fatal?
+ true
+ end
+end
+
class Auctex < Formula
homepage 'http://ftp.gnu.org/pub/gnu/auctex'
url 'http://ftpmirror.gnu.org/auctex/auctex-11.86.tar.gz'
mirror 'http://ftp.gnu.org/gnu/auctex/auctex-11.86.tar.gz'
md5 '6bc33a67b6ac59db1aa238f3693b36d2'
+ depends_on TexInstalled.new
+
def options
[['--with-emacs=</full/path/to/emacs>', "Force a different emacs"]]
end
@@ -21,15 +38,6 @@ class Auctex < Formula
end
def install
- unless which 'latex'
- onoe <<-EOS.undent
- AUCTeX requires a TeX/LaTeX installation; aborting now.
- You can obtain the TeX distribution for Mac OS X from
- http://www.tug.org/mactex/
- EOS
- exit 1
- end
-
# configure fails if the texmf dir is not there yet
brew_texmf = share + 'texmf'
brew_texmf.mkpath
diff --git a/Library/Formula/dbslayer.rb b/Library/Formula/dbslayer.rb
index 2b2e32cb4..dec1e3e93 100644
--- a/Library/Formula/dbslayer.rb
+++ b/Library/Formula/dbslayer.rb
@@ -1,34 +1,39 @@
require 'formula'
+class MySqlInstalled < Requirement
+ def message; <<-EOS.undent
+ MySQL is required to install.
+
+ You can install this with Homebrew using:
+ brew install mysql-connector-c
+ For MySQL client libraries only.
+
+ brew install mysql
+ For MySQL server.
+
+ Or you can use an official installer from:
+ http://dev.mysql.com/downloads/mysql/
+ EOS
+ end
+ def satisfied?
+ which 'mysql_config'
+ end
+ def fatal?
+ true
+ end
+end
+
class Dbslayer < Formula
homepage 'http://code.nytimes.com/projects/dbslayer/wiki'
url 'http://code.nytimes.com/downloads/dbslayer-beta-12.tgz'
version '0.12.b'
md5 'a529ea503c244d723166f78c75df3bb3'
- def install
- unless which 'mysql_config'
- opoo "No MySQL client library detected"
- puts "This formula may fail to build, see caveats for more information."
- end
+ depends_on MySqlInstalled.new
+ def install
system "./configure", "--prefix=#{prefix}"
system "make"
system "make install"
end
-
- def caveats; <<-EOS.undent
- DBSlayer depends on a MySQL client library.
-
- You can install this with Homebrew using:
- brew install mysql
- For MySQL server.
-
- brew install mysql-connector-c
- For MySQL client libraries only.
-
- We don't install these for you when you install this formula, as
- we don't know which datasource you intend to use.
- EOS
- end
end
diff --git a/Library/Formula/git-hg.rb b/Library/Formula/git-hg.rb
index 153062fee..fac0be430 100644
--- a/Library/Formula/git-hg.rb
+++ b/Library/Formula/git-hg.rb
@@ -1,16 +1,28 @@
require 'formula'
+class HgInstalled < Requirement
+ def message; <<-EOS.undent
+ Mercurial is required to use this software.
+
+ You can install this with Homebrew using:
+ brew install mercurial
+
+ Or you can use an official installer from:
+ http://mercurial.selenic.com/
+ EOS
+ end
+ def satisfied?
+ which 'hg'
+ end
+end
+
class GitHg < Formula
head 'https://github.com/offbytwo/git-hg.git'
homepage 'http://offbytwo.com/git-hg/'
- def install
- unless which 'hg'
- puts "You may need to install Mercurial before using this software:"
- puts " brew install mercurial"
- end
+ depends_on HgInstalled.new
+ def install
prefix.install Dir['*']
end
end
-
diff --git a/Library/Formula/jstalk.rb b/Library/Formula/jstalk.rb
index d13cd3919..65af1eeea 100644
--- a/Library/Formula/jstalk.rb
+++ b/Library/Formula/jstalk.rb
@@ -1,21 +1,25 @@
require 'formula'
+class NeedsSnowLeopard < Requirement
+ def satisfied?
+ MacOS.snow_leopard?
+ end
+
+ def message
+ "jstalk requires Mac OS X 10.6 or newer"
+ end
+end
+
class Jstalk < Formula
- url 'https://github.com/ccgus/jstalk.git', :tag => "v1.0.1"
homepage 'http://jstalk.org/'
+ url 'https://github.com/ccgus/jstalk.git', :tag => "v1.0.1"
version '1.0.1'
- def install
- if MacOS.leopard?
- onoe "jstalk requires Mac OS X 10.6+"
- exit 1
- end
+ depends_on NeedsSnowLeopard.new
- args = ["-configuration", "Release", "ONLY_ACTIVE_ARCH=YES"]
- targets = ["JSTalk Framework", "jstalk command line", "JSTalk Editor"]
-
- targets.each do |target|
- system "xcodebuild", "-target", target, *args
+ def install
+ ["JSTalk Framework", "jstalk command line", "JSTalk Editor"].each do |t|
+ system "xcodebuild", "-target", t, "-configuration", "Release", "ONLY_ACTIVE_ARCH=YES"
end
cd 'build/Release' do
diff --git a/Library/Formula/lilypond.rb b/Library/Formula/lilypond.rb
index bbc78b119..22f466c81 100644
--- a/Library/Formula/lilypond.rb
+++ b/Library/Formula/lilypond.rb
@@ -1,10 +1,26 @@
require 'formula'
+class TexInstalled < Requirement
+ def message; <<-EOS.undent
+ A TeX/LaTeX installation is required to install.
+ You can obtain the TeX distribution for Mac OS X from:
+ http://www.tug.org/mactex/
+ EOS
+ end
+ def satisfied?
+ which 'mpost'
+ end
+ def fatal?
+ true
+ end
+end
+
class Lilypond < Formula
- url 'http://download.linuxaudio.org/lilypond/sources/v2.14/lilypond-2.14.2.tar.gz'
homepage 'http://lilypond.org/'
+ url 'http://download.linuxaudio.org/lilypond/sources/v2.14/lilypond-2.14.2.tar.gz'
md5 '4053a19e03181021893981280feb9aaa'
+ depends_on TexInstalled.new
depends_on 'pkg-config' => :build
depends_on 'gettext'
depends_on 'pango'
@@ -17,8 +33,6 @@ class Lilypond < Formula
skip_clean :all
def install
- abort caveats unless which "mpost"
-
gs = Formula.factory('ghostscript')
system "./configure", "--prefix=#{prefix}",
"--with-ncsb-dir=#{gs.share}/ghostscript/fonts/"
@@ -27,10 +41,4 @@ class Lilypond < Formula
system "make"
system "make install"
end
-
- def caveats; <<-EOS.undent
- Lilypond requires a version of TeX, such as TeX Live or MacTeX, prior to installing.
- Available at: http://www.tug.org/mactex/
- EOS
- end
end
diff --git a/Library/Formula/mydumper.rb b/Library/Formula/mydumper.rb
index 5e897c051..0e3d9f7af 100644
--- a/Library/Formula/mydumper.rb
+++ b/Library/Formula/mydumper.rb
@@ -1,25 +1,40 @@
require 'formula'
+class MySqlInstalled < Requirement
+ def message; <<-EOS.undent
+ MySQL is required to install.
+
+ You can install this with Homebrew using:
+ brew install mysql-connector-c
+ For MySQL client libraries only.
+
+ brew install mysql
+ For MySQL server.
+
+ Or you can use an official installer from:
+ http://dev.mysql.com/downloads/mysql/
+ EOS
+ end
+ def satisfied?
+ which 'mysql_config'
+ end
+ def fatal?
+ true
+ end
+end
+
class Mydumper < Formula
homepage 'http://www.mydumper.org/'
url 'http://launchpadlibrarian.net/77098505/mydumper-0.5.1.tar.gz'
md5 'b4df42dfe23f308ab13eb6ecb73a0d21'
+ depends_on MySqlInstalled.new
depends_on 'pkg-config' => :build
depends_on 'cmake' => :build
depends_on 'glib'
depends_on 'pcre'
def install
- unless which 'mysql_config'
- opoo "`mysql_config` was not found"
- puts "This software requires the MySQL client libraries."
- puts "You can install them via Homebrew with one of these:"
- puts " brew install mysql-connector-c"
- puts " brew install mysql [--client-only]"
- puts "Without the client libraries, this formula will fail to compile."
- end
-
system "cmake #{std_cmake_parameters} ."
system "make install"
end
diff --git a/Library/Formula/mysql-proxy.rb b/Library/Formula/mysql-proxy.rb
index eadffe616..29b6720a4 100644
--- a/Library/Formula/mysql-proxy.rb
+++ b/Library/Formula/mysql-proxy.rb
@@ -1,25 +1,40 @@
require 'formula'
+class MySqlInstalled < Requirement
+ def message; <<-EOS.undent
+ MySQL is required to install.
+
+ You can install this with Homebrew using:
+ brew install mysql-connector-c
+ For MySQL client libraries only.
+
+ brew install mysql
+ For MySQL server.
+
+ Or you can use an official installer from:
+ http://dev.mysql.com/downloads/mysql/
+ EOS
+ end
+ def satisfied?
+ which 'mysql_config'
+ end
+ def fatal?
+ true
+ end
+end
+
class MysqlProxy < Formula
url 'http://launchpad.net/mysql-proxy/0.8/0.8.0/+download/mysql-proxy-0.8.0.tar.gz'
homepage 'https://launchpad.net/mysql-proxy'
md5 'b6a9748d72e8db7fe3789fbdd60ff451'
+ depends_on MySqlInstalled.new
depends_on 'pkg-config' => :build
depends_on 'glib'
depends_on 'libevent'
depends_on 'lua'
def install
- unless which 'mysql_config'
- opoo "`mysql_config` was not found"
- puts "This software requires the MySQL client libraries."
- puts "You can install them via Homebrew with one of these:"
- puts " brew install mysql-connector-c"
- puts " brew install mysql [--client-only]"
- puts "Without the client libraries, this formula will fail to compile."
- end
-
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
# Ugh, don't dump these directly into /usr/local/include.
diff --git a/Library/Formula/pg_top.rb b/Library/Formula/pg_top.rb
index 4d88b1ed4..f5cdbd5aa 100644
--- a/Library/Formula/pg_top.rb
+++ b/Library/Formula/pg_top.rb
@@ -1,23 +1,33 @@
require 'formula'
+class PostgresqlInstalled < Requirement
+ def message; <<-EOS.undent
+ PostgresQL is required to install.
+
+ You can install this with:
+ brew install postgresql
+
+ Or you can use an official installer from:
+ http://www.postgresql.org/
+ EOS
+ end
+ def satisfied?
+ which 'pg_config'
+ end
+ def fatal?
+ true
+ end
+end
+
+
class PgTop < Formula
homepage 'http://ptop.projects.postgresql.org/'
url 'http://pgfoundry.org/frs/download.php/1781/pg_top-3.6.2.tar.gz'
md5 '12ddb50cf83e3027d182a1381d388f1d'
- def install
- unless which 'pg_config'
- opoo "No pg_config was detected."
- puts <<-EOS.undent
- pg_top requires postgresql in order to compile, but pg_config was not
- found. This install will likely fail.
-
- You can install this with:
- brew install postgresql
- or by using a package installer from the PostgreSQL project itself.
- EOS
- end
+ depends_on PostgresqlInstalled.new
+ def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make install"
diff --git a/Library/Formula/pgtap.rb b/Library/Formula/pgtap.rb
index 16415304a..fc5149253 100644
--- a/Library/Formula/pgtap.rb
+++ b/Library/Formula/pgtap.rb
@@ -1,25 +1,32 @@
require 'formula'
+class PostgresqlInstalled < Requirement
+ def message; <<-EOS.undent
+ PostgresQL is required to install.
+
+ You can install this with:
+ brew install postgresql
+
+ Or you can use an official installer from:
+ http://www.postgresql.org/
+ EOS
+ end
+ def satisfied?
+ which 'pg_config'
+ end
+ def fatal?
+ true
+ end
+end
+
class Pgtap < Formula
url 'http://pgfoundry.org/frs/download.php/2701/pgtap-0.24.tar.bz2'
homepage 'http://pgtap.org'
md5 '9d0360c87fca0ddf3ca9da49b9b71947'
- skip_clean :all
+ depends_on PostgresqlInstalled.new
def install
- unless which 'pg_config'
- opoo "No pg_config was detected."
- puts <<-EOS.undent
- pg_top requires postgresql in order to compile, but pg_config was not
- found. This install will likely fail.
-
- You can install this with:
- brew install postgresql
- or by using a package installer from the PostgreSQL project itself.
- EOS
- end
-
system "make install"
bin.install %w(bbin/pg_prove bbin/pg_tapgen)
end
diff --git a/Library/Formula/skytools.rb b/Library/Formula/skytools.rb
index 34572dec5..e8ab6f41f 100644
--- a/Library/Formula/skytools.rb
+++ b/Library/Formula/skytools.rb
@@ -1,23 +1,32 @@
require 'formula'
+class PostgresqlInstalled < Requirement
+ def message; <<-EOS.undent
+ PostgresQL is required to install.
+
+ You can install this with:
+ brew install postgresql
+
+ Or you can use an official installer from:
+ http://www.postgresql.org/
+ EOS
+ end
+ def satisfied?
+ which 'pg_config'
+ end
+ def fatal?
+ true
+ end
+end
+
class Skytools < Formula
homepage 'http://pgfoundry.org/projects/skytools/'
url 'http://pgfoundry.org/frs/download.php/2872/skytools-2.1.12.tar.gz'
md5 '94f3391d5b3c3ac6c2edcbfbda705573'
- def install
- unless which 'pg_config'
- opoo "No pg_config was detected."
- puts <<-EOS.undent
- pg_top requires postgresql in order to compile, but pg_config was not
- found. This install will likely fail.
-
- You can install this with:
- brew install postgresql
- or by using a package installer from the PostgreSQL project itself.
- EOS
- end
+ depends_on PostgresqlInstalled.new
+ def install
system "./configure", "--prefix=#{prefix}"
system "make"
system "make install"