User Tools

Site Tools


client:client_compiling

Building the Crossfire Client

This page provides information on building the GTKv2 client from the source code. Instructions for compiling the server are on a separate page.

One of the first steps is to install the required dependencies, listed by Linux distribution, from below.

The second step is to obtain the GTKv2 Client source code and sound files via git.

The third step is to setup and compile the client.

Also this page includes instructions on how to update your local client installation and recompile the source code for those changes.

General Dependencies

  • C compiler supporting C99
  • CMake
  • GTK+ 2
  • libpng
  • Perl
  • libcurl (for metaserver support)
  • Lua 5 (for client-side Lua scripting)
  • OpenGL (gl, glu, glx) (for OpenGL rendering)
  • SDL, SDL_image (for SDL rendering)
  • SDL_mixer (for sound support)

Note: For x86_64 systems, do not mix 64-bit and 32-bit libraries unless it cannot be helped. For example, libsvn0 is a 32-bit library, but lib64svn0 is the 64-bit equivalent. The build process may fail in the linkage stage if a 32-bit library is linked during a 64-bit build.

Linux Distribution Specifics

Arch Linux

A quick reference for Arch Linux using the command line interface:

sudo pacman -S cmake git gtk2 sdl_image sdl_mixer sdl2_mixer vala

Instructions creation date: 2023-September-1

Last tested date: 2024-May-1

Debian

Debian 10 (Buster)

A quick reference for Debian 10 (Buster):

sudo apt install cmake git libcurl4-openssl-dev libgtk2.0-dev libsdl1.2-dev libsdl2-mixer-dev libsdl-image1.2-dev libsdl-mixer1.2-dev pkg-config valac

Instructions creation date: 2023-September-1

Last tested date: 2024-May-1

Debian 11 (Bullseye)

A quick reference for Debian 11 (Bullseye):

sudo apt install cmake git libcurl4-openssl-dev libgtk2.0-dev libsdl1.2-dev libsdl2-mixer-dev libsdl-image1.2-dev libsdl-mixer1.2-dev pkg-config valac

Instructions creation date: 2023-September-1

Last tested date: 2023-September-1

Debian 12 (Bookworm)

A quick reference for Debian 12 (Bookworm):

sudo apt install cmake git libcurl4-openssl-dev libgtk2.0-dev libsdl1.2-dev libsdl2-mixer-dev libsdl-image1.2-dev libsdl-mixer1.2-dev pkg-config valac

Instructions creation date: 2023-September-1

Last tested date: 2023-September-1

Devuan

Devuan Beowulf 3.1

A quick reference for Devuan Beowulf 3.1:

sudo apt install cmake git libcurl4-openssl-dev libgtk2.0-dev libsdl1.2-dev libsdl2-mixer-dev libsdl-image1.2-dev libsdl-mixer1.2-dev pkg-config valac

Instructions creation date: 2024-May-1

Last tested date: 2024-May-1

Devuan Chimaera 4.0

A quick reference for Devuan Chimaera 4.0:

sudo apt install cmake git libcurl4-openssl-dev libgtk2.0-dev libsdl1.2-dev libsdl2-mixer-dev libsdl-image1.2-dev libsdl-mixer1.2-dev pkg-config valac

Instructions creation date: 2023-September-1

Last tested date: 2024-May-1

Devuan Daedalus 5.0

A quick reference for Devuan Daedalus 5.0:

sudo apt install cmake git libcurl4-openssl-dev libgtk2.0-dev libsdl1.2-dev libsdl2-mixer-dev libsdl-image1.2-dev libsdl-mixer1.2-dev pkg-config valac

Instructions creation date: 2024-May-01

Last tested date: 2024-May-03

Fedora

Fedora 37

A quick reference for Fedora 37 using the command line interface:

sudo dnf install cmake git gtk2-devel libcurl-devel make SDL_image SDL_image-devel SDL_mixer SDL_mixer-devel SDL2_mixer-devel vala

Instructions creation date: 2023-September-01

Last tested date: 2024-May-04

Fedora 38

A quick reference for Fedora 38 using the command line interface:

sudo dnf install cmake git gtk2-devel libcurl-devel make SDL_image SDL_image-devel SDL_mixer SDL_mixer-devel SDL2_mixer-devel vala

