BuildingOnLinux.wiki
author Wuzzy
Sat, 27 Oct 2018 17:44:55 +0100
changeset 1594 0f489a75d6ad
parent 1529 7513dca7de74
child 1687 425eb8f784a9
permissions -rw-r--r--
Taunts: update unused taunts
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
494
37952cd70b0d Add generic dependency list for non-Debian users.
almikes@aol.com
parents: 493
diff changeset
     1
#summary Instructions for building the development version of Hedgewars on GNU/Linux (slight Debian focus)
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
     2
#labels Phase-Implementation,Phase-Deploy,Phase-Support
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
     3
493
300f6d2615ce Copy-editing.
almikes@aol.com
parents: 396
diff changeset
     4
= Building on GNU/Linux =
300f6d2615ce Copy-editing.
almikes@aol.com
parents: 396
diff changeset
     5
== Introduction ==
395
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
     6
494
37952cd70b0d Add generic dependency list for non-Debian users.
almikes@aol.com
parents: 493
diff changeset
     7
This page contains both generic and copy-and-paste instructions for a Hedgewars development build.
395
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
     8
494
37952cd70b0d Add generic dependency list for non-Debian users.
almikes@aol.com
parents: 493
diff changeset
     9
It has a partial focus on Debian, but this guide attempts to include generic information as well.
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    10
798
30c5f1ebd552 global replace of http with https for hedgewars.org wiki links
nemo
parents: 686
diff changeset
    11
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.
493
300f6d2615ce Copy-editing.
almikes@aol.com
parents: 396
diff changeset
    12
300f6d2615ce Copy-editing.
almikes@aol.com
parents: 396
diff changeset
    13
== Prerequisites ==
656
70434b3f51a3 minor fixes
sheepluva
parents: 592
diff changeset
    14
The first section contains dependency lists, the second section contain copy-and-paste instructions for Debian and derivatives (Ubuntu, Linux Mint, etc.).
494
37952cd70b0d Add generic dependency list for non-Debian users.
almikes@aol.com
parents: 493
diff changeset
    15
37952cd70b0d Add generic dependency list for non-Debian users.
almikes@aol.com
parents: 493
diff changeset
    16
=== Required packages ===
547
6539bd4b663b Bump version numbers.
almikes@aol.com
parents: 536
diff changeset
    17
For a full list see [Dependencies Dependencies].
494
37952cd70b0d Add generic dependency list for non-Debian users.
almikes@aol.com
parents: 493
diff changeset
    18
509
283791011d7c Edited wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 497
diff changeset
    19
In most Linux distributions, you should find readily available packages.
494
37952cd70b0d Add generic dependency list for non-Debian users.
almikes@aol.com
parents: 493
diff changeset
    20
656
70434b3f51a3 minor fixes
sheepluva
parents: 592
diff changeset
    21
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.
494
37952cd70b0d Add generic dependency list for non-Debian users.
almikes@aol.com
parents: 493
diff changeset
    22
509
283791011d7c Edited wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 497
diff changeset
    23
=== Resolving dependencies under Debian and Debian-based systems (e.g. Mint, Ubuntu) ===
494
37952cd70b0d Add generic dependency list for non-Debian users.
almikes@aol.com
parents: 493
diff changeset
    24
These line contain `apt-get` lines you can simply paste into your shell and execute. Please remember to copy the _entire_ `apt-get` lines!
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    25
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    26
{{{
1274
8c5925c4d6f0 BuildingOnLinux: Update apt-get line to qt5
Wuzzy
parents: 1144
diff changeset
    27
sudo apt-get install mercurial cmake g++ qtbase5-dev qtbase5-private-dev qttools5-dev-tools qttools5-dev qt5-style-plugins libsdl1.2-dev libsdl-net1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev 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
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    28
}}}
1523
b67aa6e196de BuildingOnLinux: Flip order of apt-get lines in order of relevance
Wuzzy
parents: 1320
diff changeset
    29
b67aa6e196de BuildingOnLinux: Flip order of apt-get lines in order of relevance
Wuzzy
parents: 1320
diff changeset
    30
If you want PNG screenshots (instead of BMP screenshots), add:
247
kyberneticist@gmail.com
parents: 241
diff changeset
    31
{{{
kyberneticist@gmail.com
parents: 241
diff changeset
    32
sudo apt-get install libpng12-dev
kyberneticist@gmail.com
parents: 241
diff changeset
    33
}}}
kyberneticist@gmail.com
parents: 241
diff changeset
    34
