Last modified 6 years ago Last modified on 18/06/15 16:18:14

Fawkes on FreeBSD

BSD Daemon FreeBSD is supported as a secondary development platform for Fawkes. FreeBSD provides us with an opportunity to look at Fawkes from a different perspective. We currently support FreeBSD 8.0 and up, but strongly recommend to use 9.x. It has been included in our build farm.

Here is a short description how to start hacking on Fawkes on FreeBSD. This assumes that you are at least somewhat familiar with FreeBSD and know how to install packages and ports.

Basics for FreeBSD

If you plan to use FreeBSD for a longer time you should get ccache as well. It is really worth knowing the FreeBSD Handbook. Many things described in this document are excerpts from this handbook. To install a port briefly use the portinstall command from the portupgrade port. Install it using:

cd /usr/ports/ports-mgmt/portupgrade
make install clean

To find a port use the whereis tool, for example:

whereis lua

Getting the dependencies

On FreeBSD quite a few addon packages must be installed. Here is a short trail how to get everything installed.

# for p in shells/bash shells/bash-completion devel/gmake devel/subversion sysutils/file \
   databases/sqlite3 security/openssl textproc/libxml++ graphics/jpeg net/avahi \
   dns/nss_mdns lang/lua lang/tolua++ x11-toolkits/gtkmm24 devel/libglademm24 \
   devel/sdl12 graphics/gts graphics/opencv math/gsl x11/gnome-libs \
   www/libmicrohttpd databases/rrdtool graphics/graphviz net/xmlrpc-c-devel \
   devel/libexecinfo textproc/asciidoc audio/flite audio/alsa-lib devel/bullet \
   devel/doxygen math/cgal; \
do \
 portinstall $p; \
# echo 'dbus_enable="YES"' >> /etc/rc.conf
# echo 'avahi_daemon_enable="YES"' >> /etc/rc.conf

You should keep your ports up2date. Use the portsnap, portupgrade and portaudit tools for this.

# portinstall ports-mgmt/portaudit
# portaudit -a -F      # (shows vulnerable installed ports)
# pkg_version -v       # (shows up2date status of installed ports)
# portsnap fetch       # (fetch most recent ports collection)
# portsnap update      # (update local port collection)
# portupgrade -a      # (upgrades all installed ports)

Useful tips

It is probably a good idea to install Vim or Emacs to work on the software:

# portinstall editors/vim
# portinstall editors/emacs
# echo "alias vi='vim'" >> ~/.bash_profile

If you access FreeBSD for example via SSH it can happen that the arrow keys do not work properly in vim. This problem is described with a solution in Vim TIP 550. Just do cp -i /usr/local/share/vim/vim71/vimrc_example.vim ~/.vimrc and this problem disappears. We found that commenting out the line "set mouse=a" restored xterm copy'n'paste for vi. To get nice terminal captions for xterms that have a ssh session to a FreeBSD machine we add the following to /etc/profile:

if [ "$BASH" ]; then
    if [ -f /usr/local/etc/bash_completion ]; then
        . /usr/local/etc/bash_completion

    # are we an interactive shell?
    if [ "$PS1" ]; then
        case $TERM in
                PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"'
                PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\\"'
        # Turn on checkwinsize
        shopt -s checkwinsize
        [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "

alias vi='vim'

If you followed the instructions in GitNotes and have problems with the colored output, put this to your ~/.bash_profile:

export CLICOLOR=yes

Building Fawkes

The Fawkes build systems needs GNU Make and the bash. Both have to be installed. Then you have to make sure to always call gmake and not make!

Bitten Configuration

To make bitten use GNU make instead of BSD make add the following to /usr/local/etc/bitten/bitten-slave.conf:

path = /usr/local/bin/gmake

What to expect

The main application will run and all the basic functionality is available. The camera can work on shared memory images, files and network images. Currently no native camera exists for FreeBSD.