Skip to content

Commit

Permalink
subversion: use new dsl
Browse files Browse the repository at this point in the history
  • Loading branch information
adamv committed Aug 25, 2012
1 parent 4be8b4a commit 2f9a14b
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions Library/Formula/subversion.rb
@@ -1,10 +1,10 @@
require 'formula'

def build_java?; ARGV.include? "--java"; end
def build_perl?; ARGV.include? "--perl"; end
def build_python?; ARGV.include? "--python"; end
def build_ruby?; ARGV.include? "--ruby"; end
def with_unicode_path?; ARGV.include? "--unicode-path"; end
def build_java?; build.include? "java"; end
def build_perl?; build.include? "perl"; end
def build_python?; build.include? "python"; end
def build_ruby?; build.include? "ruby"; end
def with_unicode_path?; build.include? "unicode-path"; end

class UniversalNeon < Requirement
def message; <<-EOS.undent
Expand Down Expand Up @@ -62,6 +62,13 @@ class Subversion < Formula
url 'http://www.apache.org/dyn/closer.cgi?path=subversion/subversion-1.7.6.tar.bz2'
sha1 '5b76a9f49e2c4bf064041a7d6b1bfcc3aa4ed068'

option :universal
option 'java', 'Build Java bindings'
option 'perl', 'Build Perl bindings'
option 'python', 'Build Python bindings'
option 'ruby', 'Build Ruby bindings'
option 'unicode-path', 'Include support for OS X UTF-8-MAC filename'

depends_on 'pkg-config' => :build

# If Subversion can use the Lion versions of these, please
Expand All @@ -71,7 +78,7 @@ class Subversion < Formula
depends_on 'sqlite'
depends_on 'serf'

if ARGV.build_universal?
if build.universal?
depends_on UniversalNeon.new
depends_on UniversalSqlite.new
depends_on UniversalSerf.new
Expand All @@ -80,17 +87,6 @@ class Subversion < Formula
# Building Ruby bindings requires libtool
depends_on :libtool if build_ruby?

def options
[
['--java', 'Build Java bindings.'],
['--perl', 'Build Perl bindings.'],
['--python', 'Build Python bindings.'],
['--ruby', 'Build Ruby bindings.'],
['--universal', 'Build as a Universal Intel binary.'],
['--unicode-path', 'Include support for OS X UTF-8-MAC filename'],
]
end

def patches
ps = []

Expand Down Expand Up @@ -119,7 +115,7 @@ def patches

def install
if build_java?
unless ARGV.build_universal?
unless build.universal?
opoo "A non-Universal Java build was requested."
puts "To use Java bindings with various Java IDEs, you might need a universal build:"
puts " brew install subversion --universal --java"
Expand All @@ -130,7 +126,7 @@ def install
end
end

ENV.universal_binary if ARGV.build_universal?
ENV.universal_binary if build.universal?

# Use existing system zlib
# Use dep-provided other libraries
Expand Down Expand Up @@ -167,7 +163,7 @@ def install
if build_perl?
ENV.j1 # This build isn't parallel safe
# Remove hard-coded ppc target, add appropriate ones
if ARGV.build_universal?
if build.universal?
arches = "-arch x86_64 -arch i386"
elsif MacOS.leopard?
arches = "-arch i386"
Expand Down

0 comments on commit 2f9a14b

Please sign in to comment.