Testing ports with poudriere
To build or test ports on DragonFly or FreeBSD, a fantastic tool named poudriere exists. It provides a clean environment for building packages reproducibly.
Installation is as easy as pkg ins poudriere
. Then edit
/usr/local/etc/poudriere.conf
. In my case I only had to change the
DPORTS_URL
setting to point to a local git repository that contains the ports
tree (for example /git/DPorts.git
). This is because I wanted to add or test
new ports that I maintain within that repo. Whereas if you only want to build
existing ports, set this variable to a mirror of our ports tree.
Next, we check out the ports. This is done with:
# poudriere ports -c
Then, we build a jail named myjail
with a specified DragonFly version. I will
use the master
branch. Later, this jail is used to build the ports.
# poudriere jail -c -j myjail -v master
This takes a while as it has to do a full buildworld
. Once finished, we can
finally start to build a port. Let’s say we want to test the lang/ruby22
port:
# poudriere testport -j myjail -o lang/ruby22
That’s all. For more complex tasks, please consult it’s man page poudriere(8).