The latest Minetest 5.4.0 was released last February 23, 2021. The binary can be downloaded at the official Minetest website at https://www.minetest.net/downloads/
. But if you want to impress your friends that you can compile Minetest from the source code, follow this guide :D
We need to do the following:
We need to have Microsoft Visual Studio 2015 or higher, cmake, vcpkg and git for windows.
I won’t cover the installation of Visual Studio or Git for Windows in this guide. You can get the git for windows at this site: https://gitforwindows.org/
.
After installing git for windows, we now need to install of vcpkg:
Create a folder at C:\src\
and right click, select Open GIT Bash/CLI here. You should now be at the C:\src\
directory:
$ git clone https://github.com/microsoft/vcpkg
$ .\vcpkg\bootstrap-vcpkg.bat --disableMetrics
The parameter --disableMetrics
will disallow vcpkg from phoning home to Micro$oft.
Installing the required and optional packages to build Minetest:
> vcpkg install irrlicht zlib curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit gmp jsoncpp --triplet x86-windows
> vcpkg install irrlicht zlib curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit gmp jsoncpp --triplet x64-windows
This ate about 3 GB of disk space.
The official Minetest git repository can be found at: https://github.com/minetest/minetest
. I just grabbed a compressed source code at the Releases page: https://github.com/minetest/minetest/archive/5.4.0.zip
. Extract the zip file with 7-zip or your favourite application for decompressing zip.
Alternatively you can git clone
the stable-5
branch, Open Git Bash/CLI:
$ git clone --branch stable-5 https://github.com/minetest/minetest
Cloning into 'minetest'...
remote: Enumerating objects: 25, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 71127 (delta 8), reused 10 (delta 4), pack-reused 71102
Receiving objects: 100% (71127/71127), 77.69 MiB | 1.20 MiB/s, done.
Resolving deltas: 100% (51145/51145), done.
1 . Open the CMAKE GUI at C:\src\vcpkg\downloads\tools\cmake-3.19.2-windows\cmake-3.19.2-win32-x86\bin\cmake-gui.exe
2 . Select Browse Source...
and select the directory that contains the minetest source code, eg. DIR/minetest
.
3 . Select Browse Build...
and select the directory that contains the minetest source code build directory, eg.DIR/minetest-build
.
4 . Click Configure
.
5 . Choose the visual Studio version that is currently installed and target platform (either x86 or x64 [default]). It needs to match the version of the installed dependencies.
6 . Choose Specify toolchain file for cross-compiling
.
7 . Click Next
.
8 . Select the vcpkg toolchain file e.g. C:\vcpkg\scripts\buildsystems\vcpkg.cmake
.
9 . Click Finish
.
10 . Wait until cmake have generated the build files.
11 . If there are any errors, solve them and hit Configure
.
12 . Click Generate
.
13 . Click Open Project
, Visual Studio should launch.
14 . Select target BUILD to Release
on Visual Studio and click BUILD > BUILD ALL
.
15 . Wait for it to build (mine took around 18 minutes).
16 . After the build, copy the bin/Releases
contents to bin
and click Build > Clean ALL_BUILD
to clean solution and free up around a gigabyte of disk space.
Run bin\minetest.exe
Note: The compiled Minetest does not contain the Minetest Game, it is only an engine.
References:
https://github.com/minetest/minetest#compile-minetest
Except where otherwise noted, this work is licensed under Creative Commons Attribution-ShareAlike 4.0 International License (http://creativecommons.org/licenses/by-sa/4.0/).