From XastirWiki
Jump to: navigation, search

Installing on FreeBSD

Xastir runs very well on FreeBSD. There are 2 easy ways to install Xastir on FreeBSD.

Use the package

pkg_add -r xastir

This requires an ftp connection to the internet and will download Xastir, and the default prerequisites as binary packages and install them. This will install a default config which includes;

  • Shapelib
  • Perl Compatible Regular Expressions
  • Image Magick

Use the port

FreeBSD has an excellent ports system which downloads and builds software from source. It automatically resolves dependancies and provides a menu interface allowing you to configure various options before compilation.

With the port, the following options are also available;

  • ImageMagick or GraphicsMagick selection
  • GeoTIFF - Tiff based georeferences raster imagery
  • GPSMAN - GPS interface
  • Festival - speech synthesis
  • Tiger Map Caching using Berkeley DB

Install the port

  1. Install the FreeBSD Ports Tree
  2. cd /usr/ports/comms/xastir
  3. make config
  4. make install

or, use the portinstall port.

See the entry below about a port for tracking the bleeding edge.

Track the "bleeding edge"

While the FreeBSD ports system will get you the latest stable release quickly and easily, it can also help you track the unstable Git version, too.

To do this, install xastir with all the options you want according to the instructions under "Install the port" above. Since the ports system will download and install all the packages xastir depends on, and will do so by installing full development packages with headers and libraries, this will get you the full development environment you need to build the Git version of xastir, too. This is the easiest way to make sure you have all the other packages that Xastir needs.

After doing that, deinstall the xastir port:

 pkg_delete xastir'*' 

This is necessary before you install the Git version, because if you leave it installed then the Git version will overwrite files that the package database keeps track of, and the system will be confused.

Make sure you have the two "autotools" ports for automake and autoconf installed:

 pkg_info | grep automake

This command should show you two lines. If not, install them:

 cd /usr/ports/devel/automake
 make install clean

This will install both automake and autoconf, and they will be installed into the standard /usr/local prefix that should already be in your path.

Now you are ready to build xastir from its git repository, per the directions in README.GIT, which can be found at or on this wiki at Notes:Git.

Use the following configure command when you get to that step in README.GIT:

 ./configure  --with-bdb-incdir=/usr/local/include/db5 CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" CFLAGS="-O3 -g" CC=gcc CXX=g++

(you can omit the --with-bdb-incdir option if you are not building with map caching.) This will make sure that the configure program can find all the headers and libraries that FreeBSD has in /usr/local, which is different from linux where nearly everything gets installed to /usr instead.

Note that since the port install of xastir noted in the first section installs to the same default location as a source-built install of Xastir (because it IS a source-built install), all of the hassles that Linux users have to deal with when switching from a package install to git install are not relevant to FreeBSD.

A port to keep you current!

NOTE: The text in this section references an obsolete port that will no longer work now that the project has moved to git. The port described below is still set up to pull Xastir from sourceforge. We have left the section intact because you may find it useful to construct your own port that references git instead by using this port as a starting point.]

This is a FreeBSD port skeleton designed to let you keep up with the current Xastir Git tree.

Unfortunately the FreeBSD ports tree really isn't setup for this sort of port so it won't be appearing there. Instead please download it from

There is one issue with this port. As of its creation date it correctly lists all included files in the pkg-plist and so an uninstall will cleanly remove them. This is almost certainly going to change and installs in the future will probably leave files around. At least until the port skeleton is updated.

It should, however, remove the majority of the files and it's most likely that new files will appear in one of the xastir specific directories making it easy to find them later.


Download the port skeleton and extract it into a working directory. It will create a directory called "xastir-devel" and place the skeleton within.

Using it is *exactly* like installing a normal port except you can't use portinstall, portmaster or similar. Follow the steps below;

 cd xastir-devel
 make config (select what options you would like to build with)
 make install
 make clean

It will install all dependancies as required. It will, by default use the version of Sleepycat DB (BDB) that is installed as long as it is at least version 4.1. If you want to use a later version of BDB then just install it first. The port will pick the latest installed version to use. If you don't have BDB installed, it will install version 4.1 by default.

This port installs into the same locations as the standard comms/xastir port so you can't have both installed at the same time. It will complain if you try.

Keeping Current

The port extracts the source via CVS each time you run it so updating to the current CVS HEAD is as simple as doing

 make deinstall
 make reinstall

Since it downloads from CVS each time you can't easily go back to a previous version using this port. If you want to keep a port binary around you can do a "make package" after you have done the "make install" to create a binary package that you can re-install as you wish.


If you have problems with the port contact me at the address below. I do read both the xastir and xastir-dev mailing lists.


carl at stagecraft dot cx