dev-util/lua-language-server: make data persistent
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
store data in user-owned dirs instead of using a temporary dir Signed-off-by: tastytea <tastytea@tastytea.de>
This commit is contained in:
parent
08f3d593f7
commit
35f4f66c88
12
dev-util/lua-language-server/files/wrapper-r1.sh.in
Normal file
12
dev-util/lua-language-server/files/wrapper-r1.sh.in
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# some paths must be writable, so we put them into user-owned directories
|
||||||
|
|
||||||
|
DATAPATH="${XDG_DATA_HOME:-${HOME}/.local/share}/lua-language-server"
|
||||||
|
STATEPATH="${XDG_STATE_HOME:-${HOME}/.local/state}/lua-language-server"
|
||||||
|
mkdir --parents ${DATAPATH} ${STATEPATH}
|
||||||
|
|
||||||
|
exec EPREFIX/opt/lua-language-server/bin/lua-language-server \
|
||||||
|
-E EPREFIX/opt/lua-language-server/main.lua \
|
||||||
|
--logpath="${STATEPATH}/log" \
|
||||||
|
--metapath="${DATAPATH}/meta" \
|
||||||
|
"$@"
|
|
@ -0,0 +1,65 @@
|
||||||
|
# Copyright 2020-2022 Gentoo Authors
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
# TODO: unbundle deps, set flags correctly, verbose luamake, less sed hacks
|
||||||
|
|
||||||
|
EAPI=8
|
||||||
|
|
||||||
|
LUA_COMPAT=( lua{5-{1,3,4},jit} )
|
||||||
|
|
||||||
|
inherit lua-single ninja-utils toolchain-funcs
|
||||||
|
|
||||||
|
DESCRIPTION="A language server that offers Lua language support"
|
||||||
|
HOMEPAGE="https://github.com/sumneko/lua-language-server"
|
||||||
|
SRC_URI="https://github.com/sumneko/${PN}/releases/download/${PV}/${P}-submodules.zip -> ${P}.zip"
|
||||||
|
S="${WORKDIR}"
|
||||||
|
|
||||||
|
LICENSE="MIT"
|
||||||
|
SLOT="0"
|
||||||
|
KEYWORDS="~amd64"
|
||||||
|
IUSE="test"
|
||||||
|
REQUIRED_USE="${LUA_REQUIRED_USE}"
|
||||||
|
|
||||||
|
RESTRICT="!test? ( test )"
|
||||||
|
|
||||||
|
DEPEND="${LUA_DEPS}"
|
||||||
|
RDEPEND="${DEPEND}"
|
||||||
|
BDEPEND="
|
||||||
|
app-arch/unzip
|
||||||
|
dev-util/ninja
|
||||||
|
"
|
||||||
|
|
||||||
|
QA_PREBUILT="/opt/lua-language-server/bin/lua-language-server"
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
sed -i "s/^cc = gcc$/cc = $(tc-getCC)/" \
|
||||||
|
3rd/luamake/compile/ninja/linux.ninja || die
|
||||||
|
sed -i "/require \"make.detect_platform\"/a lm.cc = '$(tc-getCC)'" \
|
||||||
|
make.lua || die
|
||||||
|
sed -i "s/flags = \"-Wall -Werror\"/flags = \"-Wall ${CXXFLAGS}\"/" \
|
||||||
|
make/code_format.lua || die
|
||||||
|
|
||||||
|
sed "s/EPREFIX/${EPREFIX}/g" "${FILESDIR}"/wrapper-r1.sh.in > wrapper.sh || die
|
||||||
|
|
||||||
|
default
|
||||||
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
eninja -C 3rd/luamake -f compile/ninja/linux.ninja $(usex test '' 'luamake')
|
||||||
|
./3rd/luamake/luamake $(usex test '' 'all') || die
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
newbin wrapper.sh ${PN}
|
||||||
|
|
||||||
|
into /opt/${PN}
|
||||||
|
dobin bin/${PN}
|
||||||
|
|
||||||
|
insinto /opt/${PN}/bin
|
||||||
|
doins bin/main.lua
|
||||||
|
|
||||||
|
insinto /opt/${PN}
|
||||||
|
doins -r debugger.lua main.lua locale meta script
|
||||||
|
|
||||||
|
einstalldocs
|
||||||
|
}
|
Reference in New Issue
Block a user