2021-08-10 17:08:17 +02:00
|
|
|
TERMUX_PKG_HOMEPAGE="https://github.com/sumneko/lua-language-server"
|
|
|
|
TERMUX_PKG_DESCRIPTION="Sumneko Lua Language Server coded in Lua"
|
|
|
|
TERMUX_PKG_LICENSE="MIT"
|
2021-10-10 15:38:53 +02:00
|
|
|
TERMUX_PKG_MAINTAINER="MrAdityaAlok <dev.aditya.alok@gmail.com>"
|
2021-10-02 21:32:24 +02:00
|
|
|
TERMUX_PKG_VERSION=2.4.1
|
2021-10-10 17:51:17 +02:00
|
|
|
TERMUX_PKG_REVISION=4
|
2021-08-10 17:08:17 +02:00
|
|
|
TERMUX_PKG_SRCURL=https://github.com/sumneko/lua-language-server.git
|
2021-08-18 13:08:57 +02:00
|
|
|
TERMUX_PKG_GIT_BRANCH="${TERMUX_PKG_VERSION}"
|
2021-08-10 17:08:17 +02:00
|
|
|
TERMUX_PKG_BUILD_DEPENDS="libandroid-spawn"
|
|
|
|
TERMUX_PKG_HOSTBUILD=true
|
|
|
|
|
|
|
|
termux_step_host_build() {
|
|
|
|
termux_setup_ninja
|
|
|
|
|
|
|
|
cd $TERMUX_PKG_SRCDIR/3rd/luamake
|
|
|
|
./compile/install.sh
|
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_make() {
|
|
|
|
cd $TERMUX_PKG_SRCDIR
|
|
|
|
./3rd/luamake/luamake -cc "${CC}" -flags "${CFLAGS} ${CPPFLAGS}" -hostos "android"
|
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_make_install() {
|
|
|
|
cd $TERMUX_PKG_SRCDIR
|
|
|
|
|
|
|
|
local INSTALL_DIR="${TERMUX_PREFIX}/lib/lua-language-server"
|
|
|
|
|
2021-10-02 21:32:24 +02:00
|
|
|
cat >"lua-language-server" <<-EOF
|
2021-08-10 17:08:17 +02:00
|
|
|
#!${TERMUX_PREFIX}/bin/bash
|
|
|
|
|
|
|
|
if [ "\$1" = "--start-lsp" ]; then
|
|
|
|
# use wrapper because lsp paths are relative
|
|
|
|
exec ${INSTALL_DIR}/lua-language-server -E ${INSTALL_DIR}/main.lua
|
|
|
|
elif [ "\$1" = "-h" ] || [ "\$1" = "--help" ]; then
|
|
|
|
echo -e "\n\e[32mTo start language server use --start-lsp\e[39m\n"
|
|
|
|
exec ${INSTALL_DIR}/lua-language-server "\$@"
|
|
|
|
else
|
|
|
|
exec ${INSTALL_DIR}/lua-language-server "\$@"
|
|
|
|
fi
|
|
|
|
EOF
|
|
|
|
|
|
|
|
install -Dm755 ./lua-language-server "${TERMUX_PREFIX}/bin"
|
|
|
|
|
|
|
|
mkdir -p "${INSTALL_DIR}"
|
|
|
|
install -Dm755 ./bin/Android/* "${INSTALL_DIR}"
|
|
|
|
cp -r ./script ./meta ./tools ./platform.lua ./locale ./debugger.lua ./main.lua "${INSTALL_DIR}"
|
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_create_debscripts() {
|
2021-10-02 21:32:24 +02:00
|
|
|
cat >prerm <<-EOF
|
2021-08-10 17:08:17 +02:00
|
|
|
#!${TERMUX_PREFIX}/bin/bash
|
2021-09-10 18:33:36 +02:00
|
|
|
if [ "$TERMUX_PACKAGE_FORMAT" != "pacman" ] && [ "\$1" != "remove" ]; then exit 0; fi
|
2021-08-10 17:08:17 +02:00
|
|
|
|
2021-10-02 21:32:24 +02:00
|
|
|
# log files created by lsp is not removed automatically
|
2021-09-10 18:33:36 +02:00
|
|
|
rm -rf "${TERMUX_PREFIX}/lib/lua-language-server"
|
2021-08-10 17:08:17 +02:00
|
|
|
EOF
|
|
|
|
}
|