Building on GNU/Linux
This page contains both generic and copy-and-paste instructions for a Hedgewars development build.
It has a partial focus on Debian, but this guide attempts to include generic information as well.
Also, see https://hedgewars.org/download.html if you are just looking to play latest stable—there’s a good chance it exists for your distribution.
The first section contains dependency lists, the second section contain copy-and-paste instructions for Debian and derivatives (Ubuntu, Linux Mint, etc.).
For a full list see Dependencies
In most Linux distributions, you should find readily available packages.
Please note that for libraries, you also need their development headers. Some distributions (most notably Debian and its derivatives) provide separate packages for the headers.
Resolving dependencies under Debian and Debian-based systems (e.g. Mint, Ubuntu)
These line contain
lines you can simply paste into your shell and execute. Please remember to copy the entire
sudo apt-get install mercurial cmake g++ qtbase5-dev qtbase5-private-dev qttools5-dev-tools qttools5-dev qt5-style-plugins libsdl-ttf2.0-dev libsdl2-dev libsdl2-net-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-ttf-dev liblua5.1-dev fpc libphysfs-dev fonts-dejavu-core ttf-wqy-zenhei
If you are on debian stable as of 2018-12-14, you may have to install the backport of physfs.
If you want PNG screenshots (instead of BMP screenshots), add:
sudo apt-get install libpng12-dev
If you want video recording, add:
sudo apt-get install libavcodec-dev libavformat-dev freeglut3-dev
If you want to try building the server as well (requires at least libghc base 4.3 now) try these too:
sudo apt-get install ghc libghc-binary-dev libghc-bytestring-show-dev libghc-sandi-dev libghc-deepseq-dev libghc-hslogger-dev libghc-mtl-dev libghc-network-dev libghc-parsec3-dev libghc-utf8-string-dev libghc-vector-dev libghc-random-dev libghc-zlib-dev libghc-sha-dev libghc-entropy-dev libghc-regex-tdfa-dev libghc-aeson-dev libghc-yaml-dev libghc-text-dev
Note that Haskell is also required to build Hedgewars 0.9.25 on 32 bit linux due to a FreePascal? alignment bug triggered by an undisableable SDL2 CPU feature detection. 0.9.24 and 0.9.23 have same bug, so will not function properly on 32 bit Linux.
Fetching the source code
Below you find instructions for downloading the Hedgewars source code from the development repository.
If you have already downloaded and unpacked the source code version of your choice (e.g. the source tarball from the download page), just
to your copy of the Hedgewars source in a terminal and go straight to the building section further below.
mkdir -p ~/games ~/hg/hedgewars/
hg clone -v https://hg.hedgewars.org/hedgewars/ trunk
The initial clone of the repository will take a while, is about 628 MiB or so, due to all the multimedia revisions.
After that switch to the trunk folder:
If you want to build the latest release version (so that you can play with other people online) use this command:
hg update 0.9.24.1-release
Note. Do not run the command above if you want to play the latest development code (currently 0.9.25-dev).
Now let’s configure and build!
If you want to install Hedgewars just for your user account run
cmake -DCMAKE_BUILD_TYPE="DEBUG" -DCMAKE_INSTALL_PREFIX="$HOME/games" -DDATA_INSTALL_DIR="$HOME/games" -DNOSERVER=1
If you want to install Hedgewars system-wide (not recommended for development builds) then run
cmake -DCMAKE_BUILD_TYPE="RELEASE" -DNOSERVER=1
sudo make install
Important: If you decided against png-screenshots or video-recording support, please append
to the cmake command line respectively!
If you want to build the server as well, change
then wait for the build to complete, then run …
if you did a system-wide install.
You can also create a launcher for it on your desktop or on applications menu if you wish, using the
Build latest development code repository updates
If you have built from your repository clone before and now you want to download more recent updates and rebuild Hedgewars with them, then run
hg pull -u