#!/bin/sh -ex rc-service networking start apk update apk add luarocks$maj.$min zip upx ln -s /usr/bin/luarocks-$maj.$min /usr/local/bin/luarocks # We can create the link, even if the file doesn't exist yet. When gcc links # it'll use the filename built into the binary, not the name of the link so # this is fine. ln -s /root/lua$maj$min.dll /root/liblua.dll luaver=$(ls lua-*.tar.gz | grep -Eo "lua-.\\..") mkdir "$luaver" tar -xvzf lua-*.tar.gz --directory="$luaver" --strip-components=1 rm /root/$luaver/src/*.c rm -rf /root/$luaver/doc rm -rf /root/$luaver/test rm -rf /root/$luaver/etc rm /root/*.tar.gz rm -rf /root/image-mingw64 luarocks config arch $arch luarocks config link_lua_explicitly true luarocks config variables.LUA_INCDIR /root/$luaver/src luarocks config lib_extension dll luarocks config external_lib_extension dll luarocks config variables.LIB_EXTENSION dll # Downstream is responsible for selecting the lua51.dll, whatever it's compiled for luarocks config variables.LUA_LIBDIR /root # Luarocks checks for liblua.so and liblua.a but gcc looks for liblua.dll # Can't use luarocks config because it sets it as a string echo "variables.LUA_LIBDIR_OK = true" >> "$(luarocks config config_files.nearest)" echo 'external_deps_dirs = {"/usr/x86_64-w64-mingw32"}' >> "$(luarocks config config_files.nearest)"