diff --git a/pages/Compiling_on_Windows_using_MSYS2.md b/pages/Compiling_on_Windows_using_MSYS2.md index 2ff516e..fae5cd9 100644 --- a/pages/Compiling_on_Windows_using_MSYS2.md +++ b/pages/Compiling_on_Windows_using_MSYS2.md @@ -13,27 +13,27 @@ After installation, a terminal opens. Run the following command to update the en pacman -Syu ``` -The terminal will then ask you to close it when done. Proceed with doing so, and then go to the start menu and run MSYS MINGW64 (the one with a blue background). Run the commands below to install the necessary dependencies. +The terminal will then ask you to close it when done, proceed with doing so and then reopen the MSYS2 UCRT64 environment whose icon has a gold background. (For information on what the different environments do, see [Environments](https://www.msys2.org/docs/environments/) in MSYS2's documentation) ## Compiling First install all the necessary dependencies: ```bash -pacman -S git base-devel mingw-w64-x86_64-{toolchain,cmake,ninja,curl-winssl,libpng,libjpeg-turbo,freetype,libogg,libvorbis,sqlite3,openal,zstd,gettext,luajit} +pacman -S git mingw-w64-ucrt-x86_64-{gcc,cmake,ninja,curl-winssl,libpng,libjpeg-turbo,freetype,libogg,libvorbis,sqlite3,openal,zstd,gettext,luajit} ``` Navigate to some folder where you want to clone the Minetest repository. To get out of MSYS' home folder and into your regular users folder, you would want to enter something like this: ```bash -cd /c/Users//Documents +cd /c/Users/$USER/Desktop ``` Clone Minetest and IrrlichtMt: ```bash -git clone --depth 1 https://github.com/minetest/minetest.git +git clone --depth 1 https://github.com/minetest/minetest cd minetest -git clone --depth 1 https://github.com/minetest/irrlicht.git lib/irrlichtmt +git clone --depth 1 https://github.com/minetest/irrlicht lib/irrlichtmt ``` And start the building process: @@ -44,17 +44,15 @@ cmake .. -G Ninja ninja ``` -Once it's finished compiling, there should be a minetest.exe executable inside of `bin/` inside your Minetest folder. You can run it inside of the MINGW64 terminal by doing `../bin/minetest.exe`, but it will not work if you try to open the executable from Windows explorer, as the necessary DLLs aren't next to the executable. +Once it's finished compiling, there should be a minetest.exe executable inside of `bin/` inside your Minetest folder. You can run it inside of the MSYS2 environment by running `../bin/minetest.exe` in the terminal, but it will not work if you try to open the executable from Windows explorer, as the necessary DLLs aren't next to the executable. ## Bundling DLLs -For bundling DLLs, [mingw-bundledlls](https://github.com/mpreisler/mingw-bundledlls) will be used which is a Python script that will copy over any libraries the executable is linked against and put it next to the executable. +For bundling DLLs, you may want to use [msys2-bundledlls](https://github.com/rollerozxa/msys2-bundledlls) which is able to copy over any libraries the executable is linked against and put it next to the executable. -If you're lazy, run the following commands from the build directory to install Python and download the script: +If you're lazy, run the following commands from the build directory to download the script: ```bash -pacman -S mingw-w64-x86_64-python -curl https://raw.githubusercontent.com/mpreisler/mingw-bundledlls/master/mingw-bundledlls > ../mingw-bundledlls -chmod +x ../mingw-bundledlls +curl https://raw.githubusercontent.com/rollerozxa/msys2-bundledlls/master/bundledlls > ../bundledlls ``` When you have downloaded the script, usage is as such: @@ -63,7 +61,7 @@ When you have downloaded the script, usage is as such: ../mingw-bundledlls --copy ../bin/minetest.exe ``` -It will print out a list of libraries it has copied to the binary folder once finished. Now it should be possible to run the Minetest executable outside of the MINGW64 terminal. +It will print out a list of libraries it has copied to the binary folder once finished. Now it should be possible to run the Minetest executable outside of the MSYS2 environment. ## Notes @@ -71,9 +69,9 @@ It will print out a list of libraries it has copied to the binary folder once fi If you have an existing MSYS2 install that has been dormant for a while without updates, you might run into issues trying to install or update packages as the keyring is outdated. See [this section](https://www.msys2.org/docs/updating/#potential-issues) on the MSYS2 website on how to solve this. ### Building 32-bit -The instructions above assume you want to build a 64-bit version of Minetest using MINGW64. If you want to build a 32-bit version of Minetest you would want to use the MINGW32 terminal (grey background). +If you want to build a 32-bit version of Minetest you would want to use the MINGW32 environment (grey background). -When installing dependencies, replace `x86-64` with `i686` to get their 32-bit counterpart. +When installing dependencies, use the `mingw-w64-i686-` prefix used for MINGW32 packages instead of `mingw-w64-ucrt-x86_64-`. ### Graphics is broken in a VM If you're doing this inside of a VM and you want to test the executable but get graphics issues due to a lack of hardware acceleration, you can try downloading the Mesa software renderer as a DLL. [Download the 64-bit version of the DLL here](https://fdossena.com/?p=mesa/index.frag) and put it next to the executable in `bin/`. It will be slow but should be usable for testing.