diff options
| author | Adam Vandenberg | 2012-03-18 11:06:09 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2012-03-18 11:06:09 -0700 |
| commit | eb97154dd4cc48462a53b46654fdf2f1d37091b7 (patch) | |
| tree | 68f64e17fc114fed5580b01a08e3c0f99a0dab75 /Library | |
| parent | 0850e54f60f82413fab058e9f39ddad308df786e (diff) | |
| download | homebrew-eb97154dd4cc48462a53b46654fdf2f1d37091b7.tar.bz2 | |
sqlite: add sqlite unviersal check
Also use Requirements for these checks.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/subversion.rb | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/Library/Formula/subversion.rb b/Library/Formula/subversion.rb index 35f2a9683..f0b819389 100644 --- a/Library/Formula/subversion.rb +++ b/Library/Formula/subversion.rb @@ -5,6 +5,30 @@ def build_perl?; ARGV.include? "--perl"; end def build_python?; ARGV.include? "--python"; end def build_ruby?; ARGV.include? "--ruby"; end +class UniversalNeon < Requirement + def message; <<-EOS.undent + A universal build was requested, but neon was already built for a single arch. + You may need to `brew rm neon` first. + EOS + end + def satisfied? + f = Formula.factory('neon') + !f.installed? || archs_for_command(f.lib+'libneon.dylib').universal? + end +end + +class UniversalSqlite < Requirement + def message; <<-EOS.undent + A universal build was requested, but sqlite was already built for a single arch. + You may need to `brew rm sqlite` first. + EOS + end + def satisfied? + f = Formula.factory('sqlite') + !f.installed? || archs_for_command(f.lib+'libsqlite3.dylib').universal? + end +end + class Subversion < Formula homepage 'http://subversion.apache.org/' url 'http://www.apache.org/dyn/closer.cgi?path=subversion/subversion-1.7.3.tar.bz2' @@ -18,6 +42,11 @@ class Subversion < Formula depends_on 'neon' depends_on 'sqlite' + if ARGV.build_universal? + depends_on UniversalNeon.new + depends_on UniversalSqlite.new + end + def options [ ['--java', 'Build Java bindings.'], @@ -28,18 +57,6 @@ class Subversion < Formula ] end - def check_neon_arch - # Check that Neon was built universal if we are building w/ --universal - neon = Formula.factory('neon') - if neon.installed? - neon_arch = archs_for_command(neon.lib+'libneon.dylib') - unless neon_arch.universal? - opoo "A universal build was requested, but neon was already built for a single arch." - puts "You may need to `brew rm neon` first." - end - end - end - def install if build_java? unless ARGV.build_universal? @@ -53,10 +70,7 @@ class Subversion < Formula end end - if ARGV.build_universal? - ENV.universal_binary - check_neon_arch - end + ENV.universal_binary if ARGV.build_universal? # Use existing system zlib # Use dep-provided other libraries |
