# DarwinPorts FAQ

Jordan
Hubbard

    jkh@opendarwin.org

Will
Barton

    wbb4@opendarwin.org

2002
2003
2004
The OpenDarwin Project

The DarwinPorts Frequently Asked Questions will attempt to answer some questions that are often asked about DarwinPorts.

## General Questions

What IS DarwinPorts?

DarwinPorts is probably best described by comparison: It's sort of like the FreeBSD ports collection or fink in that it automates the process of building 3rd party software for Mac OS X. It also tracks all dependency information for a given piece of software and knows how to make it build under Mac OS X and install it to a common location, meaning that software installed via DarwinPorts doesn't simply scatter itself all over the system or require user knowledge of what to install in what order.

How does DarwinPorts compare to FreeBSD ports?

FreeBSD ports is essentially implemented as some very impressive but hairy BSD make(1)'s macros and can be a little opaque and non-extensible from the perspective of someone looking to extend or re-factor parts of the system. Given that Makefiles aren't the easiest thing to parse, it is also harder to "mine" the FreeBSD ports collection for data to use for other purposes, such as generating documentation indexes or arbitrary front-ends for creating or managing ports.

Why did DarwinPorts start from scratch rather than adopting something like FreeBSD ports?

Even discounting some of the limitations of FreeBSD ports described above, the "science" of creating automated build systems is rather more complex than it looks at first glance and there's always room for fresh approaches to the problem, which is what we set out to do with DarwinPorts. There are certainly other systems, some of which have already been mentioned, which have made their own attempts at solving this problem and there will likely be many more such systems in the future since trying to find a single solution which pleases everyone is rather like trying to find a single programmin language which pleases everyone - it's more or less impossible. We urge people to judge DarwinPorts' design on its own merits and consider it a parallel rather than a competing effort since there's more software out there than any one system can ever manage to encapsulate and automate.

Will DarwinPorts run on any other Operating System?

DarwinPorts was designed to be as portable as possible. Though our target platforms are Mac OS X and Darwin, DarwinPorts is known to work on FreeBSD, OpenBSD, NetBSD and Solaris. We also provide individual ports with ways of specifying platform-specific rules that are only invoked on that particular platform.

Does DarwinPorts also do Package Management?

DarwinPorts works by first building software and installing it into a `destroot`, a fake-installation location, then installing it into the DarwinPorts prefix (`/opt/local` by default). It records this installation in its registry, and you can query the installed port and uninstall it through DarwinPorts. Work is underway to add full package management features to DarwinPorts.

You can also have DarwinPorts build a Mac OS X `.pkg` file of the port, and install it using the Mac OS X Installer. If that package has dependencies, then you can also build a multi-part package (`.mpkg`) which contains them as well. You can also build RPM packages from DarwinPorts.

Why does DarwinPorts install everything into `/opt/local` by default?

First, this location can be set to anything you like by editing /etc/ports/ports.conf or specifying `--prefix` during the `./configure` phase of the DarwinPorts installation, so nothing is fixed in place. Even the basic DarwinPorts infrastructure, which installs into /opt/local by default, can be installed elsewhere by overriding the value of PREFIX on the command line (see the README file for details). Second, we had to pick SOME location for things to install into so that they would not collide with system components or things already installed in /usr/local, so we elected to loosely follow Sun's convention and go with /opt/local.

## Common Problems