diff options
| author | Andrew Neitsch | 2014-01-26 09:57:20 -0700 |
|---|---|---|
| committer | Mike McQuaid | 2014-01-27 09:20:49 +0100 |
| commit | 648a5f2c3fe969c313267e949b5ab31a9ed27cbd (patch) | |
| tree | dfb756b578a7f770e88a099c991fc49e64cf9c8a /Library | |
| parent | ad6b606e2027744209b3f2de453ad94bb9c19dd9 (diff) | |
| download | homebrew-648a5f2c3fe969c313267e949b5ab31a9ed27cbd.tar.bz2 | |
subversion: make perl/ruby/python bindings build.
Need to filter out CPPFLAGS that confuse swig, see #23993.
Fixes #23993.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/subversion.rb | 103 |
1 files changed, 102 insertions, 1 deletions
diff --git a/Library/Formula/subversion.rb b/Library/Formula/subversion.rb index 68a868ffb..6ed8b8efb 100644 --- a/Library/Formula/subversion.rb +++ b/Library/Formula/subversion.rb @@ -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 @@ -235,6 +238,9 @@ class Subversion < Formula 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 @@ @@ -255,3 +261,98 @@ __END__ " -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 '/' |
