The procedure to build Xastir in Ubuntu 12.04 is unchanged from version 11.10. As a result, the changes in this write-up are superficial when compared to the equivalent for Ubuntu 11.10.
This set of notes provides instructions for building Xastir from CVS on Ubuntu 12.04 with all supported libraries enabled. It assumes the user already has a working installation of Ubuntu 12.04, 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 update the libcurl development package name as well support newer releases including Ubuntu 11.10 and 12.04.
Retrieve the updated script with
You may 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 immediate 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 12.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:
sudo apt-get install git autoconf automake xorg-dev imagemagick gv libxp-dev lesstif2-dev libcurl4-openssl-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 imagemagick package 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:
sudo apt-get install gpsman gpsmanshp libpcre3-dev proj libproj-dev libdb4.8-dev python-dev libax25-dev shapelib libshp-dev festival festival-dev libmagickcore-dev libgeotiff-dev
If you prefer GraphicsMagick to ImageMagick (many do), you can modify the two installation lines above:
sudo apt-get install cvs autoconf automake xorg-dev graphicsmagick gv libxp-dev lesstif2-dev libcurl4-openssl-dev sudo apt-get install gpsman gpsmanshp libpcre3-dev proj libproj-dev libdb4.8-dev python-dev libax25-dev shapelib libshp-dev festival festival-dev libgraphicsmagick1-dev libgeotiff-dev
This is an acceptable modification as long as you're not using other software that absolutely requires ImageMagick --- the two dev packages have been known to conflict unnecessarily, and therefore GraphicsMagick may not be an option if you are using software other than Xastir that mandates ImageMagick.
Note: ImageMagick and GraphicsMagick may no longer conflict in Ubuntu 11.04 and newer.
- Get default fonts rudely left out of 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 "bleeding edge" CVS repository
In this method, you get your source code directly from the repository the developers use to work on the software. Here's 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 an entirely optional install, and is pretty much unnecessary. Very few users will ever have need of it, as Xastir's use of GDAL is limited to only a small handful of unusual map types. It is recommended that the casual user 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/gdal-1.8.1.tar.gz
- Unpack GDAL
tar zxvf gdal-1.8.1.tar.gz cd gdal-1.8.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.01 has been configured to use the following options and external libraries:
ShapeLib (Vector maps) ................. : yes
GraphicsMagick/ImageMagick (Raster maps) : yes (ImageMagick) pcre (Shapefile customization) ......... : yes dbfawk (Shapefile customization) ....... : yes rtree indexing (Shapefile speedups) .... : yes map caching (Raster map speedups) ...... : yes internet map retrieval ................. : yes (wget)
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:
cd ~/src/Xastir cvs update ./bootstrap.sh cd build ../configure CPPFLAGS="-I/usr/include/geotiff" make sudo make install && sudo chmod u+s /usr/local/bin/xastir
Or there is a script that will run the commands for you:
cd ~/src/Xastir ./update-xastir
You have to start the festival server by hand 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.