From 06031e61e3fd2ebbbb76f1a8ed4e539d4e5a8fac Mon Sep 17 00:00:00 2001 From: Andrew Neitsch Date: Fri, 24 Jan 2014 22:34:02 -0700 Subject: [PATCH 1/4] subversion: make python bindings build on 10.9. Need to filter out CPPFLAGS that confuse swig, see #23993. --- Library/Formula/subversion.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Library/Formula/subversion.rb b/Library/Formula/subversion.rb index 68a868ffb1b0..66c3c1cc48b0 100644 --- a/Library/Formula/subversion.rb +++ b/Library/Formula/subversion.rb @@ -43,7 +43,9 @@ 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. Fix python bindings compile on 10.9 + # http://subversion.tigris.org/issues/show_bug.cgi?id=4465 def patches { :p0 => DATA } end @@ -255,3 +257,14 @@ def caveats " -I$swig_srcdir/perl/libsvn_swig_perl", " -I$svnlib_srcdir/include", +--- build.conf 2014-01-24 19:55:04.000000000 -0700 ++++ build.conf.orig 2014-01-24 19:53:58.000000000 -0700 +@@ -71,7 +71,7 @@ + + bdb-test-scripts = + +-swig-python-opts = $(CPPFLAGS) -python -classic ++swig-python-opts = $(filter-out -F/% -isystem/%,$(CPPFLAGS)) -python -classic + swig-perl-opts = $(CPPFLAGS) -perl -nopm -noproxy + swig-ruby-opts = $(CPPFLAGS) -ruby + swig-languages = python perl ruby From 1fd87b55f52156a604d6baa9b559c60df2e97b26 Mon Sep 17 00:00:00 2001 From: Andrew Neitsch Date: Sun, 26 Jan 2014 08:43:51 -0700 Subject: [PATCH 2/4] Revert "subversion: make python bindings build on 10.9." Based on feedback from the subversion issue tracker, will backport r1535610 instead. This reverts commit 06031e61e3fd2ebbbb76f1a8ed4e539d4e5a8fac. --- Library/Formula/subversion.rb | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/Library/Formula/subversion.rb b/Library/Formula/subversion.rb index 66c3c1cc48b0..68a868ffb1b0 100644 --- a/Library/Formula/subversion.rb +++ b/Library/Formula/subversion.rb @@ -43,9 +43,7 @@ class Subversion < Formula # If building bindings, allow non-system interpreters env :userpaths if build.include? 'perl' or build.include? 'ruby' - # 1. Prevent '-arch ppc' from being pulled in from Perl's $Config{ccflags} - # 2. Fix python bindings compile on 10.9 - # http://subversion.tigris.org/issues/show_bug.cgi?id=4465 + # Prevent '-arch ppc' from being pulled in from Perl's $Config{ccflags} def patches { :p0 => DATA } end @@ -257,14 +255,3 @@ def caveats " -I$swig_srcdir/perl/libsvn_swig_perl", " -I$svnlib_srcdir/include", ---- build.conf 2014-01-24 19:55:04.000000000 -0700 -+++ build.conf.orig 2014-01-24 19:53:58.000000000 -0700 -@@ -71,7 +71,7 @@ - - bdb-test-scripts = - --swig-python-opts = $(CPPFLAGS) -python -classic -+swig-python-opts = $(filter-out -F/% -isystem/%,$(CPPFLAGS)) -python -classic - swig-perl-opts = $(CPPFLAGS) -perl -nopm -noproxy - swig-ruby-opts = $(CPPFLAGS) -ruby - swig-languages = python perl ruby From bc9f1efe884979675cb9ab49771556f0095ede4d Mon Sep 17 00:00:00 2001 From: Andrew Neitsch Date: Sun, 26 Jan 2014 09:57:20 -0700 Subject: [PATCH 3/4] subversion: make perl/ruby/python bindings build. Need to filter out CPPFLAGS that confuse swig, see #23993. --- Library/Formula/subversion.rb | 109 +++++++++++++++++++++++++++++++++- 1 file changed, 108 insertions(+), 1 deletion(-) diff --git a/Library/Formula/subversion.rb b/Library/Formula/subversion.rb index 68a868ffb1b0..076b8611eb9b 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 @@ -149,6 +152,11 @@ def install system "make tools" system "make install-tools" + # Swig don't understand "-isystem" flags added by Homebrew, so + # filter them out. + #inreplace buildpath/"build-outputs.mk", /SWIG_CPPFLAGS/, + # "$(filter-out -F/% -isystem/%,$(SWIG_CPPFLAGS))" + if build.with? 'python' system "make swig-py" system "make install-swig-py" @@ -235,6 +243,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 @@ @@ -255,3 +266,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 '/' + From 90533ded528e528146936caa0ad42f074da2d106 Mon Sep 17 00:00:00 2001 From: Andrew Neitsch Date: Sun, 26 Jan 2014 10:33:39 -0700 Subject: [PATCH 4/4] Remove spurious commented-out code. --- Library/Formula/subversion.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Library/Formula/subversion.rb b/Library/Formula/subversion.rb index 076b8611eb9b..d643d106c312 100644 --- a/Library/Formula/subversion.rb +++ b/Library/Formula/subversion.rb @@ -152,11 +152,6 @@ def install system "make tools" system "make install-tools" - # Swig don't understand "-isystem" flags added by Homebrew, so - # filter them out. - #inreplace buildpath/"build-outputs.mk", /SWIG_CPPFLAGS/, - # "$(filter-out -F/% -isystem/%,$(SWIG_CPPFLAGS))" - if build.with? 'python' system "make swig-py" system "make install-swig-py"