2023-10-20 23:17:54 +03:00
|
|
|
distributable:
|
|
|
|
url: https://github.com/luarocks/luarocks/archive/refs/tags/v{{version.raw}}.tar.gz
|
|
|
|
strip-components: 1
|
|
|
|
|
|
|
|
versions:
|
|
|
|
github: luarocks/luarocks/tags
|
|
|
|
strip: /v/
|
|
|
|
|
|
|
|
dependencies:
|
|
|
|
lua.org: '*'
|
|
|
|
info-zip.org/unzip: '*'
|
|
|
|
|
|
|
|
build:
|
|
|
|
dependencies:
|
|
|
|
gnu.org/make: ^4
|
|
|
|
gnu.org/sed: ^4
|
|
|
|
script:
|
|
|
|
- ./configure $ARGS
|
|
|
|
- make --jobs {{ hw.concurrency }} install
|
|
|
|
- run: |
|
|
|
|
fix-shebangs.ts luarocks-admin luarocks
|
2024-05-09 23:46:35 +03:00
|
|
|
sed -i \
|
2023-10-20 23:17:54 +03:00
|
|
|
-e 's|\[\[{{prefix}}|debug.getinfo(1).source:match("@?(.*/)") .. \[\[..|g' \
|
|
|
|
luarocks-admin luarocks
|
|
|
|
working-directory: ${{prefix}}/bin
|
2024-05-09 23:46:35 +03:00
|
|
|
|
|
|
|
# luarocks config has fixed paths
|
|
|
|
- run: |
|
|
|
|
mv bin tbin
|
|
|
|
mkdir bin
|
|
|
|
working-directory: ${{prefix}}
|
|
|
|
- run: |
|
|
|
|
cat $PROP >luarocks
|
|
|
|
cat $PROP >luarocks-admin
|
|
|
|
chmod +x luarocks luarocks-admin
|
|
|
|
working-directory: ${{prefix}}/bin
|
|
|
|
prop: |
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
d="$(cd "$(dirname "$0")"/.. && pwd)"
|
|
|
|
x="$(basename "$0")"
|
|
|
|
|
|
|
|
cat >"$d/etc/luarocks/config-{{deps.lua.org.version.marketing}}.lua" <<EOF
|
|
|
|
-- LuaRocks configuration
|
|
|
|
|
|
|
|
rocks_trees = {
|
|
|
|
{ name = "user", root = home .. "/.luarocks" };
|
|
|
|
{ name = "system", root = "${PKGX_DIR:-$HOME/.pkgx}/luarocks.org/v{{version}}" };
|
|
|
|
}
|
|
|
|
variables = {
|
|
|
|
LUA_DIR = "${PKGX_DIR:-$HOME/.pkgx}/lua.org/v{{deps.lua.org.version.marketing}}";
|
|
|
|
LUA_BINDIR = "${PKGX_DIR:-$HOME/.pkgx}/lua.org/v{{deps.lua.org.version.marketing}}/bin";
|
|
|
|
LUA_VERSION = "{{deps.lua.org.version.marketing}}";
|
|
|
|
LUA = "${PKGX_DIR:-$HOME/.pkgx}/lua.org/v{{deps.lua.org.version.marketing}}/bin/lua";
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
exec "$d/tbin/$x" "$@"
|
2023-10-20 23:17:54 +03:00
|
|
|
env:
|
|
|
|
ARGS:
|
|
|
|
- --prefix="{{prefix}}"
|
|
|
|
- --sysconfdir="{{prefix}}/etc"
|
|
|
|
- --rocks-tree="{{prefix}}"
|
|
|
|
- --force-config
|
|
|
|
- --disable-incdir-check
|
|
|
|
|
|
|
|
provides:
|
|
|
|
- bin/luarocks
|
|
|
|
- bin/luarocks-admin
|
|
|
|
|
2024-05-09 23:46:35 +03:00
|
|
|
test:
|
|
|
|
dependencies:
|
|
|
|
gnu.org/gcc: '*'
|
|
|
|
curl.se: '*'
|
|
|
|
script:
|
2024-05-10 01:14:50 +03:00
|
|
|
- run: EXTRA_ARGS="RT_LIBDIR=$(dirname $(find /usr/lib -name librt.a | head -n1))"
|
|
|
|
if: linux
|
2024-05-09 23:46:35 +03:00
|
|
|
- test "$(luarocks --version | awk 'NR==1 {print $NF}')" = "{{version.raw}}"
|
|
|
|
- luarocks install busted $EXTRA_ARGS
|