Instructions creation date: 2023-September-01

Last tested date: 2023-May-05

Fedora 39

A quick reference for Fedora 39 using the command line interface:

sudo dnf install cmake git gtk2-devel libcurl-devel make SDL_image SDL_image-devel SDL_mixer SDL_mixer-devel SDL2_mixer-devel vala

Instructions creation date: 2023-September-18

Last tested date: 2024-May-05

Fedora 40

A quick reference for Fedora 40 using the command line interface:

sudo dnf install cmake git gtk2-devel libcurl-devel make SDL_image SDL_image-devel SDL_mixer SDL_mixer-devel SDL2_mixer-devel vala

Instructions creation date: 2024-April-25

Last tested date: 2024-April-25

Linux Mint

Linux Mint 20 (Ulyana)

A quick reference for Linux Mint 20 (Ulyana) using command line interface:

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libgtk2.0-dev valac

Instructions creation date: 2023-September-15

Last tested date: 2024-May-05

Linux Mint 20.1 (Ulyssa)

A quick reference for Linux Mint 20.1 (Ulyssa) using command line interface:

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl2-mixer-dev libgtk2.0-dev valac

Instructions creation date: 2023-September-18

Last tested date: 2024-May-06

Linux Mint 20.2 (Uma)

A quick reference for Linux Mint 20.2 (Uma) using command line interface:

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl2-mixer-dev libgtk2.0-dev valac

Instructions creation date: 2023-September-18

Last tested date: 2024-May-08

Linux Mint 20.3 (Una)

A quick reference for Linux Mint 20.3 (Una) using command line interface:

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl2-mixer-dev libgtk2.0-dev valac

Instructions creation date: 2023-September-20

Last tested date: 2024-May-08

Linux Mint 21 (Vanessa)

A quick reference for Linux Mint 21 (Vanessa) using command line interface:

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl2-mixer-dev libgtk2.0-dev valac

Instructions creation date: 2023-September-20

Last tested date: 2023-May-08

Linux Mint 21.1 (Vera)

A quick reference for Linux Mint 21.1 (Vera) using command line interface:

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl2-mixer-dev libgtk2.0-dev valac

Instructions creation date: 2023-September-20

Last tested date: 2024-May-08

Linux Mint 21.2 (Victoria)

A quick reference for Linux Mint 21.2 (Victoria) using command line interface:

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl2-mixer-dev libgtk2.0-dev valac

Instructions creation date: 2023-September-21

Last tested date: 2024-May-08

Linux Mint 21.3 (Virginia)

A quick reference for Linux Mint 21.3 (Virginia) using command line interface:

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl2-mixer-dev libgtk2.0-dev valac

Instructions creation date: 2024-May-12

Last tested date: 2024-May-12

Linux Mint Debian Debian Edition 6

A quick reference for Linux Mint Debian Debian Edition 6:

sudo apt install cmake git libcurl4-openssl-dev libgtk2.0-dev libsdl1.2-dev libsdl2-mixer-dev libsdl-image1.2-dev libsdl-mixer1.2-dev pkg-config valac

Instructions creation date: 2023-September-28

Last tested date: 2024-May-08

Installing on Linux Mint using Synaptic

FIXME - use with caution, package list has not been tested for a very long time

Synaptic package manager is used to manage installation, update and removal of software.

  • To open package manager in Mate: Click Menu, lower left corner, the Package Manager
  • To open in Cinnamon: Click Menu, then Administration, then Package Manager
  • In XFCE: Click Menu, then System, then Synaptic Package Manager
  • In KDE: Menu, then Applications, then Settings, then Package Manager

Once open, click Reload in the menu bar. Use the Quick Filter box to search for package names or descriptions. You will need to install the following packages:

  • cmake
  • git
  • libcurl4-openssl-dev
  • libglade2-dev
  • libsdl1.2-dev
  • libsdl-image1.2-dev
  • libsdl-mixer1.2-dev
  • libsdl2-mixer-dev
  • libgtk2.0-dev
  • valac

Manjaro

Manjaro 23.1.3 (Vulcan)

A quick reference for Manjaro using command line interface:

sudo pacman -S cmake gcc git gtk2 make sdl_image sdl_mixer sdl2_mixer vala

