[wiki:howto <- Back to the HOWTO section] = How to run MacPorts from the subversion trunk = * Audience: Anyone who wants to test the latest features or not wait for an official release * Requires: Subversion (easy with 10.5, tricky with 10.4 since that creates a circular dependency) == Introduction == There are times when some may want to run MacPorts from a version newer than the current stable release. Maybe there's a new feature that you'd like to use, or it fixes an issue you've encountered, or you just like to be on the cutting edge. This explains how to run completely from trunk, using only Subversion to keep MacPorts up to date. == Installation == === Step 1: '''Check out MacPorts trunk''' === Pick a location to store a working copy of the MacPorts code. For this HOWTO {{{/opt/mports}}} will be used (change to suit). Run: {{{ mkdir -p /opt/mports cd /opt/mports svn co http://svn.macports.org/repository/macports/trunk }}} This will create {{{/opt/mports/trunk}}} containing everything needed for MacPorts. === Step 2: '''Build and Install MacPorts''' === Build and install MacPorts: {{{ cd /opt/mports/trunk/base ./configure --enable-readline make sudo make install make distclean }}} This will configure, build, and install MacPorts to the standard {{{/opt/local}}} location. == Configuration == === Step 3: '''Configure MacPorts to use port information from subversion''' === Open {{{/opt/local/etc/macports/sources.conf}}} in a text editor. The last line which should look like this: {{{ rsync://rsync.macports.org/release/ports/ }}} Change it to point to the working copy you checked out: {{{ file:///opt/mports/trunk/dports }}} Now MacPorts will look for portfiles in the working copy. === Step 4: '''Update PATH''' === Edit your {{{.profile}}} (or {{{.tcshrc}}}, or whatever is appropriate for you) to put {{{/opt/local/bin}}} and {{{/opt/local/sbin}}} in your PATH (and don't forget, if using bash, to {{{export $PATH}}} too). Whether you put this at the beginning or end of the PATH is your choice. More detailed instructions are in [http://guide.macports.org/#installing.shell The MacPorts Guide] == Keeping Up to Date == === '''Subversion update''' === MacPorts has two commands used to keep itself current: {{{sync}}}, used to update the ports tree, and {{{selfupdate}}}, to update the MacPorts base code. When compiling MacPorts yourself instead of using a released MacPorts package, you can continue to use {{{sync}}} to update the ports tree, or you can update the working copy manually like this: {{{ svn update /opt/mports/trunk }}} You should not use {{{selfupdate}}} anymore because it would downgrade you to the latest released version of MacPorts. Instead you should {{{svn update}}} as above and then repeat the steps listed in step 2 above. == Using MacPorts == At this point, most things should work like they do for anyone else; you will encounter some newer functionality that hasn't found its way to a release yet, and occasionally a bug. If so, be sure to [http://trac.macports.org/newticket report the bug] when it happens. == Typical Problems == ==== The tcl command {{{cd}}} has been removed in trunk. ==== When you try to install a port which still uses it you get an error message which says: {{{ Error: Target org.macports.destroot returned: invalid command name "cd" Warning: the following items did not execute (for [PORTNAME]): org.macports.activate org.macports.destroot org.macports.install Error: Status 1 encountered during processing. }}} It was never really intended to be used in portfiles, and it got removed because the side-effects of using it can be confusing. See #12914 for more details and Ryan Schmidt's explanation on the dev list [http://lists.macosforge.org/pipermail/macports-dev/2008-July/005652.html in this mail]. If you encounter this problem with a port, please file a bug against this port which still uses {{{cd}}}. [wiki:howto <- Back to the HOWTO section]