fix(luarocks)

closes #6568

thanks, @magnusviri!
This commit is contained in:
Jacob Heider 2024-07-01 10:58:04 -04:00 committed by Jacob Heider
parent 152b7b5103
commit 4ef8940db3
2 changed files with 27 additions and 0 deletions

View file

@ -13,6 +13,14 @@ provides:
- bin/lua - bin/lua
- bin/luac - bin/luac
companions:
luarocks.org: '*'
runtime:
env:
LUA_PATH: $LUA_PATH;{{prefix}}/share/lua/{{version.marketing}}/?.lua;{{prefix}}/share/lua/{{version.marketing}}/?/init.lua;{{prefix}}/lib/lua/{{version.marketing}}/?.lua;{{prefix}}/lib/lua/{{version.marketing}}/?/init.lua
LUA_CPATH: $LUA_CPATH;{{prefix}}/lib/lua/{{version.marketing}}/?.so;{{prefix}}/lib/lua/{{version.marketing}}/loadall.so
interprets: interprets:
extensions: lua extensions: lua
args: lua args: lua

View file

@ -10,6 +10,11 @@ dependencies:
lua.org: '*' lua.org: '*'
info-zip.org/unzip: '*' info-zip.org/unzip: '*'
runtime:
env:
LUA_PATH: $LUA_PATH;{{prefix}}/share/lua/{{deps.lua.org.version.marketing}}/?.lua;{{prefix}}/share/lua/{{deps.lua.org.version.marketing}}/?/init.lua;{{prefix}}/lib/lua/{{deps.lua.org.version.marketing}}/?.lua;{{prefix}}/lib/lua/{{deps.lua.org.version.marketing}}/?/init.lua
LUA_CPATH: $LUA_CPATH;{{prefix}}/lib/lua/{{deps.lua.org.version.marketing}}/?.so;{{prefix}}/lib/lua/{{deps.lua.org.version.marketing}}/loadall.so
build: build:
dependencies: dependencies:
gnu.org/make: ^4 gnu.org/make: ^4
@ -77,3 +82,17 @@ test:
if: linux if: linux
- test "$(luarocks --version | awk 'NR==1 {print $NF}')" = "{{version.raw}}" - test "$(luarocks --version | awk 'NR==1 {print $NF}')" = "{{version.raw}}"
- luarocks install busted $EXTRA_ARGS - luarocks install busted $EXTRA_ARGS
- run:
- luarocks install luasocket
- lua $FIXTURE
fixture:
extname: lua
content: |
local status, socket = pcall(require, "socket")
if status then
print("Socket module loaded successfully.")
else
print("Failed to load socket module.")
print("Error: " .. socket)
os.exit(1)
end