aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-06-16 12:22:06 -0700
committerAdam Vandenberg2010-06-16 12:22:06 -0700
commit3eaa73a26d48502eea2ff313c00135c9bec7de3a (patch)
treeff354565b37c25825f8fba90ba4ee6a01697d094 /Library
parentc5d56bc501664b5a159b60e86672fcdda5c19d27 (diff)
downloadhomebrew-3eaa73a26d48502eea2ff313c00135c9bec7de3a.tar.bz2
Subversion: enable perl bindings
"brew install subversion --perl" will now also build new Perl bindings. Fixes #1526
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/subversion.rb24
1 files changed, 22 insertions, 2 deletions
diff --git a/Library/Formula/subversion.rb b/Library/Formula/subversion.rb
index a1b332e83..55fae9067 100644
--- a/Library/Formula/subversion.rb
+++ b/Library/Formula/subversion.rb
@@ -1,7 +1,8 @@
require 'formula'
-def build_python?; ARGV.include? "--python"; end
def build_java?; ARGV.include? "--java"; end
+def build_perl?; ARGV.include? "--perl"; end
+def build_python?; ARGV.include? "--python"; end
def build_universal?; ARGV.include? '--universal'; end
# On 10.5 we need newer versions of apr, neon etc.
@@ -24,6 +25,7 @@ class Subversion <Formula
def options
[
['--java', 'Build Java bindings.'],
+ ['--perl', 'Build Perl bindings.'],
['--python', 'Build Python bindings.'],
['--universal', 'Build as a Universal Intel binary.']
]
@@ -86,6 +88,23 @@ class Subversion <Formula
system "make install-swig-py"
end
+ if build_perl?
+ # Remove hard-coded ppc target, add appropriate ones
+ if build_universal?
+ arches = "-arch x86_64 -arch i386"
+ elsif MACOS_VERSION < 10.6
+ arches = "-arch i386"
+ else
+ arches = "-arch x86_64"
+ end
+
+ inreplace "Makefile" do |s|
+ s.change_make_var! "SWIG_PL_INCLUDES", "$(SWIG_INCLUDES) #{arches} -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include -I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE"
+ end
+ system "make swig-pl"
+ system "make install-swig-pl"
+ end
+
if build_java?
ENV.j1 # This build isn't parallel safe
system "make javahl"
@@ -111,6 +130,7 @@ class Subversion <Formula
EOS
end
- return s
+
+ return s.empty? ? nil : s
end
end