Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This was difficult to port largely because of luamake, which: 1) Is itself built by a ninja definition file precompiled just for FreeBSD which doesn't work on FreeBSD. 2) Has no documentation whatsoever. I'd love to get rid of the BINARY_ALIAS= gcc=cc hack, but I have literally no idea where luamake picks up its compiler from. Any advice on the above is very welcome! sumneko, luamake (and associated dep bee.lua) went out of their way to try to support FreeBSD, so it'd be nice to get it working right without heavy patching. The Sumneko Lua Language Server is a comprehensive Lua development server. It functions as an LSP client, supporting: * Over 20 supported annotations for documenting your code * Go to definition * Dynamic type checking * Find references * Diagnostics/Warnings * Syntax checking * Element renaming * Hover to view details on variables, functions, and more * Autocompletion * Support for libraries * Code formatting * Spell checking * Custom plugins WWW: https://github.com/sumneko/lua-language-server
- Loading branch information
1 parent
4f1750e
commit 2da176f
Showing
8 changed files
with
184 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
PORTNAME= lua-language-server | ||
DISTVERSION= 3.5.4 | ||
CATEGORIES= devel | ||
|
||
MAINTAINER= adamw@FreeBSD.org | ||
COMMENT= Sumneko Lua development server and LSP client | ||
|
||
LICENSE= MIT | ||
LICENSE_FILE= ${WRKSRC}/LICENSE | ||
|
||
LIB_DEPENDS= libinotify.so:devel/libinotify | ||
|
||
USES= lua:build ninja:make | ||
USE_GITHUB= yes | ||
GH_ACCOUNT= sumneko | ||
GH_TUPLE= actboy168:bee.lua:301ad60:bee/3rd/bee.lua \ | ||
actboy168:luamake:db9d087:luamake/3rd/luamake \ | ||
cppcxy:EmmyLuaCodeStyle:f389817:emmyluacodestyle/3rd/EmmyLuaCodeStyle \ | ||
bjornbytes:lovr-docs:a6fc516:lovr/3rd/lovr-api \ | ||
love2d-community:love-api:69e7e01:love/3rd/love-api \ | ||
sqmedeiros:lpeglabel:b5d7638:lpeglabel/3rd/lpeglabel | ||
|
||
BINARY_ALIAS= gcc=${CC} | ||
SUB_FILES= lua-language-server | ||
PLIST_FILES= bin/lua-language-server \ | ||
${DATADIR_REL}/bin/lua-language-server \ | ||
${DATADIR_REL}/bin/main.lua \ | ||
${DATADIR_REL}/debugger.lua \ | ||
${DATADIR_REL}/main.lua | ||
PORTDATA= locale meta script | ||
|
||
post-extract: | ||
${CP} -rp ${WRKSRC}/3rd/bee.lua ${WRKSRC}/3rd/luamake/3rd | ||
|
||
post-patch: | ||
${REINPLACE_CMD} -e 's|%%CC%%|${CC}|; s|%%LOCALBASE%%|${LOCALBASE}|' \ | ||
${WRKSRC}/3rd/luamake/compile/ninja/freebsd.ninja \ | ||
${WRKSRC}/3rd/bee.lua/compile/common.lua | ||
|
||
do-build: | ||
${DO_MAKE_BUILD} -C ${WRKSRC}/3rd/luamake -f compile/ninja/freebsd.ninja | ||
cd ${WRKSRC} && ${MAKE_ENV} ./3rd/luamake/luamake -v | ||
|
||
do-install: | ||
${MKDIR} ${STAGEDIR}${DATADIR}/bin | ||
${INSTALL_SCRIPT} ${WRKDIR}/lua-language-server ${STAGEDIR}${PREFIX}/bin | ||
${INSTALL_PROGRAM} ${WRKSRC}/bin/lua-language-server ${STAGEDIR}${DATADIR}/bin | ||
${INSTALL_SCRIPT} ${WRKSRC}/bin/main.lua ${STAGEDIR}${DATADIR}/bin | ||
${INSTALL_DATA} ${WRKSRC}/debugger.lua ${STAGEDIR}${DATADIR} | ||
${INSTALL_DATA} ${WRKSRC}/main.lua ${STAGEDIR}${DATADIR} | ||
cd ${WRKSRC} && ${COPYTREE_SHARE} "locale meta script" ${STAGEDIR}${DATADIR} | ||
|
||
.include <bsd.port.mk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
TIMESTAMP = 1662484910 | ||
SHA256 (sumneko-lua-language-server-3.5.4_GH0.tar.gz) = bf1fd783051724fac46028eef018abb14a741db1b07d49a7e50770cb1cbb67a2 | ||
SIZE (sumneko-lua-language-server-3.5.4_GH0.tar.gz) = 3124118 | ||
SHA256 (actboy168-bee.lua-301ad60_GH0.tar.gz) = 8c51b059426c4cf3c5a6db33cc11f0dca44881e762dc5de238219312fe81971a | ||
SIZE (actboy168-bee.lua-301ad60_GH0.tar.gz) = 478403 | ||
SHA256 (actboy168-luamake-db9d087_GH0.tar.gz) = e8b538decaabe2d16da7cd71ace9dc45d8f4f4924608981420a5040bf1217282 | ||
SIZE (actboy168-luamake-db9d087_GH0.tar.gz) = 55438 | ||
SHA256 (cppcxy-EmmyLuaCodeStyle-f389817_GH0.tar.gz) = fac6f0a7fbbd0848ab9482ac9bc3fe535d31f02dc89285c4ba8c0c89f727cdbe | ||
SIZE (cppcxy-EmmyLuaCodeStyle-f389817_GH0.tar.gz) = 4242506 | ||
SHA256 (bjornbytes-lovr-docs-a6fc516_GH0.tar.gz) = 80dcf5a071c2bdb0f41c1f4b203600180aa499085ce090c124f353e4bb8249f1 | ||
SIZE (bjornbytes-lovr-docs-a6fc516_GH0.tar.gz) = 16640833 | ||
SHA256 (love2d-community-love-api-69e7e01_GH0.tar.gz) = 35263a7cb16256407c23155df915e2e0bb2054679f61e86572967eb9afbb04b5 | ||
SIZE (love2d-community-love-api-69e7e01_GH0.tar.gz) = 151635 | ||
SHA256 (sqmedeiros-lpeglabel-b5d7638_GH0.tar.gz) = e2285dac6ad9a2ffca17f5f9ed2f9a57d753b58d41194fc53df35b257bb453d2 | ||
SIZE (sqmedeiros-lpeglabel-b5d7638_GH0.tar.gz) = 82828 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
exec '%%DATADIR%%/bin/lua-language-server' "$@" |
30 changes: 30 additions & 0 deletions
30
devel/lua-language-server/files/patch-3rd_bee.lua_compile_common.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- 3rd/bee.lua/compile/common.lua.orig 2022-08-25 08:04:59 UTC | ||
+++ 3rd/bee.lua/compile/common.lua | ||
@@ -37,7 +37,7 @@ local function need(lst) | ||
end | ||
|
||
lm:source_set "source_bee" { | ||
- includes = ".", | ||
+ includes = {"%%LOCALBASE%%/include", "."}, | ||
sources = "bee/**/*.cpp", | ||
windows = { | ||
sources = need "win" | ||
@@ -152,8 +152,9 @@ lm:lua_source "source_bee" { | ||
sources = { | ||
"!binding/lua_unicode.cpp", | ||
}, | ||
+ includes = "%%LOCALBASE%%/include", | ||
links = "inotify", | ||
- ldflags = "-pthread" | ||
+ ldflags = {"-L%%LOCALBASE%%/lib", "-pthread"} | ||
}, | ||
} | ||
|
||
@@ -191,6 +192,6 @@ lm:source_set 'source_lua' { | ||
flags = "/wd4267" | ||
}, | ||
gcc = { | ||
- flags = "-Wno-maybe-uninitialized", | ||
+ flags = "-Wno-uninitialized", | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
devel/lua-language-server/files/patch-3rd_luamake_compile_ninja_freebsd.ninja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- 3rd/luamake/compile/ninja/freebsd.ninja.orig 2022-08-25 08:15:47 UTC | ||
+++ 3rd/luamake/compile/ninja/freebsd.ninja | ||
@@ -1,7 +1,7 @@ | ||
builddir = build/freebsd | ||
bin = $builddir/bin | ||
obj = $builddir/obj | ||
-cc = gcc | ||
+cc = %%CC%% | ||
luamake = luamake | ||
rule c_source_bee | ||
command = $cc -MMD -MT $out -MF $out.d -O2 -Wall -Werror $ | ||
@@ -23,7 +23,7 @@ build $obj/source_bee/format.obj: cxx_source_bee $ | ||
build $obj/source_bee/os.obj: cxx_source_bee 3rd/bee.lua/bee/nonstd/fmt/os.cc | ||
rule cxx_source_bee_1 | ||
command = $cc -MMD -MT $out -MF $out.d -std=c++17 -O2 -Wall -Werror $ | ||
- -fvisibility=hidden -I3rd/bee.lua -DNDEBUG -o $out -c $in | ||
+ -fvisibility=hidden -I3rd/bee.lua -I%%LOCALBASE%%/include -DNDEBUG -o $out -c $in | ||
description = Compile C++ $out | ||
deps = gcc | ||
depfile = $out.d | ||
@@ -49,7 +49,7 @@ build $obj/source_bee/path_helper.obj: cxx_source_bee_ | ||
rule cxx_source_bee_2 | ||
command = $cc -MMD -MT $out -MF $out.d -std=c++17 -O2 -Wall -Werror $ | ||
-fvisibility=hidden -I3rd/bee.lua/3rd/lua-seri -I3rd/bee.lua $ | ||
- -Itools/lua54 -DBEE_STATIC -DNDEBUG -o $out -c $in | ||
+ -Itools/lua54 -I%%LOCALBASE%%/include -DBEE_STATIC -DNDEBUG -o $out -c $in | ||
description = Compile C++ $out | ||
deps = gcc | ||
depfile = $out.d | ||
@@ -79,7 +79,7 @@ build $obj/source_lua/utf8_crt.obj: c_source_lua $ | ||
3rd/bee.lua/3rd/lua/utf8_crt.c | ||
rule c_source_lua_1 | ||
command = $cc -MMD -MT $out -MF $out.d -O2 -Wall -Werror -DMAKE_LIB $ | ||
- -DLUA_USE_LINUX -DNDEBUG -Wno-maybe-uninitialized -o $out -c $in | ||
+ -DLUA_USE_LINUX -DNDEBUG -Wno-uninitialized -o $out -c $in | ||
description = Compile C $out | ||
deps = gcc | ||
depfile = $out.d | ||
@@ -96,8 +96,7 @@ build $obj/source_bootstrap/main.obj: cxx_source_boots | ||
build $obj/source_bootstrap/progdir.obj: cxx_source_bootstrap $ | ||
3rd/bee.lua/bootstrap/progdir.cpp | ||
rule link_luamake | ||
- command = $cc $in -o $out -lm -Wl,-E -linotify -pthread -Wl,-Bstatic $ | ||
- -lstdc++ -Wl,-Bdynamic -static-libgcc -s | ||
+ command = $cc $in -o $out -lm -L%%LOCALBASE%%/lib -linotify -pthread -lstdc++ -s | ||
description = Link Exe $out | ||
build $bin/luamake: link_luamake $obj/source_bootstrap/main.obj $ | ||
$obj/source_bootstrap/progdir.obj $obj/source_bee/lua-seri.obj $ | ||
@@ -138,4 +137,4 @@ build luamake: copy | $bin/luamake | ||
build copy_script: phony $bin/main.lua | ||
build test: phony $obj/test.stamp | ||
build copy_luamake: phony luamake | ||
-default test copy_luamake | ||
+default copy_luamake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- make.lua.orig 2022-09-06 18:48:12 UTC | ||
+++ make.lua | ||
@@ -96,6 +96,5 @@ lm:build 'unit-test' { | ||
} | ||
|
||
lm:default { | ||
- "bee-test", | ||
- "unit-test", | ||
+ "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
The Sumneko Lua Language Server is a comprehensive Lua development | ||
server. It functions as an LSP client, supporting: | ||
|
||
* Over 20 supported annotations for documenting your code | ||
* Go to definition | ||
* Dynamic type checking | ||
* Find references | ||
* Diagnostics/Warnings | ||
* Syntax checking | ||
* Element renaming | ||
* Hover to view details on variables, functions, and more | ||
* Autocompletion | ||
* Support for libraries | ||
* Code formatting | ||
* Spell checking | ||
* Custom plugins | ||
|
||
WWW: https://github.com/sumneko/lua-language-server |