Introduction
Voici la méthode pour compiler et tester la dernière version stable de Luanti pour Debian. Je me suis basé sur les propositions du forum en anglais.
Par sécurité, la commande ne s’exécute que si le répertoire luanti n’existe pas déjà dans votre $HOME.
Compilation pour l’utilisateur courant (oneliner)
Pour exécution “in place”, c’est à dire que ce oneliner ne va pas installer Luanti, mais juste le compiler dans un répertoire à part pour le tester. Il n’y a donc pas besoin de désinstaller un éventuel Luanti ou Minetest existant.
Si vous préférez une installation multi-utilisateurs, allez à la section suivante.
Utilisation: copier / coller la ligne entière dans un terminal de votre Debian/Ubuntu/Mint, … et c’est tout. Avec PC récent et une bonne connexion ça prends 2 minutes. Un peu plus si le PC est plus lent.
Si vous désirez une version plus ancienne, n’hésitez pas à changer le LUANTI_VERION, par exemple commencez le oneliner avec LUANTI_VERSION=5.13.0 au lieu du curl
export LUANTI_VERSION=$(curl -s https://api.github.com/repos/luanti-org/luanti/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'); sudo apt-get update && sudo apt-get install -y git g++ make libc6-dev cmake libpng-dev libjpeg-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev libluajit-5.1-dev gettext libsdl2-dev && git clone --branch ${LUANTI_VERSION} https://github.com/luanti-org/luanti.git $HOME/luanti && cd $HOME/luanti/games && git clone --depth=1 https://github.com/luanti-org/minetest_game.git && cd .. && cmake . -DRUN_IN_PLACE=1 && make -j$(nproc) && bin/luanti && echo -e "\n\n\e[1;33mYou can run Luanti again by \"cd\"ing into this directory and typing \"bin/luanti\" in a terminal. You can create a shortcut and place it in an applications menu.\nYou can install mods in \"mods/\" inside this directory, too.\e[0m"
Utilisation
La première fois, Luanti va s’exécuter automatiquement. Si vous voulez l’exécuter par la suite:
$HOME/luanti/bin/luanti
Vu qu’il s’agit d’une installation avec exécution “in-place”, vous n’êtes pas obligé de désinstaller la version actuelle de Luanti, et les packs comme les textures sont dans un répertoire séparé (sous `$HOME/luanti`)
Compilation et installation en multi-user (root requis)
Utilisez le script suivant:
# Install dependencies
sudo apt-get update && sudo apt-get install -y git g++ make libc6-dev cmake libpng-dev libjpeg-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev libluajit-5.1-dev gettext libsdl2-dev
# Get the latest version tag
export LUANTI_VERSION=$(curl -s https://api.github.com/repos/luanti-org/luanti/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
# Clone the repo (temporarily, we'll remove it after install)
git clone --depth 1 --single-branch --branch ${LUANTI_VERSION} https://github.com/luanti-org/luanti.git /tmp/luanti-${LUANTI_VERSION}
cd /tmp/luanti-${LUANTI_VERSION}
# Optionally, clone games (like minetest_game) to a system games directory, e.g., /usr/local/share/games/luanti/games/
mkdir -p /usr/local/share/games/luanti/games
git clone --depth=1 https://github.com/luanti-org/minetest_game.git /usr/local/share/games/luanti/games/minetest_game
# Build and install to /usr/local
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DRUN_IN_PLACE=0
make -j$(nproc)
sudo make install
# Clean up
cd /tmp
rm -rf /tmp/luanti-${LUANTI_VERSION}
echo "Luanti ${LUANTI_VERSION} installed system-wide in /usr/local/bin"
echo "Users can now run 'luanti' from anywhere. Games are in /usr/local/share/games/luanti/games/"


2 responses to “Compilation du jeu Luanti sous Debian & Ubuntu”
CMake Error at irr/src/CMakeLists.txt:235 (find_package):
By not providing “FindSDL2.cmake” in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by “SDL2”, but
CMake did not find one.
Could not find a package configuration file provided by “SDL2” with any of
the following names:
SDL2Config.cmake
sdl2-config.cmake
Add the installation prefix of “SDL2” to CMAKE_PREFIX_PATH or set
“SDL2_DIR” to a directory containing one of the above files. If “SDL2”
provides a separate development package or SDK, be sure it has been
installed.
— Configuring incomplete, errors occurred!
See also “/home/user/luanti/CMakeFiles/CMakeOutput.log”.
Hi,
You might have a situation with the installation of your libsdl2 development headers. Try:
sudo apt-get install libsdl2-dev
Check if either SDL2Config.cmake or sdl2-config.cmake exists on your system:
dpkg -L libsdl2-dev | grep cmake
If you have the SDL depdendancy files in a non standard location, you can point to them with:
export SDL2_DIR=/usr/lib/x86_64-linux-gnu/cmake/SDL2
Before compilation.