This set of notes provides instructions for building Xastir from Github on Ubuntu 14.04 thru 17.04 with all supported libraries enabled. It assumes the user already has a working installation of Ubuntu, either on a physical machine or a virtual machine. Installation of Ubuntu itself is not covered here. Internet connectivity is also assumed.
If you already installed the binary version
Note: The binary version refers primarily to a version of Xastir that is provided in the Ubuntu repositories, but a binary could also be provided by a 3rd Party such as user of Xastir.
If you installed a binary version of xastir from the Ubuntu repository (using the "apt-get install xastir" option (or using Synaptic), you'll have an outdated version, and it will have installed into /usr instead of /usr/local. The source install described on this page will install into /usr/local, so you'll want to remove your binary installation first before following the directions that follow.
If you did a lot of map configuration with the binary install, all of your maps will be in /usr/share/xastir/maps. You'll need to copy those to a safe place before removing the binary install:
mkdir /tmp/maps cp -r /usr/share/xastir/maps/* /tmp/maps
Then remove the binary package:
sudo apt-get remove xastir
You can then follow the instructions below to re-install xastir to /usr/local from sources. Once you're done, copy your maps back to the new installation directory:
sudo cp -r /tmp/maps/* /usr/local/share/xastir/maps
Then you need to edit your ~/.xastir/config/xastir.cnf file to change all occurances of "/usr/share" to "/usr/local/share"
You'll be back in business with a more easily updated xastir.
Shortcut: Build Script
KC0TFB originally prepared a build script that obtains all the build dependencies and performs all the actions described herein, with the exception of installing GDAL. Read below to determine if you want GDAL support; most users won't need it.
The script has been modifed by K5DAT to support newer releases of Ubuntu.
Retrieve the updated script with
You will probably need to make it executable by issuing the following command:
chmod +x ubuntu-xastir-git-build.sh
Examine the script with your favorite editor and be sure you understand what it does before executing it. It is provided for your convenience, however without warranty of any kind.
To perform a manual build of Xastir, start immediately below.
Preparing the system
The user should not have to modify the default repository settings as the newer versions of Ubuntu already have the required repositories configured.
First, make sure you have a working Ubuntu 14.04 installation. Also check that you can access the Internet. As always, you should also have a complete backup of your system.
Updating your installed packages to the latest versions is strongly recommended. This can be done using APT:
sudo apt-get update sudo apt-get upgrade
If there was a kernel upgrade or other such major update applied, you may want to reboot your system before proceeding.
Start installing packages
- Get the basic set of build tools:
sudo apt-get install build-essential
- Get the libraries essential for building xastir:
Applicable to Ubuntu 14.04 thru 17.04:
sudo apt-get install git autoconf automake xorg-dev graphicsmagick gv libmotif-dev libcurl4-openssl-dev
For Ubuntu 14.04, 14.10 & 15.04 also add...
sudo apt-get install libxp-dev
The packages above are required for the most basic minimum build of xastir. gv is not strictly required, but if you don't install it you will be unable to print. Note that the graphicsmagick package above is not the one that gives you on-line map support, it's the one that provides the "convert" utility needed to create the postscript that gv will use to print. This package and gv are both required to be able to print from xastir even with minimal map support.
- Get additional libraries that will help for extra features:
Applicable to Ubuntu 14.04 thru 17.04:
sudo apt-get install gpsman gpsmanshp libpcre3-dev libproj-dev libdb5.3-dev python-dev libax25-dev sudo apt-get install shapelib libshp-dev festival festival-dev libgeotiff-dev libgraphicsmagick1-dev
For Ubuntu 15.10, 16.04, 16.10 or 17.04 also add...
sudo apt-get install libwebp-dev
- Get default fonts left out of the base system
With recent versions of xorg on Ubuntu, they've dropped the 100dpi and 75dpi fonts packages from the "depends" list, so they don't get installed. Of course, Xastir uses fonts in those packages as default fonts, and if you don't take this step you'll get warnings from Xastir about being unable to convert a string to a font.
sudo apt-get install xfonts-100dpi xfonts-75dpi xset +fp /usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi
The second line tells your running X server to start looking for fonts in the newly installed directories.
Get XASTIR source code From the GitHub repository
In this method, you get your source code directly from the repository the developers use to work on the software. Below is the step-by-step method for getting it this way.
You can make different choices here for where you want to store your code. This example puts it in a src directory under the user's home directory:
mkdir ~/src cd ~/src
Then issue the following command to retrieve the latest Xastir code:
git clone https://github.com/Xastir/Xastir.git
The above command could take a while to finish if you're on a slow link, as there are a lot of files to download.
- Run bootstrap to generate Makefile.am and configure:
cd Xastir ./bootstrap.sh
This is a very optional install, and is pretty much unnecessary. Very few users will ever need it, as Xastir's use of GDAL is limited to only a small handful of unusual map types. It is recommended that most users skip this step.
- Download the GDAL source
As of this writing, the latest GDAL source can be downloaded like this:
cd ~/src wget http://download.osgeo.org/gdal/2.1.1/gdal-2.1.1.tar.gz
- Unpack GDAL
tar zxvf gdal-2.1.1.tar.gz cd gdal-2.1.1
- Build and install GDAL:
./configure make sudo make install sudo ldconfig
Note: the GDAL 'make' step seems to take a while to complete
You've now got all the libraries in place and can build the fully enabled code.
- Configure the code:
cd ~/src/Xastir mkdir build cd build ../configure CPPFLAGS="-I/usr/include/geotiff"
You should be rewarded with a list of features that all say "yes" after them (or no to GDAL if you skipped that step). If you followed all the steps above, the results look like this:
xastir 2.xx has been configured to use the following options and external libraries:
ShapeLib (Vector maps) ................. : yes
GraphicsMagick/ImageMagick (Raster maps) : yes (GraphicsMagick) pcre (Shapefile customization) ......... : yes dbfawk (Shapefile customization) ....... : yes rtree indexing (Shapefile speedups) .... : yes map caching (Raster map speedups) ...... : yes internet map retrieval ................. : yes (libcurl)
FOR THE ADVENTUROUS:
AX25 (Linux Kernel I/O Drivers) ........ : yes libproj (USGS Topos & Aerial Photos) ... : yes GeoTiff (USGS Topos & Aerial Photos) ... : yes Festival (Text-to-speech) .............. : yes GDAL/OGR (Obtuse map formats) .......... : yes GPSMan/gpsmanshp (GPS downloads) ....... : yes
- Build the code:
make sudo make install
If you intend to use Kernel AX.25 networking, you should also set the installed Xastir binary to be SUID root:
sudo chmod u+s /usr/local/bin/xastir
- Enjoy! You now have a fully functional xastir with all features enabled. You can launch it like this:
The first time Xastir is run it'll pop up a dialog box asking you to set some station parameters.
The developers are always adding new features to Xastir and fixing bugs. You'll likely want to update your Xastir semi-regularly. Fortunately for you, you don't have to repeat all of the above steps each time. Updating is actually very simple:
Periodically, you can update the code by going into the repo directory and executing:
then compiling normally per the "Compiling and Installing Xastir" instructions shown above. Note to developers only: "git pull" is risky for you if you are modifying code.
-OR- you can type:
which will do EVERYTHING for you from the "git pull" to the "chmod" command. This will be adequate if you don't need support for GeoTiff maps, which require the CPPFLAGS="-I/usr/include/geotiff" statement when you run the configure script.
You have to start the festival server separately in a shell window before starting xastir.
festival --server &
Clicking File->Configure->Speech in xastir, I could get it to talk just by clicking the "Test" button in the dialog.