Darwin Ports

bringing FreeBSD ports collection to the Macintosh (updated for Darwin 10.2 (Mac OS X 10.6))

What is Darwin Ports?

As every FreeBSD enthusiast I wanted to see the Ports Collection working on Darwin as soon as I installed Mac OS X on my Powerbook. Darwin Ports makes this possible. You will be able to compile, install and package most (hopefully someday) of ports from the FreeBSD collection.

Since other similar projects seem to be shutting down or stalling, I'm rehashing my Darwin Ports effort. I just updated the tarball to use a recent FreeBSD ports distribution (7.2).

Darwin pkg is not required anymore to use Darwin Ports and it is deprecated.

Quick start guide to Darwin Ports

Three steps to compile what you need from /usr/ports:

  • Download and install a recent FreeBSD Collections into /usr
            $ cd
            $ curl -O ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports/ports.tar.gz
            $ cd /usr
            $ sudo tar zxf ~/ports.tar.gz
            [...this will take a long time...]
  • Download and install Darwin Ports
    	$ curl -O http://alice.iscanet.com/~rlucia/devel/darwin_pkg/files/darwin_ports-latest.tar.gz
    	$ tar zxf darwin_ports-latest.tar.gz
    	$ cd darwin_ports
    	$ sudo bsdmake install
  • And you're done, now start enjoying building some stuff:
            $ cd /usr/ports/irc/ircII
    	$ sudo bsdmake
            $ sudo bsdmake install

    What is Darwin Ports?

    Darwin Ports will allow you to compile your ports using a Makefile infrastructure that give the "ports collection" a coherent environment to be built and packaged. Darwin Ports works with Apple provided bsdmake and compiler tool chain and the Darwin pkg tools (a port of FreeBSD's /usr/sbin/pkg_* tools to Darwin 10.2).


    As a ports user you will need a compiler (everything is packaged in the Apple Developer Tools bundled with your Mac OS X copy) and a bunch of tools you'll find on this website. In the first stage of the project you will also need to download the entire FreeBSD ports and then update/replace it with Darwin Ports.

    How do I build a port?

    Building a port is very easy: get into the directory of the port you want to build and install, and then issue the command freebsdmake install bsdmake install. The package source will be retrieved, extracted, configured, built and installed on your system. The port installation will also be tracked on your system as a package, you can list installed packages with pkg_info or delete them with pkg_delete name.

    How do I install Darwin Ports on my Macintosh?

    There are different ways to get Darwin Ports. You first need to download the FreeBSD Ports collection from a recent ports.tar.gz from the latest release and untar it into /usr. Then untar latest Darwin Ports patchkit and execute

    sudo bsdmake install
    and you're done.

    Again What is Darwin Ports?

    Darwin Ports is both a patchkit and a port of utilities from FreeBSD to Darwin. Basically it is composed by the following parts:


    Other Darwin Tips

    If you want to read your local manual pages:

    ln -s /usr/local/man /usr/local/share/man

    Or.. just in case you need to boot single user press at boot :-)

    Try pressing T at boot. This will transform your Macintosh into an external FireWire drive (look for Target Disk Mode into the docs).

    Other references

    Rocco Lucia
    Tue Jan 19 15:22:58 CET 2010