Macports without root on Leopard (and Tiger)

Posted by Peter Burkholder Mon, 11 Aug 2008 18:02:00 GMT

I don’t have root on my desktop Mac at $WORK, even though I have root on about 1200 production systems. sigh

So, I asked my Mac administrator to install the XCode development tools. Once that was done, all I needed to was the following.

  • Download the MacPort.tar.bz source distribution: http://svn.macports.org/repository/macports/downloads/MacPorts-1.6.0/MacPorts-1.6.0.tar.bz2
  • Note: For Leopard, one needs to apply the patch from http://trac.macports.org/changeset/32105
  • Run the following:
    
      tar -jxf MacPorts-1.6.0.tar.bz2 && cd MacPorts-1.6.0
    
      PATH=/usr/bin:/usr/sbin:/bin:/sbin ./configure \
      --prefix=$HOME/macports \
      --with-install-user=`id -un` \
      --with-install-group=`id -gn` \
      --x-includes=/usr/X11R6/include \
      --x-libraries=/usr/X11R6/lib \
      --with-tclpackage=$HOME/macports/share/macports/Tcl
    
      make
      make install
    
    
  • Add something like the following to your Mac’s .bashrc>
    
      export PATH=$HOME/macports/bin:$HOME/macports/sbin
      export MANPATH=$HOME/macports/share/man:$MANPATH
      export PERL5LIB=$HOME/macports/lib/perl5/5.8.8:$HOME/macports/lib/perl5/vendor_perl/5.8.8:$PERL5LIB
    
  • Run a selfupdate: port selfupdate
  • Now you do can do cool things like learn Scheme over lunch with: port search scheme; port install mzscheme

I’ve added this to the MacPorts wiki