aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorXu Cheng2015-03-02 13:37:03 +0800
committerXu Cheng2015-03-02 15:34:04 +0800
commitf55e6cf1c73a1e58a00d972b5f069da15ce31028 (patch)
treeb460fe39beab02c56c86fdc79e15b52cff9cf214 /Library/Formula
parentad4be31673defad4a12776aff67f744b45e68978 (diff)
downloadhomebrew-f55e6cf1c73a1e58a00d972b5f069da15ce31028.tar.bz2
subversion: add depends_on :java and modernize
Closes #37309. Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/subversion.rb23
1 files changed, 10 insertions, 13 deletions
diff --git a/Library/Formula/subversion.rb b/Library/Formula/subversion.rb
index 93120ab3c..b16e7279b 100644
--- a/Library/Formula/subversion.rb
+++ b/Library/Formula/subversion.rb
@@ -33,7 +33,7 @@ class Subversion < Formula
depends_on :python => :optional
# Bindings require swig
- depends_on "swig" if build.with? "perl" or build.with? "python" or build.with? "ruby"
+ depends_on "swig" if build.with?("perl") || build.with?("python") || build.with?("ruby")
# For Serf
depends_on "scons" => :build
@@ -41,12 +41,13 @@ class Subversion < Formula
# Other optional dependencies
depends_on "gpg-agent" => :optional
+ depends_on :java => :optional
# Fix #23993 by stripping flags swig can't handle from SWIG_CPPFLAGS
# Prevent "-arch ppc" from being pulled in from Perl's $Config{ccflags}
patch :DATA
- if build.with? "perl" or build.with? "ruby"
+ if build.with?("perl") || build.with?("ruby")
# If building bindings, allow non-system interpreters
# Currently the serf -> scons dependency forces stdenv, so this isn't
# strictly necessary
@@ -87,7 +88,7 @@ class Subversion < Formula
end
if build.include? "unicode-path"
- raise <<-EOS.undent
+ fail <<-EOS.undent
The --unicode-path patch is not supported on Subversion 1.8.
Upgrading from a 1.7 version built with this patch is not supported.
@@ -110,10 +111,6 @@ class Subversion < Formula
`brew install subversion --universal --java`
EOS
end
-
- if ENV["JAVA_HOME"]
- opoo "JAVA_HOME is set. Try unsetting it if JNI headers cannot be found."
- end
end
ENV.universal_binary if build.universal?
@@ -134,13 +131,13 @@ class Subversion < Formula
args << "--enable-javahl" << "--without-jikes" if build.with? "java"
args << "--without-gpg-agent" if build.without? "gpg-agent"
- unless MacOS::CLT.installed?
+ if MacOS::CLT.installed?
+ args << "--with-apr=/usr"
+ args << "--with-apr-util=/usr"
+ else
args << "--with-apr=#{Formula["apr"].opt_prefix}"
args << "--with-apr-util=#{Formula["apr-util"].opt_prefix}"
args << "--with-apxs=no"
- else
- args << "--with-apr=/usr"
- args << "--with-apr-util=/usr"
end
if build.with? "ruby"
@@ -182,7 +179,7 @@ class Subversion < Formula
arches = "-arch #{Hardware::CPU.arch_64_bit}"
end
- perl_core = Pathname.new(`perl -MConfig -e 'print $Config{archlib}'`)+'CORE'
+ perl_core = Pathname.new(`perl -MConfig -e 'print $Config{archlib}'`)+"CORE"
unless perl_core.exist?
onoe "perl CORE directory does not exist in '#{perl_core}'"
end
@@ -248,7 +245,7 @@ class Subversion < Formula
EOS
end
- return s.empty? ? nil : s
+ s
end
end