pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lua-language-server: assorted fixes, builds and runs



Module Name:	pkgsrc-wip
Committed By:	nikita <nikita%NetBSD.org@localhost>
Pushed By:	nikita
Date:		Wed Mar 29 20:55:12 2023 +0200
Changeset:	860c36caad027320332b9f70058a695c40401009

Modified Files:
	lua-language-server/DESCR
	lua-language-server/Makefile
	lua-language-server/PLIST
	lua-language-server/distinfo
	lua-language-server/patches/patch-make.lua
Added Files:
	lua-language-server/files/lua-language-server

Log Message:
lua-language-server: assorted fixes, builds and runs

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=860c36caad027320332b9f70058a695c40401009

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 lua-language-server/DESCR                     | 16 +++++++++++
 lua-language-server/Makefile                  | 38 +++++++++++++++++++--------
 lua-language-server/PLIST                     |  3 ++-
 lua-language-server/distinfo                  |  2 +-
 lua-language-server/files/lua-language-server |  8 ++++++
 lua-language-server/patches/patch-make.lua    |  3 +++
 6 files changed, 57 insertions(+), 13 deletions(-)

diffs:
diff --git a/lua-language-server/DESCR b/lua-language-server/DESCR
index e69de29bb2..46f3d7de1b 100644
--- a/lua-language-server/DESCR
+++ b/lua-language-server/DESCR
@@ -0,0 +1,16 @@
+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
diff --git a/lua-language-server/Makefile b/lua-language-server/Makefile
index cd9450389d..59b325fee8 100644
--- a/lua-language-server/Makefile
+++ b/lua-language-server/Makefile
@@ -17,8 +17,8 @@ MAKE_FLAGS+=		CC=${CC:Q}
 MAKE_FLAGS+=		CFLAGS=${CFLAGS:Q} -fPIC
 MAKE_FLAGS+=		LUA_VERSION=${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
 
-USE_TOOLS+=	pax
-TOOL_DEPENDS+=	ninja-build-[0-9]*:../../devel/ninja-build
+USE_TOOLS+=		pax mktemp
+TOOL_DEPENDS+=		ninja-build-[0-9]*:../../devel/ninja-build
 
 INSTALLATION_DIRS+=	share/lua-language-server/bin
 INSTALLATION_DIRS+=	bin
@@ -48,20 +48,36 @@ post-extract:
 .for name rev url path in ${GITDEPS}
 	${LN} -s ${WRKDIR}/${name}-${rev} ${WRKSRC}/3rd/${path}
 .endfor
-	cd ${WRKSRC}/3rd/luamake/3rd && ${RM} -rf bee.lua && ${LN} -s ${WRKDIR}/bee.lua-eff93259f6093645564aae1a530eb98e03e01677 bee.lua
+	cd ${WRKSRC}/3rd/luamake/3rd && \
+		${RM} -rf bee.lua && \
+		${LN} -s ${WRKDIR}/bee.lua-eff93259f6093645564aae1a530eb98e03e01677 bee.lua
+	${CP} ${FILESDIR}/lua-language-server ${WRKSRC}/lua-language-server
+
+.include "../../mk/bsd.prefs.mk"
+TMPPATH?=		/tmp
+DATADIR=		${PREFIX}/share/lua-language-server
+
+SUBST_CLASSES+=		wrapper
+SUBST_STAGE.wrapper=	pre-build
+SUBST_MESSAGE.wrapper=	Patching paths in lua-language-server wrapper script
+SUBST_FILES.wrapper=	lua-language-server
+SUBST_VARS.wrapper+=	TMPPATH
+SUBST_VARS.wrapper+=	MKTEMP
+SUBST_VARS.wrapper+=	DATADIR
 
 do-build:
 	ninja -C ${WRKSRC}/3rd/luamake -f compile/ninja/netbsd.ninja
-	cd ${WRKSRC} && ${MAKE_ENV} ./3rd/luamake/luamake -v
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./3rd/luamake/luamake -v
 
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/bin/lua-language-server ${DESTDIR}${PREFIX}/bin/
-	${INSTALL_SCRIPT} ${WRKSRC}/bin/main.lua ${DESTDIR}${PREFIX}/bin
-	${INSTALL_DATA} ${WRKSRC}/debugger.lua ${DESTDIR}${PREFIX}/share/lua-language-server
-	${INSTALL_DATA} ${WRKSRC}/main.lua ${DESTDIR}${PREFIX}/share/lua-language-server/bin
-	cd ${WRKSRC} && ${PAX} -rw locale ${DESTDIR}${PREFIX}/share/lua-language-server
-	cd ${WRKSRC} && ${PAX} -rw meta ${DESTDIR}${PREFIX}/share/lua-language-server
-	cd ${WRKSRC} && ${PAX} -rw script ${DESTDIR}${PREFIX}/share/lua-language-server
+	${INSTALL_SCRIPT} ${WRKSRC}/lua-language-server ${DESTDIR}${PREFIX}/bin
+	${INSTALL_PROGRAM} ${WRKSRC}/bin/lua-language-server ${DESTDIR}${DATADIR}/bin/
+	${INSTALL_SCRIPT} ${WRKSRC}/bin/main.lua ${DESTDIR}${DATADIR}/bin
+	${INSTALL_DATA} ${WRKSRC}/debugger.lua ${DESTDIR}${DATADIR}
+	${INSTALL_DATA} ${WRKSRC}/main.lua ${DESTDIR}${DATADIR}
+	cd ${WRKSRC} && ${PAX} -rw locale ${DESTDIR}${DATADIR}
+	cd ${WRKSRC} && ${PAX} -rw meta ${DESTDIR}${DATADIR}
+	cd ${WRKSRC} && ${PAX} -rw script ${DESTDIR}${DATADIR}
 
 .include "../../devel/libinotify/buildlink3.mk"
 .include "../../lang/lua/module.mk"
diff --git a/lua-language-server/PLIST b/lua-language-server/PLIST
index 4636cba61a..86102ca0ec 100644
--- a/lua-language-server/PLIST
+++ b/lua-language-server/PLIST
@@ -1,6 +1,6 @@
 @comment $NetBSD$
 bin/lua-language-server
-bin/main.lua
+share/lua-language-server/bin/lua-language-server
 share/lua-language-server/bin/main.lua
 share/lua-language-server/debugger.lua
 share/lua-language-server/locale/en-us/meta.lua
@@ -15,6 +15,7 @@ share/lua-language-server/locale/zh-cn/setting.lua
 share/lua-language-server/locale/zh-tw/meta.lua
 share/lua-language-server/locale/zh-tw/script.lua
 share/lua-language-server/locale/zh-tw/setting.lua
+share/lua-language-server/main.lua
 share/lua-language-server/meta/3rd/Cocos4.0/config.json
 share/lua-language-server/meta/3rd/Cocos4.0/library/cc/Action.lua
 share/lua-language-server/meta/3rd/Cocos4.0/library/cc/ActionCamera.lua
diff --git a/lua-language-server/distinfo b/lua-language-server/distinfo
index d936fbed89..66f24e67e0 100644
--- a/lua-language-server/distinfo
+++ b/lua-language-server/distinfo
@@ -27,4 +27,4 @@ Size (lua-language-server-3.6.9.tar.gz) = 3293832 bytes
 BLAKE2s (luamake-3d8d1fde146da293240e86c1b99ff00a7d865ac0.tar.gz) = 75ce61e1480ad34fd22c69bb9622921931ca49e58c983ff84e0d4969663434cb
 SHA512 (luamake-3d8d1fde146da293240e86c1b99ff00a7d865ac0.tar.gz) = 475aa1313f89b6f55580f90107add967447fc6f1c3f0fe86bd70ccb6316a4443fe5f0fcae8da8f04132911acac3493052677619fd3898d219b0ed725336554a4
 Size (luamake-3d8d1fde146da293240e86c1b99ff00a7d865ac0.tar.gz) = 56393 bytes
-SHA1 (patch-make.lua) = faca9c2ce30ada8c1a44e1204e8f2396da1afeea
+SHA1 (patch-make.lua) = bde49318c89fdd43c24db60206fe14cbafc38848
diff --git a/lua-language-server/files/lua-language-server b/lua-language-server/files/lua-language-server
new file mode 100644
index 0000000000..680ab1dee6
--- /dev/null
+++ b/lua-language-server/files/lua-language-server
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+TMPPATH=$(@MKTEMP@ -d '@TMPPATH@/lua-language-server.XXXXXX' || exit 1)
+
+exec '@DATADIR@/bin/lua-language-server' \
+    --logpath="@TMPPATH@/log" \
+    --metapath="@TMPPATH@/meta" \
+    "$@"
diff --git a/lua-language-server/patches/patch-make.lua b/lua-language-server/patches/patch-make.lua
index d5a2d40ab0..1f5ad6e8ef 100644
--- a/lua-language-server/patches/patch-make.lua
+++ b/lua-language-server/patches/patch-make.lua
@@ -1,3 +1,6 @@
+$NetBSD$
+
+
 --- make.lua.orig	2022-09-06 18:48:12 UTC
 +++ make.lua
 @@ -96,6 +96,5 @@ lm:build 'unit-test' {


Home | Main Index | Thread Index | Old Index