Darwin Ports

bringing FreeBSD ports collection to the Macintosh (updated for Darwin 8.8 (Mac OS X 10.4.8))

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 (6.2). I'm sorry at the moment there is no way to download Darwin Ports via anoncvs or cvs or whatever but via HTTP. A new project homepage is in the works too. Stay tuned.

Darwin pkg is required to use Darwin Ports.

Quick start guide to Darwin Ports

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

  1. Download and install Darwin pkg
            $ curl -O http://alice.iscanet.com/~rlucia/devel/darwin_pkg/files/darwin_pkg-latest.tar.gz
            $ tar zxf darwin_pkg-latest.tar.gz
            $ cd darwin_pkg
    	$ bsdmake
            $ sudo bsdmake install
    
  2. 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...]
    
  3. Download and install Darwin Ports into /
            $ cd
            $ curl -O http://alice.iscanet.com/~rlucia/devel/darwin_ports/files/darwin_ports-latst.tar.gz
            $ cd /
            $ sudo tar zxf ~/darwin_ports-latst.tar.gz      
    
And you're done, now start enjoying building some stuff:
        $ cd /usr/ports/irc/ircII
	$ sudo bsdmake
        $ sudo bsdmake install

How does Darwin Ports work?

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, some slight adaptations for Darwin to FreeBSD's /usr/ports tree and the Darwin pkg tools (a port of FreeBSD's /usr/sbin/pkg_* tools).

Requirements

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 on root partition of your Mac OS X and you're done. This thing contains /etc/mtree and /usr/ports/Mk grabbed from latest FreeBSD tree I have with little changes to make everything work on Darwin, plus patched packages as I fix them and some binaries that you'll find in the system as /usr/bin/freebsd*.

IMPORTANT: Don't forget to download and install the latest package tools to be able to use all ports functionalities.

You will also be able to download/update your Darwin Ports with anonymous CVS or CVSup when I'll be done with pm3.

Notes:

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 Mar 6 09:46:25 CET 2007