2023-04-25 22:02:02 +02:00
|
|
|
|
# Compiling on GNU/Linux
|
|
|
|
|
|
|
|
|
|
## Dependencies
|
|
|
|
|
|
|
|
|
|
| Dependency | Version | Commentary |
|
2023-06-24 20:38:11 +02:00
|
|
|
|
| ---------- | ------- | ---------- |
|
2023-06-29 11:03:16 +02:00
|
|
|
|
| GCC | 7.5+ | or Clang 7.0.1+ |
|
2023-04-25 22:02:02 +02:00
|
|
|
|
| CMake | 3.5+ | |
|
2024-03-21 20:43:20 +01:00
|
|
|
|
| libjpeg | - | |
|
|
|
|
|
| libpng | - | |
|
|
|
|
|
| SDL | 2.x | |
|
2023-04-25 22:02:02 +02:00
|
|
|
|
| Freetype | 2.0+ | |
|
|
|
|
|
| SQLite3 | 3+ | |
|
2024-01-17 17:49:08 +01:00
|
|
|
|
| Zlib | - | |
|
2023-04-25 22:02:02 +02:00
|
|
|
|
| Zstd | 1.0+ | |
|
|
|
|
|
| LuaJIT | 2.0+ | Bundled Lua 5.1 is used if not present |
|
|
|
|
|
| GMP | 5.0.0+ | Bundled mini-GMP is used if not present |
|
|
|
|
|
| JsonCPP | 1.0.0+ | Bundled JsonCPP is used if not present |
|
2023-06-05 17:37:18 +02:00
|
|
|
|
| Curl | 7.56.0+ | Optional |
|
2023-06-24 20:38:11 +02:00
|
|
|
|
| gettext | - | Optional |
|
2023-04-25 22:02:02 +02:00
|
|
|
|
|
|
|
|
|
For Debian/Ubuntu users:
|
|
|
|
|
|
2024-08-11 14:27:41 +02:00
|
|
|
|
sudo apt install g++ make libc6-dev cmake libpng-dev libjpeg-dev libxi-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
|
2023-04-25 22:02:02 +02:00
|
|
|
|
|
|
|
|
|
For Fedora users:
|
|
|
|
|
|
2024-08-11 14:27:41 +02:00
|
|
|
|
sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libcurl-devel openal-soft-devel libpng-devel libjpeg-devel libvorbis-devel libXi-devel libogg-devel freetype-devel mesa-libGL-devel zlib-devel jsoncpp-devel gmp-devel sqlite-devel luajit-devel leveldb-devel ncurses-devel spatialindex-devel libzstd-devel gettext
|
2023-04-25 22:02:02 +02:00
|
|
|
|
|
2023-08-14 18:13:36 +02:00
|
|
|
|
For openSUSE users:
|
|
|
|
|
|
2024-08-11 14:27:41 +02:00
|
|
|
|
sudo zypper install gcc gcc-c++ cmake libjpeg8-devel libpng16-devel openal-soft-devel libcurl-devel sqlite3-devel luajit-devel libzstd-devel Mesa-libGL-devel libXi-devel libvorbis-devel freetype2-devel
|
2023-08-14 18:13:36 +02:00
|
|
|
|
|
2023-04-25 22:02:02 +02:00
|
|
|
|
For Arch users:
|
|
|
|
|
|
2024-08-11 14:27:41 +02:00
|
|
|
|
sudo pacman -S --needed base-devel libcurl-gnutls cmake libxi libpng sqlite libogg libvorbis openal freetype2 jsoncpp gmp luajit leveldb ncurses zstd gettext
|
2023-04-25 22:02:02 +02:00
|
|
|
|
|
|
|
|
|
For Alpine users:
|
|
|
|
|
|
2024-08-11 14:27:41 +02:00
|
|
|
|
sudo apk add build-base cmake libpng-dev jpeg-dev libxi-dev mesa-dev sqlite-dev libogg-dev libvorbis-dev openal-soft-dev curl-dev freetype-dev zlib-dev gmp-dev jsoncpp-dev luajit-dev zstd-dev gettext
|
2023-04-25 22:02:02 +02:00
|
|
|
|
|
2023-07-30 15:55:06 +02:00
|
|
|
|
For Void users:
|
|
|
|
|
|
2024-08-11 14:27:41 +02:00
|
|
|
|
sudo xbps-install cmake libpng-devel jpeg-devel libXi-devel mesa sqlite-devel libogg-devel libvorbis-devel libopenal-devel libcurl-devel freetype-devel zlib-devel gmp-devel jsoncpp-devel LuaJIT-devel zstd libzstd-devel gettext
|
2023-07-30 15:55:06 +02:00
|
|
|
|
|
2023-04-25 22:02:02 +02:00
|
|
|
|
## Download
|
|
|
|
|
|
|
|
|
|
You can install Git for easily keeping your copy up to date.
|
|
|
|
|
If you don’t want Git, read below on how to get the source without Git.
|
|
|
|
|
This is an example for installing Git on Debian/Ubuntu:
|
|
|
|
|
|
|
|
|
|
sudo apt install git
|
|
|
|
|
|
|
|
|
|
For Fedora users:
|
|
|
|
|
|
|
|
|
|
sudo dnf install git
|
|
|
|
|
|
|
|
|
|
For Arch users:
|
|
|
|
|
|
|
|
|
|
sudo pacman -S git
|
|
|
|
|
|
|
|
|
|
For Alpine users:
|
|
|
|
|
|
|
|
|
|
sudo apk add git
|
|
|
|
|
|
2023-07-30 15:55:06 +02:00
|
|
|
|
For Void users:
|
|
|
|
|
|
|
|
|
|
sudo xbps-install git
|
|
|
|
|
|
2023-04-25 22:02:02 +02:00
|
|
|
|
Download source (this is the URL to the latest of source repository, which might not work at all times) using Git:
|
|
|
|
|
|
|
|
|
|
git clone --depth 1 https://github.com/minetest/minetest.git
|
|
|
|
|
cd minetest
|
|
|
|
|
|
|
|
|
|
Download source, without using Git:
|
|
|
|
|
|
|
|
|
|
wget https://github.com/minetest/minetest/archive/master.tar.gz
|
|
|
|
|
tar xf master.tar.gz
|
|
|
|
|
cd minetest-master
|
|
|
|
|
|
|
|
|
|
## Build
|
|
|
|
|
|
|
|
|
|
Build a version that runs directly from the source directory:
|
|
|
|
|
|
|
|
|
|
cmake . -DRUN_IN_PLACE=TRUE
|
|
|
|
|
make -j$(nproc)
|
|
|
|
|
|
|
|
|
|
Run it:
|
|
|
|
|
|
|
|
|
|
./bin/minetest
|
|
|
|
|
|
|
|
|
|
- Use `cmake . -LH` to see all CMake options and their current state.
|
|
|
|
|
- If you want to install it system-wide (or are making a distribution package),
|
|
|
|
|
you will want to use `-DRUN_IN_PLACE=FALSE`.
|
|
|
|
|
- You can build a bare server by specifying `-DBUILD_SERVER=TRUE`.
|
|
|
|
|
- You can disable the client build by specifying `-DBUILD_CLIENT=FALSE`.
|
|
|
|
|
- You can select between Release and Debug build by `-DCMAKE_BUILD_TYPE=<Debug or Release>`.
|
|
|
|
|
- Debug build is slower, but gives much more useful output in a debugger.
|