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

Make brew install subversion --perl work. #22668

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions Library/Formula/subversion.rb
Expand Up @@ -32,6 +32,7 @@ class Subversion < Formula

# One patch to prevent '-arch ppc' from being pulled in from Perl's $Config{ccflags},
# and another one to put the svn-tools directory into libexec instead of bin
# and another one to get --perl to build http://svn.haxx.se/users/archive-2013-09/0187.shtml
def patches
{ :p0 => DATA }
end
Expand Down Expand Up @@ -120,6 +121,8 @@ def install
end

if build.include? 'perl'
# In theory SWIG can be built in parallel, in practice...
ENV.deparallelize
# Remove hard-coded ppc target, add appropriate ones
if build.universal?
arches = Hardware::CPU.universal_archs.as_arch_flags
Expand All @@ -140,6 +143,7 @@ def install
end
system "make swig-pl"
system "make", "install-swig-pl", "DESTDIR=#{prefix}"
system "mv -v #{prefix}/#{lib}/* #{lib}"
end

if build.include? 'java'
Expand Down Expand Up @@ -229,3 +233,15 @@ def caveats

javahl_javadir = @libdir@/svn-javahl
javahl_javahdir = @libdir@/svn-javahl/include
--- subversion/include/svn_auth.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you submit this patch upstream to SVN?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have sent an e-mail to the svn users list, as per the subversion bug reporting requirements. (http://subversion.apache.org/reporting-issues.html)

http://svn.haxx.se/users/archive-2013-09/0187.shtml

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a link to the report to the comment block above def patches, thanks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this won't be fixed upstream, at least not immediately. They say that the proper fix is:

make extraclean 
./autogen.sh 
./configure 
make

But I have added links to both of within the applied patches.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try their suggested fix.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried that as well, (gist) however, swig (brew installed) does not seem to like it:

==> Patching
patching file subversion/bindings/swig/perl/native/Makefile.PL.in
patching file Makefile.in
==> ./configure --prefix=/usr/local/Cellar/subversion/1.8.3 --with-apr=/usr/local/Library/ENV/4.3 --with-zlib=/usr --with-sqlite=/usr/local/opt/sqlite --with-serf=/usr/local/opt/serf --disable-mod-activation --disable-nls --without-apache-libexecdir --without-berkeley-db
==> make extraclean
==> ./autogen.sh
==> ./configure --prefix=/usr/local/Cellar/subversion/1.8.3 --with-apr=/usr/local/Library/ENV/4.3 --with-zlib=/usr --with-sqlite=/usr/local/opt/sqlite --with-serf=/usr/local/opt/serf --disable-mod-activation --disable-nls --without-apache-libexecdir --without-berkeley-db
==> make
==> make install
==> make tools
==> make install-tools
==> make swig-pl
cd . && /usr/bin/python build/generator/swig/external_runtime.py build.conf /usr/local/bin/swig perl
/usr/local/bin/swig -I/private/tmp/default-YZ6v/subversion-1.8.3/subversion -I/private/tmp/default-YZ6v/subversion-1.8.3/subversion/include -I/private/tmp/default-YZ6v/subversion-1.8.3/subversion/bindings/swig -I/private/tmp/default-YZ6v/subversion-1.8.3/subversion/bindings/swig/include -I/private/tmp/default-YZ6v/subversion-1.8.3/subversion/bindings/swig/proxy -I/private/tmp/default-YZ6v/subversion-1.8.3/subversion/bindings/swig/proxy -isystem/usr/include/apr-1 -I/usr/include/apr-1  -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK  -perl -nopm -noproxy -o subversion/bindings/swig/perl/native/core.c ./subversion/bindings/swig/core.i
swig error : Unrecognized option -isystem/usr/include/apr-1
Use 'swig -help' for available options.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue here is that -isystem/usr/include/apr-1 is valid for the C compiler, but not for SWIG, yet the same options are used for both.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds like an issue of cppflags handling in superenv, which may need to be limited to C/C++/ObjC/Obj-C++ compilers. But not sure whether there are other issues besides this one.

+++ subversion/include/svn_auth.h
@@ -966,7 +966,8 @@ svn_auth_get_keychain_ssl_client_cert_pw_provider(
apr_pool_t *pool);
#endif /* DARWIN || DOXYGEN */

-#if (!defined(DARWIN) && !defined(WIN32)) || defined(DOXYGEN)
+/* Add a condition on SWIGPERL - http://svn.haxx.se/users/archive-2013-09/0187.shtml */
+#if (!defined(DARWIN) && !defined(WIN32)) || defined(DOXYGEN) || defined(SWIGPERL)
/** A type of callback function for obtaining the GNOME Keyring password.
*
* In this callback, the client should ask the user for default keyring