Hedgewars 0.9.16 for Slackware

No replies
Blackflame
User offline. Last seen 1 week 5 days ago. Offline
Joined: 08/09/2011
Posts: 16

I have tried to compile Hedgewars 0.9.16 under Slackware Linux 13.37. There were some problems which also were successfully solved. I'm about to share the instructions I used; additions and editions are welcomed.

Speaking briefly, the problems are the following. An error:

Quote:
/usr/bin/ld: cannot find -llua.a

Two warnings:
Quote:
hwengine.pas(164,68) Warning: range check error while evaluating constants
Linking ../bin/hwengine
/usr/bin/ld: warning: ../bin/link.res contains output sections; did you forget -T?

The problem with liblua.a was already discussed:
http://www.hedgewars.org/node/2041
Nevertheless, I will give a complete instruction and show once again how to overcome it. The warning from ld is usual and not critical. The warning with "hwengine.pas" seems not critical, but needs investigation.

I suppose the reader knows how to use a terminal emulator and how to run console commands. Also I think that the reader understands what the instructions below do and can easily modify them if necessary (for example, if he decides to use the latest versions of Free Pascal and Lua, or if he doesn't know the password of his superuser).

1. To install dependencies, download Free Pascal and compile Lua. Since Free Pascal is written in Free Pascal language, binaries are required, which can be officially taken from
http://www.freepascal.org/down/i386/linux.var
Everything is very easy here, just unpack the archive and run the script "install.sh", answer a few questions by just pressing "Enter" key, for example.

In my case Free Pascal was installed into $HOME/fpc-2.4.4. If you have given another destination directory for Free Pascal, use it instead of $HOME/fpc-2.4.4. Pay attention that you need to run "install.sh" as a superuser if you want later to make install Hedgewars under root.

2. Lua source code can be downloaded officially from the following link:
http://www.lua.org/ftp/lua-5.1.4.tar.gz
Unpack it elsewhere, go into the subdirectory "src" and put there the following official patch:
http://www.lua.org/ftp/patch-lua-5.1.4-3
As they write, the patch should fix some errors after you apply it:

Quote:
$patch < patch-lua-5.1.4-3

Then you can return to the parent directory with Lua sources and compile Lua by running:
Quote:
$make linux

Check the building:
Quote:
$make test

If you see the message:
Quote:
src/lua test/hello.lua
Hello world, from Lua 5.1!

then you can think that Lua works, install it by running the standard command as a superuser:
Quote:
#make install

3. Download your favourite game:
http://download.gna.org/hedgewars/hedgewars-src-0.9.16.tar.bz2
Unpack the file, think of the directory where you want to install Hedgewars ($HOME/hedgewars in my case) and configure it (telling CMake where to find Free Pascal compiler):

Quote:
$PATH=$PATH:$HOME/fpc-2.4.4/bin cmake -DCMAKE_INSTALL_PREFIX="$HOME/hedgewars" -DDATA_INSTALL_DIR="$HOME" .

Warning: you must have write access to the directories where you install Hedgewars. If you did not install Free Pascal under root, you will not be able to compile or install Hedgewars as a superuser.

4. And now before compiling Hedgewars open "hedgewars/config.inc", find there the line "cLuaLibrary = 'liblua.a'" and replace it by "cLuaLibrary = 'liblua'" (i.e. remove the ".a"). If you try to do it after already running compilation you will not be able to compile it once again since pas-files are modified during compilation; in this case you will need to delete the source code and unpack the source archive again.

5. Go back to the parent directory with Hedgewars sources. Run compilation (together with installation, switch to superuser if necessary):

Quote:
$make install

I have got here two warnings:
Quote:
hwengine.pas(164,68) Warning: range check error while evaluating constants
Linking ../bin/hwengine
/usr/bin/ld: warning: ../bin/link.res contains output sections; did you forget -T?

They write that the warning from ld "is linked with the following: FPC generates a script for installer using an obsolete format. binutils are updated, FPC is not"
http://www.freepascal.ru/forum/viewtopic.php?f=5&t=5631
So, this seems to be useful and not critical.

The second warning blames the following line from the unit "hwengine", more exactly the symbol after ")":

Quote:
while SDL_PeepEvents(@event, 1, SDL_GETEVENT, SDL_ALLEVENTS) > 0 do

I have no ideas how to comment it, hoping the warning is under the control of the developers.

6. To run the game, type:

Quote:
$~/hedgewars/bin/hedgewars

replacing "~/hedgewars" with the directory where you have installed the game. Enjoy!

Copyright © 2004-2014 Hedgewars Project. All rights reserved.