If you want video recording, add:
kyberneticist@gmail.com
parents: 241
diff changeset
    35
{{{
265
b0f68d7fe64e dev version of glut
kyberneticist@gmail.com
parents: 263
diff changeset
    36
sudo apt-get install libavcodec-dev libavformat-dev freeglut3-dev
247
kyberneticist@gmail.com
parents: 241
diff changeset
    37
}}}
kyberneticist@gmail.com
parents: 241
diff changeset
    38
If you want to try building the server as well (requires at least libghc base 4.3 now) try these too:
910
714fb7f71640 BuildingOnLinux: fix formatting
sheepluva
parents: 909
diff changeset
    39
1523
b67aa6e196de BuildingOnLinux: Flip order of apt-get lines in order of relevance
Wuzzy
parents: 1320
diff changeset
    40
(for Hedgewars versions after 0.9.22)
b67aa6e196de BuildingOnLinux: Flip order of apt-get lines in order of relevance
Wuzzy
parents: 1320
diff changeset
    41
{{{
1529
7513dca7de74 BuildingOnLinux: add new server deps
Wuzzy
parents: 1523
diff changeset
    42
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
1523
b67aa6e196de BuildingOnLinux: Flip order of apt-get lines in order of relevance
Wuzzy
parents: 1320
diff changeset
    43
}}}
909
391d7489379e BuildingOnLinux: update ghc deps
sheepluva
parents: 878
diff changeset
    44
(for Hedgewars version 0.9.22 or earlier)
154
030bb9b4470b Added server build deps
kyberneticist@gmail.com
parents: 131
diff changeset
    45
{{{
387
1fc2f41b3f88 new server dependencies
kyberneticist@gmail.com
parents: 386
diff changeset
    46
sudo apt-get install ghc libghc-binary-dev libghc-bytestring-show-dev libghc-dataenc-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
154
030bb9b4470b Added server build deps
kyberneticist@gmail.com
parents: 131
diff changeset
    47
}}}
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    48
493
300f6d2615ce Copy-editing.
almikes@aol.com
parents: 396
diff changeset
    49
== Fetching the source code ==
395
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    50
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    51
Below you find instructions for downloading the Hedgewars source code from the development repository.
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    52
798
30c5f1ebd552 global replace of http with https for hedgewars.org wiki links
nemo
parents: 686
diff changeset
    53
