Using MacPorts to build from source directory

Rainer Müller raimue at macports.org
Mon Sep 13 08:49:07 PDT 2010


On 2010-09-13 16:59 , Oliver King-Smith wrote:
> It would be convenient to run MacPorts in such a fashion where it can
> just use a local directory for the source files as opposed to grabbing a
> tar ball from an http or ftp server.   This would allow me to make
> changes to source code and then rebuild more quickly.

You can run each of the individual phases [1] directly from the command
line and even edit the source files in between. You can find the work
directory using the work symlink or 'port work <portname>'.

sudo port patch
# *hackhackhack* in work/foo-1.0/
sudo port configure
sudo port build
# probably fails, so *hackhackhack* again
# finally try again
sudo port build
# repeat as needed...

A phase can be run again multiple times as long as it did not complete
successfully.

But watch out not to use 'port install' as on success it would clean and
delete the work directory; use 'port -k' to disable this. Also any
changes to the Portfile cause a clean; use 'port -o' to disable this. Of
course you are responsible to manually clean when appropriate when using
these parameters.

Rainer

[1] http://guide.macports.org/#reference.phases


More information about the macports-dev mailing list