Files

94 lines
3.6 KiB
Tcl
Raw Permalink Normal View History

# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup github 1.0
2023-03-11 02:22:35 -07:00
PortGroup lua 1.0
name lua-luarocks
2023-03-11 02:14:38 -07:00
github.setup luarocks luarocks 3.9.2 v
2025-01-24 03:48:34 +11:00
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
2023-03-11 02:14:38 -07:00
revision 0
license MIT
categories lua devel
maintainers {l2dy @l2dy} openmaintainer
supported_archs noarch
2022-12-04 22:06:20 +11:00
platforms any
description Manager for rocks, lua extensions.
long_description \
LuaRocks is a deployment and management system for Lua modules that allows \
you to install self-contained modules (\"rocks\") which also contain \
version dependency information. It handles both install time dependencies \
and runtime version check. LuaRocks supports local and remote \
repositories, and multiple local rocks trees.
homepage https://luarocks.org/
2023-03-11 02:14:38 -07:00
checksums rmd160 4ddf475e1934d6c6de351b91d7787750b84afa9a \
sha256 1097a4c8394454b8777823a72e44e88e1bd8015f5022ac8101af6333a315864e \
size 5350213
2023-03-11 02:22:35 -07:00
patchfiles patch-src_luarocks_core_cfg.diff
post-patch {
reinplace "s|%PREFIX%|${prefix}|g" ${worksrcpath}/src/luarocks/core/cfg.lua
}
2023-03-11 02:22:35 -07:00
use_parallel_build no
2023-03-11 02:22:35 -07:00
foreach branch ${lua.branches} {
subport lua[join [split ${branch} .] ""]-luarocks {
lua.version ${branch}
post-destroot {
2023-03-11 02:22:35 -07:00
# only install the Lua module files
foreach dir {bin etc} {
delete ${destroot}${prefix}/${dir}
}
}
2023-03-11 02:22:35 -07:00
livecheck.type none
}
}
2023-03-11 02:22:35 -07:00
subport lua-luarocks {
destroot.keepdirs ${destroot}${prefix}/share/luarocks
depends_run-append port:lua[join [split ${lua.default_version} .] ""]-luarocks
post-destroot {
# delete the Lua module files since they are provided by a dependency
delete ${destroot}${prefix}/share/lua
2023-03-11 02:22:35 -07:00
# rebuild with version specific values
delete ${build.dir}/build/config-${lua.default_version}.lua \
${destroot}${prefix}/etc/luarocks/config-${lua.default_version}.lua
# create config files for all Lua versions so that `luarocks --version` works properly
foreach branch ${lua.branches} {
lua.version ${branch} ; # this is dangerous because it is *not* correct for the rest of the build
system -W ${worksrcpath} \
"make -w install-config \
DESTDIR=${destroot} \
LUA_VERSION=${branch} \
LUA_BINDIR=[file dirname ${lua.bin}] \
LUA_DIR=${lua.dir} \
LUA_INCDIR=${lua.dir}/include \
LUA_LIBDIR=${lua.dir}/lib \
LUA_INTERPRETER=[file tail ${lua.bin}]"
# this is for compatibly only
# once all ports have been successfully moved to the new structure, this can be removed
foreach bin {luarocks luarocks-admin} {
ln -s ${prefix}/bin/${bin} \
${destroot}${prefix}/bin/${bin}-${branch}
}
}
}
}
2023-03-11 02:22:35 -07:00
configure.args --with-lua-bin=[file dirname ${lua.bin}] \
--with-lua=${lua.dir} \
--with-lua-include=${lua.dir}/include \
--with-lua-lib=${lua.dir}/lib \
--with-lua-interpreter=[file tail ${lua.bin}] \
--rocks-tree=${prefix}/share/luarocks