Use new Requirements in formulae

master
Adam Vandenberg 2012-02-29 20:36:21 -08:00
parent 69ae4e1732
commit 5e982a68a8
11 changed files with 221 additions and 120 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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'
depends_on NeedsSnowLeopard.new
def install
if MacOS.leopard?
onoe "jstalk requires Mac OS X 10.6+"
exit 1
end
args = ["-configuration", "Release", "ONLY_ACTIVE_ARCH=YES"]
targets = ["JSTalk Framework", "jstalk command line", "JSTalk Editor"]
targets.each do |target|
system "xcodebuild", "-target", target, *args
["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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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'
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 "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make install"

View File

@ -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

View File

@ -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'
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 "./configure", "--prefix=#{prefix}"
system "make"
system "make install"