Last active
April 30, 2020 13:37
-
-
Save wbthomason/bbd5e1c0a4ba71e7fa9c54f3a6a18b99 to your computer and use it in GitHub Desktop.
Working lua-language-server-git PKGBUILD
This file contains hidden or 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
post_install() { | |
echo "=====================================================================" | |
echo "/usr/bin/lua-language-server is a wrapper script that can be used" | |
echo "directly (without arguments) by clients." | |
echo "=====================================================================" | |
} |
This file contains hidden or 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
# Contributor: Mohammad AlSaleh <CE.Mohammad.AlSaleh at gmail dot com> | |
# Updated by: Wil Thomason <[email protected]> | |
_pkgname="lua-language-server" | |
pkgname="$_pkgname-git" | |
pkgver=r2372.ad3baf56 | |
pkgrel=1 | |
license=('MIT') | |
pkgdesc='Lua Language Server coded by Lua' | |
url='https://github.com/sumneko/lua-language-server' | |
arch=('x86_64') | |
depends=('lua') | |
makedepends=('ninja' 'git') | |
source=(git+https://github.com/sumneko/$_pkgname | |
use-writeable-log-dir.patch) | |
sha512sums=(SKIP SKIP) | |
pkgver () { | |
cd $srcdir/$_pkgname | |
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" | |
} | |
prepare () { | |
cd $srcdir/$_pkgname | |
git submodule update --init --recursive | |
git apply $srcdir/use-writeable-log-dir.patch | |
} | |
build () { | |
cd $srcdir/$_pkgname | |
cd 3rd/luamake | |
ninja -f ninja/linux.ninja | |
cd ../.. | |
./3rd/luamake/luamake rebuild | |
} | |
package () { | |
cd $srcdir/$_pkgname | |
install -d $pkgdir/usr/share/$_pkgname/bin | |
install -d $pkgdir/usr/bin/ | |
cp -ra bin/Linux $pkgdir/usr/share/$_pkgname/bin/Linux | |
cp -a main.lua platform.lua debugger.lua $pkgdir/usr/share/$_pkgname | |
cp -ra libs $pkgdir/usr/share/$_pkgname | |
cp -ra locale $pkgdir/usr/share/$_pkgname | |
cp -ra script $pkgdir/usr/share/$_pkgname | |
echo -e "#!/bin/sh\ncd /usr/share/$_pkgname\nbin/Linux/lua-language-server -E ./main.lua" > $pkgdir/usr/bin/$_pkgname | |
chmod 755 $pkgdir/usr/bin/$_pkgname | |
} |
This file contains hidden or 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
diff --git a/main.lua b/main.lua | |
--- a/main.lua | |
+++ b/main.lua | |
@@ -10,7 +10,7 @@ collectgarbage("setpause", 100) | |
collectgarbage("setstepmul", 1000) | |
log = require 'log' | |
-log.init(ROOT, ROOT / 'log' / 'service.log') | |
+log.init(ROOT, fs.path('/tmp/lua-language-server') / 'log' / 'service.log') | |
log.info('Lua Lsp startup, root: ', ROOT) | |
log.debug('ROOT:', ROOT:string()) | |
ac = {} | |
diff --git a/script/workspace.lua b/script/workspace.lua | |
--- a/script/workspace.lua | |
+++ b/script/workspace.lua | |
@@ -186,7 +186,7 @@ function mt:init(rootUri) | |
end | |
log.info('Workspace inited, root: ', self.root) | |
log.info('Workspace inited, uri: ', rootUri) | |
- local logPath = ROOT / 'log' / (rootUri:gsub('[/:]+', '_') .. '.log') | |
+ local logPath = fs.path('/tmp/lua-language-server') / 'log' / (rootUri:gsub('[/:]+', '_') .. '.log') | |
log.info('Log path: ', logPath) | |
log.init(ROOT, logPath) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment