Julio Gorgé

Setting up Subversion 1.5 on Xcode

Up until the release of the iPhone SDK for iPhone OS 2.2, Xcode 3.0 did not work with installations of Subversion 1.5+, but the latest build solves this. Alas, setting up Subversion to work with Xcode requires some extra work. To save you some precious time googling around, I have prepared a brief tutorial to guide you through the process:

Step 1. Download and install the latest iPhone SDK for iPhone OS 2.2 from the iPhone Dev Center. This includes Xcode 3.1.2.

http://developer.apple.com/iphone/

 

Step 2. Download and install the latest Subversion binaries for Mac OS X from CollabNET

http://www.collab.net/downloads/community/

 

Step 3. Copy and paste the following code into a text file (e.g. “enable-svn.sh”). You can do so with TextEdit.app, but remember to convert the document to plain text before saving it (Format/Make Plain Text).

ln -s -f /opt/subversion/lib/libapr-1.dylib /usr/lib/libapr-1.dylib
ln -s -f /opt/subversion/lib/libapr-1.dylib /usr/lib/libapr-1.0.dylib
ln -s -f /opt/subversion/lib/libaprutil-1.dylib /usr/lib/libaprutil-1.dylib
ln -s -f /opt/subversion/lib/libaprutil-1.dylib /usr/lib/libaprutil-1.0.dylib
ln -s -f /opt/subversion/lib/libsvn_client-1.dylib /usr/lib/libsvn_client-1.dylib
ln -s -f /opt/subversion/lib/libsvn_client-1.dylib /usr/lib/libsvn_client-1.0.dylib
ln -s -f /opt/subversion/lib/libsvn_delta-1.dylib /usr/lib/libsvn_diff-1.dylib
ln -s -f /opt/subversion/lib/libsvn_delta-1.dylib /usr/lib/libsvn_diff-1.0.dylib
ln -s -f /opt/subversion/lib/libsvn_fs_fs-1.dylib /usr/lib/libsvn_fs_fs-1.dylib
ln -s -f /opt/subversion/lib/libsvn_fs_fs-1.dylib /usr/lib/libsvn_fs_fs-1.0.dylib
ln -s -f /opt/subversion/lib/libsvn_fs-1.dylib /usr/lib/libsvn_fs-1.dylib
ln -s -f /opt/subversion/lib/libsvn_fs-1.dylib /usr/lib/libsvn_fs-1.0.dylib
ln -s -f /opt/subversion/lib/libsvn_ra_local-1.dylib /usr/lib/libsvn_ra_local-1.dylib
ln -s -f /opt/subversion/lib/libsvn_ra_local-1.dylib /usr/lib/libsvn_ra_local-1.0.dylib
ln -s -f /opt/subversion/lib/libsvn_ra_svn-1.dylib /usr/lib/libsvn_ra_svn-1.dylib
ln -s -f /opt/subversion/lib/libsvn_ra_svn-1.dylib /usr/lib/libsvn_ra_svn-1.0.dylib
ln -s -f /opt/subversion/lib/libsvn_ra-1.dylib /usr/lib/libsvn_ra-1.dylib
ln -s -f /opt/subversion/lib/libsvn_ra-1.dylib /usr/lib/libsvn_ra-1.0.dylib
ln -s -f /opt/subversion/lib/libsvn_wc-1.dylib /usr/lib/libsvn_wc-1.dylib
ln -s -f /opt/subversion/lib/libsvn_wc-1.dylib /usr/lib/libsvn_wc-1.0.dylib
ln -s -f /opt/subversion/lib/libsvn_repos-1.dylib /usr/lib/libsvn_repos-1.dylib
ln -s -f /opt/subversion/lib/libsvn_repos-1.dylib /usr/lib/libsvn_repos-1.0.dylib
ln -s -f /opt/subversion/lib/libsvn_subr-1.dylib /usr/lib/libsvn_subr-1.dylib
ln -s -f /opt/subversion/lib/libsvn_subr-1.dylib /usr/lib/libsvn_subr-1.0.dylib
ln -s -f /opt/subversion/lib/libsvn_delta-1.dylib /usr/lib/libsvn_delta-1.dylib
ln -s -f /opt/subversion/lib/libsvn_delta-1.dylib /usr/lib/libsvn_delta-1.0.dylib
ln -s -f /opt/subversion/lib/libsvn_diff-1.dylib /usr/lib/libsvn_diff-1.dylib
ln -s -f /opt/subversion/lib/libsvn_diff-1.dylib /usr/lib/libsvn_diff-1.0.dylib

 