Instructions creation date: 2023-September-21

Last tested date: 2024-May-08

Manjaro 24 (Wynsdey)

A quick reference for Manjaro 24 (Wynsdey) using command line interface:

sudo pacman -S cmake gcc git gtk2 make sdl_image sdl_mixer sdl2_mixer vala

Instructions creation date: 2024-May-15

Last tested date: 2024-May-15

OpenSUSE

OpenSUSE Leap 15.5

A quick reference for OpenSUSE Leap 15.5

sudo zypper install cmake gcc git gtk2-devel libcurl-devel libSDL_image-devel libSDL_mixer-devel libSDL2-devel libSDL2_mixer-devel make vala

Instructions creation date: 2023-September-24

Last tested date: 2024-May-09

OpenSUSE Tumbleweed

A quick reference for OpenSUSE Tumbleweed

sudo zypper install cmake gcc git gtk2-devel libcurl-devel libSDL_image-devel libSDL_mixer-devel SDL2_mixer-devel make vala

Instructions creation date: 2023-September-24

Last tested date: 2024-May-10

NOTE: the first client launch after compile may result in a warning about UI dialogs not being available. Exit the client and try launching again.

Pop!_OS

Pop!_OS 22.04 LTS

A quick reference for Pop!_OS 22.04 LTS:

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl2-mixer-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libgtk2.0-dev valac

Instructions creation date: 2023-September-25

Last tested date: 2024-May-10

Pop!_OS 22.04 LTS (NVIDIA)

A quick reference for Pop!_OS 22.04 LTS (NVIDIA)

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl2-mixer-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libgtk2.0-dev valac

Instructions creation date: 2024-May-11

Last tested date: 2024-May-11

Ubuntu

The dependency and instructions for the listed versions of Ubuntu includes or applies to all eight of the different flavours including:

  • Kubuntu
  • Lubuntu
  • Ubuntu Budgie
  • Ubuntu Kylin
  • Ubuntu Mate
  • Ubuntu Studio
  • Ubuntu Unity
  • Xubuntu

Ubuntu 20.04 (Focal Fossa)

A quick reference for Ubuntu 20.04 (Focal Fossa):

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl2-mixer-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libgtk2.0-dev valac

Instructions creation date: 2023-August-30

Last tested date: 2024-May-11

Ubuntu 22.04 (Jammy Jellyfish)

A quick reference for Ubuntu 22.04 (Jammy Jellyfish):

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl2-mixer-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libgtk2.0-dev valac

Instructions creation date: 2023-September-29

Last tested date: 2024-May-12

Ubuntu 23.10 (Mantic Minotaur)

A quick reference for Ubuntu 23.10 (Mantic Minotaur) using the command line interface:

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl2-mixer-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libgtk2.0-dev valac

Instructions creation date: 2023-September-26

Last tested date: 2024-February-9

Ubuntu 24.04 (Noble Numbat)

A quick reference for Ubuntu 24.04 (Noble Numbat) using the command line interface:

sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl2-mixer-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libgtk2.0-dev valac

Instructions creation date: 2024-April-26

Last tested date: 2024-April-26

Obtaining the Source Code

  • Master contains the newest features and development for the game
  • Tags is an official & stable release of the game

The following steps may be used to download the client source files to your computer. Just pick one option between Master or Tag. Master is the recommended option.

Master

$ git clone https://git.code.sf.net/p/crossfire/crossfire-client crossfire-crossfire-client

Tag

Here's how to download Tag using the 1.75.2 release as an example

$ git clone -b v1.75.2 https://git.code.sf.net/p/crossfire/crossfire-client crossfire-crossfire-client

See instructions below for obtaining game sounds for the client.

Compile Instructions

To build with the default options, change to the recently downloaded or pulled client source directory (i.e., /home/<username>/crossfire-crossfire-client):

  cd crossfire-crossfire-client/

Confirm that you are in the correct directory with the pwd command, and it should look like this:

  $ pwd
  /home/<username>/crossfire-crossfire-client

Run git pull to download the game sounds and automatically save them in the directory that the client needs:

  $ git clone https://git.code.sf.net/p/crossfire/crossfire-sounds sounds

The first time you compile, you will need create a directory called build - but after this initial time, the directory creation is not necessary.

 $ mkdir build
 

