Files
2026-06-23 00:52:24 +03:00

83 lines
2.5 KiB
Tcl

# -*- 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
PortGroup legacysupport 1.1
github.setup LuaLS lua-language-server 3.18.2
github.tarball_from releases
revision 0
categories lua devel
license MIT
maintainers {judaew @judaew} openmaintainer
description A language server that offers Lua language support
long_description {*}${description}
use_zip yes
extract.mkdir yes
distname ${name}-${version}-submodules
checksums rmd160 b5ae55e6d08212ff0f5fd0bf6a81e9eaa2a34779 \
sha256 cfb54fdf1d812e284477cb2e2d68a40de8b1c33e68e9073dd5d9d83165d97b33 \
size 32023745
depends_build-append port:ninja
compiler.c_standard 2011
compiler.cxx_standard 2017
configure {
# see https://trac.macports.org/wiki/UsingTheRightCompiler
set makefile [open "${worksrcpath}/make.lua" "a"]
puts $makefile ""
puts $makefile "lm.cc = '${configure.cc}'"
close $makefile
}
pre-build {
copy ${filespath}/wrapper ${worksrcpath}
reinplace "s,@@PREFIX@@,${prefix},g" ${worksrcpath}/wrapper
}
# FIXME: Using luamake from source tree instead of system package
#
# Normally, we would declare luamake as a build dependency:
# depends_build port:luamake
# build.cmd ${prefix}/bin/luamake rebuild
#
# However, the lua-language-server project uses a specific, unversioned
# development snapshot of luamake bundled in its 3rd/ directory.
# The system-installed luamake package (which is versioned) is incompatible
# with the build system expectations.
build {
system -W ${worksrcpath}/3rd/luamake "./compile/build.sh"
system -W ${worksrcpath} "3rd/luamake/luamake rebuild"
}
destroot {
xinstall -m 0755 ${worksrcpath}/wrapper ${destroot}${prefix}/bin/${name}
xinstall -d ${destroot}${prefix}/lib/${name}
move ${worksrcpath}/bin ${destroot}${prefix}/lib/${name}
move \
${worksrcpath}/debugger.lua \
${worksrcpath}/main.lua \
${worksrcpath}/locale \
${worksrcpath}/meta \
${worksrcpath}/script \
${destroot}${prefix}/lib/${name}
}
notes "
To use in Neovim, it is sufficient to specify cmd in lspconfig:
require'lspconfig'.lua_ls.setup \{
cmd = \{\"${prefix}/bin/${name}\"\};
\}
See more https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#sumneko_lua
"