If you have already downloaded and unpacked the source code version of your choice (e.g. the source tarball from the  [https://hedgewars.org/download.html download page]), just {{{cd}}} to your copy of the Hedgewars source in a terminal and go straight to the building section further below.
395
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    54
----
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    55
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    56
{{{
263
afcb38bfd761 Revert use of build dir. Nice idea, but breaks pas2c and confused people. Esp people who had done this before. For most people, a purge is adequate if they need to clean up. Heck, that's what unc0rr and I apparently do, or we would have noticed the pas2c thing earlier
kyberneticist@gmail.com
parents: 253
diff changeset
    57
mkdir -p ~/games ~/hg/hedgewars/
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    58
cd ~/hg/hedgewars
798
30c5f1ebd552 global replace of http with https for hedgewars.org wiki links
nemo
parents: 686
diff changeset
    59
hg clone -v https://hg.hedgewars.org/hedgewars/ trunk
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    60
}}}
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    61
493
300f6d2615ce Copy-editing.
almikes@aol.com
parents: 396
diff changeset
    62
The initial clone of the repository will take a while, is about 628 MiB or so, due to all the multimedia revisions.
333
5b70b52c17c4 Edited wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 332
diff changeset
    63
After that switch to the trunk folder:
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    64
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    65
{{{
263
afcb38bfd761 Revert use of build dir. Nice idea, but breaks pas2c and confused people. Esp people who had done this before. For most people, a purge is adequate if they need to clean up. Heck, that's what unc0rr and I apparently do, or we would have noticed the pas2c thing earlier
kyberneticist@gmail.com
parents: 253
diff changeset
    66
cd trunk
333
5b70b52c17c4 Edited wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 332
diff changeset
    67
}}}
5b70b52c17c4 Edited wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 332
diff changeset
    68
5b70b52c17c4 Edited wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 332
diff changeset
    69
If you want to build the latest release version (so that you can play with other people online) use this command:
5b70b52c17c4 Edited wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 332
diff changeset
    70
{{{
1320
c3dfc9a0d9fb bump version numbers
nemo
parents: 1274
diff changeset
    71
hg update 0.9.24.1-release
333
5b70b52c17c4 Edited wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 332
diff changeset
    72
}}}
1320
c3dfc9a0d9fb bump version numbers
nemo
parents: 1274
diff changeset
    73
Note. Do *not* run the command above if you want to play the latest development code (currently 0.9.25-dev).
333
5b70b52c17c4 Edited wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 332
diff changeset
    74
395
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    75
493
300f6d2615ce Copy-editing.
almikes@aol.com
parents: 396
diff changeset
    76
== Building process ==
395
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    77
493
300f6d2615ce Copy-editing.
almikes@aol.com
parents: 396
diff changeset
    78
Now let’s configure and build!
395
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    79
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    80
If you want to install Hedgewars *just for your user account* run
333
5b70b52c17c4 Edited wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 332
diff changeset
    81
{{{
263
afcb38bfd761 Revert use of build dir. Nice idea, but breaks pas2c and confused people. Esp people who had done this before. For most people, a purge is adequate if they need to clean up. Heck, that's what unc0rr and I apparently do, or we would have noticed the pas2c thing earlier
kyberneticist@gmail.com
parents: 253
diff changeset
    82
cmake -DCMAKE_BUILD_TYPE="DEBUG" -DCMAKE_INSTALL_PREFIX="$HOME/games" -DDATA_INSTALL_DIR="$HOME/games" -DNOSERVER=1
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    83
make install
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    84
}}}
395
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    85
If you want to install Hedgewars *system-wide* (not recommended for development builds) then run
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    86
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    87
{{{
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    88
cmake -DCMAKE_BUILD_TYPE="RELEASE" -DNOSERVER=1
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    89
sudo make install
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    90
}}}
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
    91
493
300f6d2615ce Copy-editing.
almikes@aol.com
parents: 396
diff changeset
    92
*Important*: If you decided against png-screenshots or video-recording support, please append `-DNOPNG=1` and/or `-DNOVIDEOREC=1` to the cmake command line respectively!
327
16e3a600d6af me VS. wiki syntax
sheepyluva@gmail.com
parents: 326
diff changeset
    93
493
300f6d2615ce Copy-editing.
almikes@aol.com
parents: 396
diff changeset
    94
If you want to build the server as well, change `-DNOSERVER=1` to `-DNOSERVER=0`
327
16e3a600d6af me VS. wiki syntax
sheepyluva@gmail.com
parents: 326
diff changeset
    95
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    96
493
300f6d2615ce Copy-editing.
almikes@aol.com
parents: 396
diff changeset
    97
then wait for the build to complete, then run …
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    98
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
    99
{{{
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
   100
~/games/bin/hedgewars
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
   101
}}}
395
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
   102
or just {{{hedgewars}}} if you did a system-wide install.
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
   103
493
300f6d2615ce Copy-editing.
almikes@aol.com
parents: 396
diff changeset
   104
You can also create a launcher for it on your desktop or on applications menu if you wish, using the `$HOME/games/bin/hedgewars` path
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
   105
493
300f6d2615ce Copy-editing.
almikes@aol.com
parents: 396
diff changeset
   106
== Build latest development code repository updates ==
395
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
   107
2ea04ea4594d Violated wiki page BuildingOnLinux through web user interface.
sheepyluva@gmail.com
parents: 389
diff changeset
   108
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
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
   109
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
   110
{{{
263
afcb38bfd761 Revert use of build dir. Nice idea, but breaks pas2c and confused people. Esp people who had done this before. For most people, a purge is adequate if they need to clean up. Heck, that's what unc0rr and I apparently do, or we would have noticed the pas2c thing earlier
kyberneticist@gmail.com
parents: 253
diff changeset
   111
cd ~/hg/hedgewars/trunk
afcb38bfd761 Revert use of build dir. Nice idea, but breaks pas2c and confused people. Esp people who had done this before. For most people, a purge is adequate if they need to clean up. Heck, that's what unc0rr and I apparently do, or we would have noticed the pas2c thing earlier
kyberneticist@gmail.com
parents: 253
diff changeset
   112
hg pull -u
afcb38bfd761 Revert use of build dir. Nice idea, but breaks pas2c and confused people. Esp people who had done this before. For most people, a purge is adequate if they need to clean up. Heck, that's what unc0rr and I apparently do, or we would have noticed the pas2c thing earlier
kyberneticist@gmail.com
parents: 253
diff changeset
   113
cmake .
129
751dee35e4f1 Created wiki page with build instruction for ubuntu
vittorio.giovara@gmail.com
parents:
diff changeset
   114
make install
686
9971f0387cd3 bump version
nemo
parents: 656
diff changeset
   115
}}}