summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-17 10:00:14 +0800
committersumneko <sumneko@hotmail.com>2019-05-17 10:00:14 +0800
commit3a8883a4cff049f53efd618831563e71cb385992 (patch)
tree82f18aee7dcb6a296d09ec89151a36cfa6abcae2
parent739d3da09872336e94a9295f3a5cee357da8e8f2 (diff)
parent48064410cf7c8336c496cd034dc9d9e9f4684ed0 (diff)
downloadlua-language-server-3a8883a4cff049f53efd618831563e71cb385992.zip
Merge branch 'master' of https://github.com/sumneko/lua-language-server
-rwxr-xr-xlinux.sh41
-rw-r--r--make.lua13
-rw-r--r--make/install.lua12
3 files changed, 62 insertions, 4 deletions
diff --git a/linux.sh b/linux.sh
new file mode 100755
index 00000000..9603b376
--- /dev/null
+++ b/linux.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+set -e
+
+MY_DIR=$(cd "$(dirname $0)";pwd)
+cd $MY_DIR
+
+git submodule -q update --recursive --init
+
+## apt install ninja-build
+## apt install clang
+
+echo "build luamake ..."
+cd 3rd/luamake
+ninja -f ninja/linux.ninja
+cd $MY_DIR
+
+./3rd/luamake/luamake
+
+cd server
+mv bin/*.so .
+
+# avoid too many file opened error
+ulimit -n 4000
+
+./bin/lua-language-server publish.lua
+cd $MY_DIR
+
+# cp server/*.so publish/lua-language-server/server/
+
+## nvm install stable
+## nvm use stable
+## npm install -g vsce
+
+# cd publish/lua-language-server
+# vsce package
+
+
+## example of development environment
+## cp ~/lua-language-server/server/*.so ~/.vscode/extensions/sumneko.lua-0.9.4/server/
+## killall -9 lua-language-server; cp ~/lua-language-server/server/bin/lua-language-server ~/.vscode/extensions/sumneko.lua-0.9.4/server/bin/
diff --git a/make.lua b/make.lua
index a9262943..7193b654 100644
--- a/make.lua
+++ b/make.lua
@@ -1,4 +1,6 @@
+
local lm = require 'luamake'
+local platform = require "bee.platform"
lm:import '3rd/bee.lua/make.lua'
@@ -12,6 +14,10 @@ if lm.plat == 'macos' then
lua = 'lua'
includes = {'bee.lua/3rd/lua/src'}
lpeglabel_ldflags = nil
+elseif lm.plat == 'linux' then
+ lua = 'lua'
+ includes = {'bee.lua/3rd/lua/src'}
+ lpeglabel_ldflags = nil
end
lm:shared_library 'lni' {
@@ -19,7 +25,10 @@ lm:shared_library 'lni' {
sources = {
'lni/src/main.cpp',
},
- includes = includes
+ includes = includes,
+ links = {
+ platform.OS == "Linux" and "stdc++",
+ },
}
lm:shared_library 'lpeglabel' {
@@ -30,7 +39,7 @@ lm:shared_library 'lpeglabel' {
}
local rcedit = nil
-if lm.plat ~= 'macos' then
+if lm.plat ~= 'macos' and lm.plat ~= 'linux' then
rcedit = 'rcedit'
lm:executable 'rcedit' {
diff --git a/make/install.lua b/make/install.lua
index 4aa544de..3da8983d 100644
--- a/make/install.lua
+++ b/make/install.lua
@@ -3,6 +3,8 @@ local sp = require 'bee.subprocess'
local is_macos = package.cpath:sub(-3) == '.so'
+local platform = require "bee.platform"
+
local CWD = fs.current_path()
local output = CWD / 'server' / 'bin'
@@ -17,17 +19,23 @@ if is_macos then
exc_ext = ""
end
+if platform.OS == "Linux" then
+ bindir = CWD / 'build' / 'linux' / 'bin'
+ lib_ext = ".so"
+ exc_ext = ""
+end
+
fs.create_directories(output)
fs.copy_file(bindir / 'lni'..lib_ext, output / 'lni'..lib_ext, true)
fs.copy_file(bindir / 'lpeglabel'..lib_ext, output / 'lpeglabel'..lib_ext, true)
fs.copy_file(bindir / 'bee'..lib_ext, output / 'bee'..lib_ext, true)
fs.copy_file(bindir / 'lua'..exc_ext, output / 'lua-language-server'..exc_ext, true)
-if not is_macos then
+if not is_macos and platform.OS ~= "Linux" then
fs.copy_file(bindir / 'lua54'..lib_ext, output / 'lua54'..lib_ext, true)
end
-if not is_macos then
+if not is_macos and platform.OS ~= "Linux" then
local process = assert(sp.spawn {
bindir / 'rcedit.exe',
output / 'lua-language-server.exe',