An introduction to DPorts

John Marino dragonflybsd at
Wed Jan 2 16:46:04 PST 2013

I've been relatively quiet about my latest efforts.  Sometimes a discussion about DPorts would pop on #dragonflybsd IRC channel but that was all.  Some of you noticed a recent commit to /usr/Makefile that added "native DPorts support" and you wondered what that was about, so here's a quick introduction.

In a nutshell, DPorts are FreeBSD ports that build on DragonFly.

Only ports that pass a pretty strict build test get entered into the repository.  Currently there are over 16,500 ports in the DPorts repository.  For comparison's sake, around 9000 unique Pkgsrc packages build on DragonFly.  (Pkgsrc has a "multiversion" feature where you will see, for example, py26-, py27-, py31-, py32-, py33- versions of the same package which count 5x in a bulk report.  I am estimating the pkgsrc count is inflated by around 2000 packages due to this effect).  Right now, the FreeBSD ports collection numbers over 24,000 but likely around 1000 of those are obsolete, broken, FreeBSD-specific, and otherwise unnecessary for DragonFly.  Around 5000 ports haven't even seen a build attempt yet because one or more of their dependencies are broken.  I would think aiming for the 20,000 port mark is not an unreasonable goal for DPorts.

While DPorts and Pkgsrc build in separate places (/usr/local vs /usr/pkg), their products can not exist at the same time.  Pkgsrc executables and binaries will get picked up by DPorts because obviously they are in the default search path.  So you may want to try DPorts out in a VM or a jail if you don't want to risk corrupting a set of Pkgsrc packages.

There are two easy ways to install DPorts:
cd /usr
1) make dports-create
2) make dports-create-shallow
3) make dports-download

Option #1 clones the full DPorts repository located at
Option #2 clones the repository, but without history.  You can pull updates later though.
Option #3 downloads a tarball of the full repostory and extracts it.

The ports source is located at /usr/dports

Option 1&2 require git on the system, just like the similar src and pkgsrc options.  However, if this prerequisite is not met, one could use option#3 to establish the repository, build git from source, blow /usr/dports away, and then clone the repository with options 1 or 2.

The long-term plan is that building from source will *not* be recommended to new users.  Since theoretically every single port in the repository is buildable, every single one of them should be stored in an official binary repository.  The first recommendation will be to install from binary.  Packages should not be missing.  I am aiming for something reliable and complete.

The tool that makes this possible is "pkg", FreeBSD's new package manger:
Here is additional information about this program:!.html

The old pkg_* tools will not come with DPorts, pkg is all one needs and it is quite an improvement over current tools.  Oh, and DPorts uses the system "make", while pkgsrc uses "bmake".

There are over 7000 ports that haven't been built.  There is at least 2600 ports that have been attempted but failed to build.  Here a list in order of most affected dependencies:

For me the fix priorities are (no particular order):
i386-only (including linux emulators)

I don't think the Desktop Environments are that far off from being supported. François Tigeot is tackling OpenJDK7 and Libreoffice.  I'm going to have to scale back the amount of work I put into this for the next few weeks so I could use some help.

There is good news though.
- A significant number of ports built with a single makefile line change or addition.
- Many patches from pkgsrc are applicable or at least illustrate the problem, so its not starting from scratch.

I don't want to use the DragonFly bug tracker for DPorts.  I want to use the facilities that github provides.  If you find a problem with an existing port, or if you have a patch set that you believe will fix a missing port, please post the information here:

There is also a wiki facility for DPorts, so I may write some pages that would assist those wishing to help out.  Things like how to run portsnap on DragonFly.  :)

We are still actively participating in pkgsrc.  DPorts is simply an additional option for users.  Ultimately there should not be any software available in pkgsrc that is not available in DPorts because we can simple create a custom (non-FreeBSD) port for cases that that.  Beyond that, we'll just have to see how well this system is received and what works best for the DragonFly project in the long term.


More information about the Users mailing list