Posted on November 21, 2008 at 9:56pm EST. More.

Show Xcode where to find Subversion 1.5

I installed Subversion 1.5 using MacPorts (with the Porticus front-end), which places libraries in /opt/local/lib by default.  Xcode 3.1.1 supports Subversion 1.5, but it only looks in /usr/lib, so even though I have Subversion 1.5 installed, it claims my working copies are incompatible.  How did I fix this?

  1. sudo -s
  2. cd /usr/lib
  3. tar cvf oldapr+svnlib.tar libapr* libsvn*
  4. bzip2 oldapr+svnlib.tar
  5. rm libapr* libsvn*
  6. cd /opt/local/lib
  7. for NAME in libapr*.dylib; do ln -s /opt/local/lib/$NAME /usr/lib/$NAME; done
  8. for NAME in libsvn*.dylib; do ln -s /opt/local/lib/$NAME /usr/lib/$NAME; done
  9. exit
Lines 3-4 generate a backup archive.  In case something goes wrong, you can delete the libapr* and libsvn* files from /usr/lib and unpack oldapr+svnlib.tar.bz2 to go back to the way things were.
Line 5 removes the existing subversion libraries and lines 6-8 put symlinks in /usr/lib that point to /opt/local/lib.  Note that the set of libraries may not match exactly.  (In my case, some libraries for Python and Ruby bindings didn’t appear in /opt/local/lib.)  However, I figure it’s better to keep the set consistent than to piece together possibly incompatible parts.