Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

subversion: make python bindings build on 10.9. #26156

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 103 additions & 1 deletion Library/Formula/subversion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ class Subversion < Formula
# If building bindings, allow non-system interpreters
env :userpaths if build.include? 'perl' or build.include? 'ruby'

# Prevent '-arch ppc' from being pulled in from Perl's $Config{ccflags}
# 1. Prevent '-arch ppc' from being pulled in from Perl's $Config{ccflags}
# 2. Backport r1535610 to help fix #23993.
# See http://subversion.tigris.org/issues/show_bug.cgi?id=4465
# 3. Fix #23993 by stripping flags swig can't handle from SWIG_CPPFLAGS
def patches
{ :p0 => DATA }
end
Expand Down Expand Up @@ -235,6 +238,9 @@ def caveats
end

__END__

Patch 1

--- subversion/bindings/swig/perl/native/Makefile.PL.in~ 2013-06-20 18:58:55.000000000 +0200
+++ subversion/bindings/swig/perl/native/Makefile.PL.in 2013-06-20 19:00:49.000000000 +0200
@@ -69,10 +69,15 @@
Expand All @@ -255,3 +261,99 @@ def caveats
" -I$swig_srcdir/perl/libsvn_swig_perl",
" -I$svnlib_srcdir/include",

Patch 2

$ svn log -v -r1535610 --diff http://svn.apache.org/repos/asf/subversion/trunk
------------------------------------------------------------------------
r1535610 | breser | 2013-10-24 20:22:50 -0600 (Thu, 24 Oct 2013) | 20 lines
Changed paths:
M /subversion/trunk/Makefile.in
M /subversion/trunk/build.conf
M /subversion/trunk/configure.ac

Filter out -no-cpp-precomp from flags passed to SWIG.

This is necessary since APR for whatever reason leaks the fact that it uses
-no-cpp-precomp on OS X into apr-1-config. Unfortunately, a lot of versions
of APR have this in the wild so we just have to deal with it. If you use clang
directly you don't see this because we already filter it out of CPPFLAGS.

* Makefile.in
(SWIG_CPPFLAGS): New variable, deliberately pulling in EXTRA_CPPFLAGS and
not EXTRA_SIWG_CPPFLAGS because it would be harmful to split those
(e.g. users wanting to enable a feature that adds an API).

* build.conf
(swig-python-opts, swig-perl-opts, swig-ruby-opts): Use SWIG_CPPFLAGS
instead of CPPFLAGS.

* configure.acc
(SWIG_CPPFLAGS): Add the variable and copy it from the normal CPPFLAGS
while filtering out the -no-cpp-precomp.


Index: Makefile.in
===================================================================
--- Makefile.in (revision 1535609)
+++ Makefile.in (revision 1535610)
@@ -181,6 +181,7 @@
CPPFLAGS = @CPPFLAGS@ $(EXTRA_CPPFLAGS)
LDFLAGS = @LDFLAGS@ $(EXTRA_LDFLAGS)
SWIG_LDFLAGS = @SWIG_LDFLAGS@ $(EXTRA_SWIG_LDFLAGS)
+SWIG_CPPFLAGS = @SWIG_CPPFLAGS@ $(EXTRA_CPPFLAGS)

COMPILE = $(CC) $(CMODEFLAGS) $(CPPFLAGS) $(CMAINTAINERFLAGS) $(CFLAGS) $(INCLUDES)
COMPILE_NOWARN = $(CC) $(CMODEFLAGS) $(CPPFLAGS) $(CNOWARNFLAGS) $(CFLAGS) $(INCLUDES)
Index: build.conf
===================================================================
--- build.conf (revision 1535609)
+++ build.conf (revision 1535610)
@@ -88,9 +88,9 @@

bdb-test-scripts =

-swig-python-opts = $(CPPFLAGS) -python -classic
-swig-perl-opts = $(CPPFLAGS) -perl -nopm -noproxy
-swig-ruby-opts = $(CPPFLAGS) -ruby
+swig-python-opts = $(SWIG_CPPFLAGS) -python -classic
+swig-perl-opts = $(SWIG_CPPFLAGS) -perl -nopm -noproxy
+swig-ruby-opts = $(SWIG_CPPFLAGS) -ruby
swig-languages = python perl ruby
swig-dirs =
subversion/bindings/swig/python
Index: configure.ac
===================================================================
--- configure.ac (revision 1535609)
+++ configure.ac (revision 1535610)
@@ -1490,6 +1490,11 @@
SVN_STRIP_FLAG(CPPFLAGS, [-no-cpp-precomp ])
fi

+# Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well.
+SWIG_CPPFLAGS="$CPPFLAGS"
+SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-no-cpp-precomp ])
+AC_SUBST([SWIG_CPPFLAGS])
+
dnl Since this is used only on Unix-y systems, define the path separator as '/'
AC_DEFINE_UNQUOTED(SVN_PATH_LOCAL_SEPARATOR, '/',
[Defined to be the path separator used on your local filesystem])

------------------------------------------------------------------------

Patch 3

diff -u configure.ac configure.ac
--- configure.ac (working copy)
+++ configure.ac (working copy)
@@ -1446,6 +1446,10 @@
# Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well.
SWIG_CPPFLAGS="$CPPFLAGS"
SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-no-cpp-precomp ])
+# Swig don't understand "-F" and "-isystem" flags added by Homebrew,
+# so filter them out.
+SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-F\/[[^ ]]* ])
+SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-isystem\/[[^ ]]* ])
AC_SUBST([SWIG_CPPFLAGS])

dnl Since this is used only on Unix-y systems, define the path separator as '/'