User Tools

Site Tools


stk_compile

how to get/compile latest version of STK

Linux

In a terminal

Before you install

sudo apt get install subversion git build-essential cmake

Get the source

We assume you install the game in $HOME/games

mkdir games
cd games

# get the code (here, use the command you'll find in the list of the forks for using a modified version)
# (fetch official code)
git clone https://github.com/supertuxkart/stk-code supertuxkart.git

# get the assets
svn co https://svn.code.sf.net/p/supertuxkart/code/stk-assets stk-assets

See the list of active forks to use a fork (or a future feature) of SuperTuxKart.

Compile

cd supertuxkart.git
mkdir _build
cd _build
cmake ..
make

Run the game

Once the compilation is done, you can run the game.

./bin/supertuxkart

Source : https://github.com/supertuxkart/stk-code/blob/master/INSTALL.md

Create a launcher

First scenario : you install git version as main version

(the current dir shall be _build)
If you install git version as main version just use sudo make install.

Second scenario : you don't want to install as super user (sudo)

(the current dir shall be _build)
FIXME this method doesn't work well yet, the user have to lauch the app from stk source dir If you install git version as main version use :

sed -i "s|\(set(CMAKE_INSTALL_PREFIX \).*|\1\"$HOME/.local\")|" cmake_install.cmake
make install 

Third scenario : you want to keep installed files inplace (user's home)

For terminal

To create a launcher you can edit a file in games/ named 'supertuxkart_git.sh' (you can move it anywhere):

supertuxkart() {
  _STKDIR="$(locate supertuxkart.git/_build/bin | head -1)"
  [ -z "$_STKDIR" ] && exit 1
  pushd $(dirname $_STKDIR)
  if [ -z "$(find . -name supertuxkart -executable 2> /dev/null)" ]; then
     make
  fi
  ./bin/supertuxkart  $@
  popd
}
supertuxkart $@

Finally set rights to execute the file

chmod +x supertuxkart_git.sh
For using in menus

You'll have to create a file supertuxkart_git.desktop in ~/.local/share/applications

[Desktop Entry]
Name=SuperTuxKart
Icon=supertuxkart
GenericName=SuperTuxKart (latest)
Exec=~/games/supertuxkart_git.sh
Terminal=false
StartupNotify=false
Type=Application
Categories=Game;ArcadeGame;

Any suggestions / questions ?

Enter your comment. Wiki syntax is allowed:
 
/home/luffahxyek/www/wiki/supertuxkart/data/pages/stk_compile.txt · Last modified: 2020/07/13 10:25 by outchoutchou