aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2013-10-30 12:14:09 -0700
committerMike McQuaid2013-10-30 12:14:09 -0700
commitae5714a406a3b04a8919ba78568b4f314aa428da (patch)
treee6bf566c22f8612b8fe6a0e99ec8e341cfd5661f /Library
parentdf8e908706cf38455e02b0876ecf20eebbe3433f (diff)
downloadhomebrew-ae5714a406a3b04a8919ba78568b4f314aa428da.tar.bz2
subversion: use serf resource.
References #23779.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/subversion.rb31
1 files changed, 29 insertions, 2 deletions
diff --git a/Library/Formula/subversion.rb b/Library/Formula/subversion.rb
index d729dce2d..8197eb75a 100644
--- a/Library/Formula/subversion.rb
+++ b/Library/Formula/subversion.rb
@@ -13,14 +13,19 @@ class Subversion < Formula
end
option :universal
+ option 'with-brewed-openssl', 'Include OpenSSL support to Serf via Homebrew'
option 'java', 'Build Java bindings'
option 'perl', 'Build Perl bindings'
option 'ruby', 'Build Ruby bindings'
+ resource 'serf' do
+ url 'http://serf.googlecode.com/files/serf-1.3.2.tar.bz2'
+ sha1 '90478cd60d4349c07326cb9c5b720438cf9a1b5d'
+ end
+
depends_on 'pkg-config' => :build
# Always build against Homebrew versions instead of system versions for consistency.
- depends_on 'serf'
depends_on 'sqlite'
depends_on :python => :optional
@@ -31,6 +36,10 @@ class Subversion < Formula
# Bindings require swig
depends_on 'swig' if build.include? 'perl' or build.include? 'python' or build.include? 'python'
+ # For Serf
+ depends_on 'scons' => :build
+ depends_on 'openssl' if build.with? 'brewed-openssl'
+
# If building bindings, allow non-system interpreters
env :userpaths if build.include? 'perl' or build.include? 'ruby'
@@ -53,6 +62,24 @@ class Subversion < Formula
end
def install
+ serf_prefix = libexec+'serf'
+
+ resource('serf').stage do
+ # SConstruct merges in gssapi linkflags using scons's MergeFlags,
+ # but that discards duplicate values - including the duplicate
+ # values we want, like multiple -arch values for a universal build.
+ # Passing 0 as the `unique` kwarg turns this behaviour off.
+ inreplace 'SConstruct', 'unique=1', 'unique=0'
+
+ ENV.universal_binary if build.universal?
+ # scons ignores our compiler and flags unless explicitly passed
+ args = %W[PREFIX=#{serf_prefix} GSSAPI=/usr CC=#{ENV.cc}
+ CFLAGS=#{ENV.cflags} LINKFLAGS=#{ENV.ldflags}]
+ args << "OPENSSL=#{Formula.factory('openssl').opt_prefix}" if build.with? 'brewed-openssl'
+ system "scons", *args
+ system "scons install"
+ end
+
if build.include? 'unicode-path'
raise Homebrew::InstallationError.new(self, <<-EOS.undent
The --unicode-path patch is not supported on Subversion 1.8.
@@ -92,7 +119,7 @@ class Subversion < Formula
"--with-apr=#{apr_bin}",
"--with-zlib=/usr",
"--with-sqlite=#{Formula.factory('sqlite').opt_prefix}",
- "--with-serf=#{Formula.factory('serf').opt_prefix}",
+ "--with-serf=#{serf_prefix}",
"--disable-mod-activation",
"--disable-nls",
"--without-apache-libexecdir",