Step 4. Save the previous file on your Desktop. Open a new instance of Terminal.app and then type the following commands on it:

cd Desktop  *press intro*
sudo sh enable-svn.sh  *press intro*

 

Congratulations! Xcode’s SCM feature will work now with installations of Subversion 1.5 or greater. To learn the basics about using the Subversion integration with Xcode, I recommend you read the section “Using Subversion from Xcode” on the following article:

http://developer.apple.com/mac/articles/server/subversionwithxcode3.html

14 Responses to “Setting up Subversion 1.5 on Xcode”

  1. Rusty Says:

    WOW! You completely rock. Thank you so much for this. Worked like a charm. While I can use commandline svn, its too outside my usual workflow so I never check in. That’s dumb. I’m glad you helped prevent injury due to my own stupidity. Gracias

  2. Using XCode with Subversion 1.5 | Rusty's Technology Blog Says:

    [...] http://www.lemonteam.com/blog/2008/12/setting-up-subversion-15-on-xcode/ [...]

  3. Raoul Ortega Says:

    It appears that while this may help XCode’s SCM problems, it also had the effect of breaking Apache2 so that it will no longer access http://localhost/ and also causes syslogd to run berserk.

    Seems there’s something about the libapr-1.0.dylib library that it doesn’t like:

    Dec 25 11:54:09 Boat-2 org.apache.httpd[407]: dyld: Library not loaded: /usr/lib/libapr-1.0.dylib
    Dec 25 11:54:09 Boat-2 org.apache.httpd[407]: Referenced from: /usr/sbin/httpd
    Dec 25 11:54:09 Boat-2 org.apache.httpd[407]: Reason: no suitable image found. Did find:
    Dec 25 11:54:09 Boat-2 org.apache.httpd[407]: /usr/lib/libapr-1.0.dylib: stat() failed with errno=62

    Gonna be fun trying to “unfix” this little mess.

  4. Julio Gorgé Says:

    /usr/lib/libapr-1.0.dylib: stat() failed with errno=62

    Sounds like a recursive symlink (a link pointing to itself, for instance). Try deleting /usr/lib/libapr-*, reinstalling latest svn and running the script again.

  5. David Gagnon Says:

    I have a simular problem after trying this and have tried reinstalling svn 1.5 and running the script again.

    1/10/09 10:59:26 PM org.apache.httpd[850] dyld: Symbol not found: _apr_socket_sendfile
    1/10/09 10:59:26 PM org.apache.httpd[850] Referenced from: /usr/sbin/httpd
    1/10/09 10:59:26 PM org.apache.httpd[850] Expected in: /usr/lib/libapr-1.0.dylib
    1/10/09 10:59:26 PM com.apple.launchd[121] (org.apache.httpd[850]) Exited abnormally: Trace/BPT trap
    1/10/09 10:59:26 PM com.apple.launchd[121] (org.apache.httpd) Throttling respawn: Will start in 10 seconds

  6. tewha.net » Blog Archive » Setting up Subversion 1.5 on Xcode Says:

    [...] Lemon Team’s blog » Blog Archive » Setting up Subversion 1.5 on Xcode [...]

  7. Dzamir Says:

    Thanks!! You saved me a lot of time! :D

  8. fred Says:

    these lines are unnecessary

    ln -s -f /opt/subversion/lib/libsvn_delta-1.dylib /usr/lib/libsvn_diff-1.dylib
    ln -s -f /opt/subversion/lib/libsvn_delta-1.dylib /usr/lib/libsvn_diff-1.0.dylib

  9. Robb Says:

    Thanks I was grasping at straws trying to figure out why I kept getting a hook error needing a client 1.5 even though I had 1.5. It looks like the shell script was the answer thanks a lot!!

  10. Oliver GL Says:

    To fix the “Symbol not found: _apr_socket_sendfile” problem I reverted the libapr and libaprutil links to the Apache 2.2.9 versions in /usr/lib and restarted Apache.

    I’m now able to use both the Versions svn client as well as Xcode 3.1.2 with my svn 1.5.5 repository accessed via Apache 2.2.9 (setup with basic authentication).

  11. workerbee Says:

    What does *press intro* mean?

  12. Julio Gorgé Says:

    It means, press the enter/return/intro key to enter the commands.

  13. Eknath Says:

    Thanks a lot for this post.

  14. John Says:

    @Oliver GL Thanks a lot for posting your fix!!!!! You saved me =)

    Thanks for the original post as well.

Leave a Reply