Thursday, December 5, 2013

Install SVN on Mac OS X - AGAIN!! (this time on MAVERICKS)



Install SVN on Mavericks








After the upgrade to Mavericks, I lost my dav_svn_module which is no longer present in the Apple Apache distribution.

To solve this problem, I need to compile subversion from the sources with:

curl 'http://archive.apache.org/dist/subversion/subversion-1.6.23.tar.bz2' > ~/Downloads/subversion-1.6.23.tar.bz2
cd ~/Downloads
bunzip2 subversion-1.6.23.tar.bz2
tar -xf subversion-1.6.23.tar
cd subversion-1.6.23
./configure
make
sudo cp subversion/mod_dav_svn/.libs/mod_dav_svn.so /usr/libexec/apache2/.
sudo cp subversion/mod_authz_svn/.libs/mod_authz_svn.so /usr/libexec/apache2/.

, but trying to do it failed at "./configure" with this errors:

for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.

Solution:

- Install last XCode version from Apple store and run it once to accept the license.
- Make this symlink:

ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain


After that I got:

configure: error: failed to recognize APR_INT64_T_FMT on this platform

Solution:

- Install command line tools running the following command in the terminal:

$ xcode-select --install

This will install the command line tools without the need to sign an Apple Developer Account (ADC).

After compiling and copying the modules to the rigth place you can add the load directive with:

echo "LoadModule dav_svn_module libexec/apache2/mod_dav_svn.so" >> /etc/apache2/httpd.conf
echo "LoadModule dav_svn_module libexec/apache2/mod_authz_svn.so" >> /etc/apache2/httpd.conf

to your httpd.conf file.

To be able to load the module I needed to ad this symlinks:

sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_repos-1.0.dylib /usr/local/lib/libsvn_repos-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_fs-1.0.dylib /usr/local/lib/libsvn_fs-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_fs_fs-1.0.dylib /usr/local/lib/libsvn_fs_fs-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_fs_util-1.0.dylib /usr/local/lib/libsvn_fs_util-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_delta-1.0.dylib /usr/local/lib/libsvn_delta-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_subr-1.0.dylib /usr/local/lib/libsvn_subr-1.0.dylib

# Optional ?
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_wc-1.0.dylib /usr/local/lib/libsvn_wc-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_client-1.0.dylib /usr/local/lib/libsvn_client-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_diff-1.0.dylib /usr/local/lib/libsvn_diff-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra-1.0.dylib /usr/local/lib/libsvn_ra-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra_local-1.0.dylib /usr/local/lib/libsvn_ra_local-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra_neon-1.0.dylib /usr/local/lib/libsvn_ra_neon-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra_serf-1.0.dylib /usr/local/lib/libsvn_ra_serf-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra_svn-1.0.dylib /usr/local/lib/libsvn_ra_svn-1.0.dylib



Also, the “Web Sharing” option from System Preferences is gone. So here’s a replacement System Preferences pane you can install that lets you manage Apache just like before. Enjoy.

5 comments:

  1. Thank you for the xcode-select solution!

    ReplyDelete
  2. This Mavericks is a pain in the balls

    ReplyDelete
  3. Sorry, followed all your steps but I can't find the resulting mod_dav_svn.so and mod_authz_svn.so, where are those files placed ?

    ReplyDelete
    Replies
    1. Sorry again but worked perfectly!, missed the "make" command, THANK YOU VERY MUCH!!

      Delete
  4. I've tried building mod_authz_svn.so and mod_dav_svn.so various ways, including those shown above, and I still can't get past some annoying version compatibility issues, like this:

    httpd: Syntax error on line 527 of /private/etc/apache2/httpd.conf: Syntax error on line 3 of /private/etc/apache2/other/svn.conf: Cannot load /usr/libexec/apache2/mod_dav_svn.so into server: dlopen(/usr/libexec/apache2/mod_dav_svn.so, 10): Library not loaded: /opt/local/lib/libapr-1.0.dylib\n Referenced from: /usr/libexec/apache2/mod_dav_svn.so\n Reason: Incompatible library version: mod_dav_svn.so requires version 6.0.0 or later, but libapr-1.0.dylib provides version 5.0.0

    I can't figure out either how to get these various .dylibs up-to-date, or how to build the Apache modules so they only require the currently available .dylibs.

    What's also weird is that the error message is complaining about the lib found in /opt/local/lib/, but by messing around with temporarily renaming files (libapr-1.0.dylib -> libapr-1.0.dylibx), only when I changed the file name in /usr/lib did the error message change to "image not found" rather than a version issue. Despite the error message, it looks like what I have in /usr/lib/ matters more than what I have in /opt/local/lib/.

    ReplyDelete