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>"
|
2022-01-15 15:29:58 +01:00
|
|
|
TERMUX_PKG_VERSION=2.6.0
|
2022-03-19 17:25:01 +01:00
|
|
|
TERMUX_PKG_REVISION=2
|
2021-08-18 13:08:57 +02:00
|
|
|
TERMUX_PKG_GIT_BRANCH="${TERMUX_PKG_VERSION}"
|
2022-01-10 14:18:21 +01:00
|
|
|
TERMUX_PKG_SRCURL="https://github.com/sumneko/lua-language-server.git"
|
2022-03-19 17:25:01 +01:00
|
|
|
TERMUX_PKG_DEPENDS="libandroid-spawn"
|
2021-08-10 17:08:17 +02:00
|
|
|
TERMUX_PKG_HOSTBUILD=true
|
2021-10-10 18:57:46 +02:00
|
|
|
TERMUX_PKG_BUILD_IN_SRC=true
|
2021-08-10 17:08:17 +02:00
|
|
|
|
2022-01-10 14:18:21 +01:00
|
|
|
_patch_on_device() {
|
2021-10-27 21:56:40 +02:00
|
|
|
if [ "${TERMUX_ON_DEVICE_BUILD}" = true ]; then
|
2021-10-27 22:05:46 +02:00
|
|
|
current_dir=$(pwd)
|
|
|
|
|
|
|
|
cd "${TERMUX_PKG_SRCDIR}"
|
2022-02-08 15:24:11 +01:00
|
|
|
patch --silent -p1 <"${TERMUX_PKG_BUILDER_DIR}"/android.diff
|
2021-10-27 22:05:46 +02:00
|
|
|
|
|
|
|
cd "${current_dir}"
|
2021-10-27 21:56:40 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-08-10 17:08:17 +02:00
|
|
|
termux_step_host_build() {
|
2022-01-10 14:18:21 +01:00
|
|
|
_patch_on_device
|
2021-08-10 17:08:17 +02:00
|
|
|
termux_setup_ninja
|
2021-10-23 12:02:53 +02:00
|
|
|
|
2021-10-10 18:57:46 +02:00
|
|
|
mkdir 3rd
|
2021-10-25 17:52:01 +02:00
|
|
|
cp -a "${TERMUX_PKG_SRCDIR}"/3rd/luamake 3rd/
|
2021-10-23 12:02:53 +02:00
|
|
|
|
|
|
|
cd 3rd/luamake
|
2021-08-10 17:08:17 +02:00
|
|
|
./compile/install.sh
|
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_make() {
|
2021-10-27 21:45:01 +02:00
|
|
|
sed \
|
2021-10-27 22:05:46 +02:00
|
|
|
-e "s%\@FLAGS\@%${CFLAGS} ${CPPFLAGS}%g" \
|
|
|
|
-e "s%\@LDFLAGS\@%${LDFLAGS}%g" \
|
|
|
|
"${TERMUX_PKG_BUILDER_DIR}"/make.lua.diff | patch --silent -p1
|
2021-10-27 18:48:39 +02:00
|
|
|
|
2021-10-25 17:52:01 +02:00
|
|
|
"${TERMUX_PKG_HOSTBUILD_DIR}"/3rd/luamake/luamake \
|
2021-10-23 12:02:53 +02:00
|
|
|
-cc "${CC}" \
|
|
|
|
-hostos "android"
|
2021-08-10 17:08:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_make_install() {
|
2021-10-25 17:52:01 +02:00
|
|
|
local INSTALL_DIR="${TERMUX_PREFIX}/lib/${TERMUX_PKG_NAME}"
|
2021-08-10 17:08:17 +02:00
|
|
|
|
2021-10-25 17:52:01 +02:00
|
|
|
cat >"${TERMUX_PREFIX}/bin/${TERMUX_PKG_NAME}" <<-EOF
|
2021-08-10 17:08:17 +02:00
|
|
|
#!${TERMUX_PREFIX}/bin/bash
|
|
|
|
|
2021-10-25 19:59:51 +02:00
|
|
|
# After action of termux-elf-cleaner lua-language-server's binary(ELF) is unable to
|
|
|
|
# determine its version, so provide it manually.
|
2021-10-25 20:27:59 +02:00
|
|
|
if [ "\$1" = "--version" ]; then
|
2021-10-25 19:59:51 +02:00
|
|
|
echo "${TERMUX_PKG_NAME}: ${TERMUX_PKG_VERSION}"
|
2022-01-10 14:18:21 +01:00
|
|
|
else
|
2021-10-25 19:59:51 +02:00
|
|
|
TMPPATH=\$(mktemp -d "${TERMUX_PREFIX}/tmp/${TERMUX_PKG_NAME}.XXXX")
|
2021-08-10 17:08:17 +02:00
|
|
|
|
2022-01-10 14:18:21 +01:00
|
|
|
exec ${INSTALL_DIR}/bin/${TERMUX_PKG_NAME} \\
|
2021-10-25 19:59:51 +02:00
|
|
|
--logpath="\${TMPPATH}/log" \\
|
|
|
|
--metapath="\${TMPPATH}/meta" \\
|
|
|
|
"\${@}"
|
|
|
|
fi
|
2021-08-10 17:08:17 +02:00
|
|
|
|
2021-10-25 17:52:01 +02:00
|
|
|
EOF
|
2021-08-10 17:08:17 +02:00
|
|
|
|
2021-10-25 17:52:01 +02:00
|
|
|
chmod 744 "${TERMUX_PREFIX}/bin/${TERMUX_PKG_NAME}"
|
2021-08-10 17:08:17 +02:00
|
|
|
|
2022-01-10 14:18:21 +01:00
|
|
|
install -Dm744 -t "${INSTALL_DIR}"/bin ./bin/"${TERMUX_PKG_NAME}"
|
2021-10-25 17:52:01 +02:00
|
|
|
install -Dm644 -t "${INSTALL_DIR}" ./{main,debugger}.lua
|
2022-01-10 14:18:21 +01:00
|
|
|
install -Dm644 -t "${INSTALL_DIR}"/bin ./bin/main.lua
|
2021-10-25 17:52:01 +02:00
|
|
|
|
|
|
|
cp -r ./script ./meta ./locale "${INSTALL_DIR}"
|
2021-08-10 17:08:17 +02:00
|
|
|
}
|