Change (or cd) in to the build directory:

 $ cd build
 

Double check the file path with the pwd command:

 $ pwd
 /home/<username>/crossfire-crossfire-client/build

Now run the cmake command - or check the other options below; this step is using the default cmake command from inside the build directory:

 $ cmake ..

You should see numerous lines of text scroll by. If an problems are encountered in this step, it will be listed in this output.

From inside the build directory, run the make command:

$ make

Once again, you should see numerous lines of text scroll by. If this step was successful, you will see the following text:

   [100%] Built target crossfire-client-gtk2

Any errors or problems encountered, please reach out to the Crossfire development team and community via IRC, Discord, or Mailing Lists. IRC and Discord will have the fastest turn around time and interaction.

And one more step, running make install from within the build directory, this step requires sudo access or to be run with root access rights:

  $ sudo make install

or

  # make install

You should see numerous lines of scrolling text again for this step. If all goes well, you should be returned back to your regular shell prompt and no text indicating errors or problems.

Now to launch the client - a desktop shortcut should have been automatically created so the client should appear in the Application Menu. (i.e., Activities → Search → Crossfire Client)

Other ways to launch the client using the command line:

From within the directory crossfire-crossfire-client:

  $ ./gtk-v2/src/crossfire-client-gtk2

From your home directory:

  $ ./crossfire-crossfire-client/build/gtk-v2/src/crossfire-client-gtk2

Optional options:

To build with minimal dependencies, use this CMake command instead:

  $ cmake -DLUA=OFF -DMETASERVER2=OFF -DOPENGL=OFF -DSDL=OFF -DSOUND=OFF ..

To build with debugging symbols:

  $ cmake -DCMAKE_BUILD_TYPE=Debug ..

To install in a custom location (autotools –prefix):

  $ cmake -DCMAKE_INSTALL_PREFIX=/path/to/where/you/want ..

Use ccmake instead of cmake to change these options and more interactively.

Updating the Client and Sound Files

Steps for updating the client code and sound files use the git pull command.

Change (cd) in to the the client directory that was created in the earlier steps.

  $ cd crossfire-crossfire-client/

To confirm, the path to this folder looks like this:

  $ pwd
  /home/<username>/crossfire-crossfire-client
  

Now run the git pull command:

  $ git pull
  

IF there are no updates, you will see the following:

  $ git pull
  Already up to date.
  

If updates are available, they will be automatically downloaded for you.

Now, check and see if there are any updates to the sound files:

  $ cd sounds/

Check for updates with the git pull command:

  $ git pull
  Already up to date.
  

If updates are available, they will be automatically downloaded for you.

Now change (cd) to the build directory (this directory was manually created during the first compile process for the client):

  $ cd ../build/
  

Confirm you are in the correct directory with the pwd command:

  $ pwd
  /home/<username>/crossfire-crossfire-client/build

Now run the cmake command:

  $ cmake ..

You should see numerous lines of text scroll by. If an problems are encountered in this step, it will be listed in this output.

From inside the build directory, run the make command:

  $ make

Once again, you should see numerous lines of text scroll by. If this step was successful, you will see the following text:

 [100%] Built target crossfire-client-gtk2
 

Any errors or problems encountered, please reach out to the Crossfire development team and community via IRC, Discord, or Mailing Lists. IRC and Discord will have the fastest turn around time and interaction.

And one more step, running make install from within the build directory, this step requires sudo access or to be run with root access rights:

$ sudo make install

or

# make install

You should see numerous lines of scrolling text again for this step. If all goes well, you should be returned back to your regular shell prompt and no text indicating errors or problems.

Live Example

Using Ubuntu as a live example:

  sudo apt install cmake git libcurl4-openssl-dev libglade2-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libgtk2.0-dev valac
  
  git clone https://git.code.sf.net/p/crossfire/crossfire-client crossfire-crossfire-client
  
  cd crossfire-crossfire-client/
  
  git clone https://git.code.sf.net/p/crossfire/crossfire-sounds sounds
 
  mkdir build
 
  cd build/
 
  cmake ..
 
  make
 
  sudo make install

Now launch the client (i.e., Activities → Search → Crossfire Client)

client/client_compiling.txt · Last modified: 2024/05/15 12:19 by leaf