luasocket
luasocket copied to clipboard
feature: MSYS2 support on src/makefile
Description
The changes in the src/makefile
allows to build luasocket on MSYS2 shells with the compiler toolchain for each environment:
-
mingw32
-
mingw64
-
ucrt64
-
clang32
-
clang64
-
clangarm64
How to test the changes
Initial setup of tools (only once)
- Go to https://www.msys2.org/, download the installer and install MSYS2;
- Type
ucrt64
on Windows start menu to open a MSYS2 shell for the ucrt64 environment listed above; - Update core system packages
pacman -Syuu
- Sync package database
pacman -Syuu
- Install useful linux tools, git, a C compiler and Lua 5.1:
pacman -S --needed base-devel git mingw-w64-ucrt-x86_64-cc mingw-w64-ucrt-x86_64-lua51
- Change to
/tmp
directory and clone my branchcd /tmp && git clone --branch=msys2-makefile https://github.com/luau-project/luasocket
- Leave the shell opened for the test
Test
- In the same shell above, build luasocket for ucrt64 environment:
make -C luasocket/src PLAT=msys2ucrt64 LUAV=5.1 all
- Install the library:
make -C luasocket/src PLAT=msys2ucrt64 LUAV=5.1 install
- Run a simple test
lua5.1 luasocket/test/hello.lua
- Enjoy.
[!NOTE]
Lua C modules get installed at
/ucrt64/lib/lua/5.1
and .lua files at/ucrt64/share/lua/5.1
for the ucrt64 environment, in case you want to remove them.
Extra
If you guys want, I can contribute a Github workflow to test luasocket on MSYS2 tools.