summaryrefslogtreecommitdiff
path: root/devel/LuaLS/Makefile
diff options
context:
space:
mode:
authorcos <cos>2024-03-26 14:47:37 +0100
committercos <cos>2024-06-22 16:48:04 +0200
commit47e8e69f44661f114c6e1ec7613dce92cc47dfb7 (patch)
treec8c5f5116ce6c73f40f01ab0530a05ca03a9474e /devel/LuaLS/Makefile
parent4cd2a8a356dd37dc4485ec36d88ac7bca3e7ef0c (diff)
downloadfreebsd-ports-LuaLS.zip
wip: devel/LuaLS: New port: LuaLSLuaLS
https://github.com/LuaLS/lua-language-server/issues/2361
Diffstat (limited to 'devel/LuaLS/Makefile')
-rw-r--r--devel/LuaLS/Makefile53
1 files changed, 53 insertions, 0 deletions
diff --git a/devel/LuaLS/Makefile b/devel/LuaLS/Makefile
new file mode 100644
index 000000000000..d473789fedcc
--- /dev/null
+++ b/devel/LuaLS/Makefile
@@ -0,0 +1,53 @@
+PORTNAME= LuaLS
+DISTVERSION= 3.9.3cos0
+CATEGORIES= devel
+
+# Unfortunately upstream has a crippling bug making it completely useless
+# unpatched. So is a bit pointless to set something like MASTER_SITES or
+# GH_PROJECT. Luckily the bug is trivial to solve, for details please see:
+# https://github.com/LuaLS/lua-language-server/issues/2318
+#
+# Set custom GIT_ variables to retrieve a patched working LuaLS version.
+GIT_REPO= ssh://anonymous@git.netizen.se/lua-language-server/
+GIT_BRANCH= fix/honour_configuration_capability-3.9.3
+
+BUILD_DEPENDS= ninja:devel/ninja
+PLIST_FILES= ${PREFIX}/bin/lua-language-server
+
+MAINTAINER= cos
+COMMENT= A language server that offers Lua language support
+WWW= https://github.com/LuaLS/lua-language-server/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+# "NO_CHECKSUM is a user variable and is not to be set in a port's Makefile."
+# Lets do it anyways!
+NO_CHECKSUM= yes
+BROKEN= Experimental packaging of upstream-buggy software
+
+# "NEVER override the "regular" targets unless you want to open a major can of
+# worms."
+do-fetch:
+ git clone "${GIT_REPO}" "${DISTDIR}/${PORTNAME}.git"
+
+do-extract:
+ # LuaLS lacks a proper release process. Due to these submodules, it can only be built from git.
+ mv "${DISTDIR}/${PORTNAME}.git" "${BUILD_WRKSRC}"
+ @(cd "${BUILD_WRKSRC}"; git checkout "${GIT_BRANCH}"; git submodule init; git submodule update)
+
+do-patch:
+ # https://github.com/LuaLS/lua-language-server/issues/2361
+ :> "${BUILD_WRKSRC}/3rd/bee.lua/test/test.lua"
+ :> "${BUILD_WRKSRC}/test.lua"
+
+do-build:
+ @(cd ${BUILD_WRKSRC}; ./make.sh)
+
+do-install:
+ # The installed bin will fail to launch, due to not finding `bootstrap.lua`.
+ ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/bin/lua-language-server ${STAGEDIR}/${PREFIX}/bin/
+ # ...and it also seems LuaLS expects the user to have write permissions where the langserv lives.
+# Can opened, worms everywhere!
+
+.include <bsd.port.mk>