From 642e701260372f4344abc35bbdc5f7105375533a Mon Sep 17 00:00:00 2001 From: Aditya Alok Date: Wed, 27 Oct 2021 22:18:39 +0530 Subject: [PATCH 1/7] lua-language-server: fix `CANNOT_LINK_EXECUTABLE` --- .../lua-language-server/android.patch.ondevice | 11 +++++++++++ .../bee.lua-project-common.patch | 7 +++---- packages/lua-language-server/build.sh | 15 +++++++++++---- .../{make.lua.patch => make.lua.nopatch} | 11 +++++++---- 4 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 packages/lua-language-server/android.patch.ondevice rename packages/lua-language-server/{make.lua.patch => make.lua.nopatch} (77%) diff --git a/packages/lua-language-server/android.patch.ondevice b/packages/lua-language-server/android.patch.ondevice new file mode 100644 index 000000000..37ebea5c2 --- /dev/null +++ b/packages/lua-language-server/android.patch.ondevice @@ -0,0 +1,11 @@ +--- lua-language-server/3rd/luamake/compile/ninja/android.ninja 2021-10-27 21:38:40.667928105 +0530 ++++ lua-language-server-patch/3rd/luamake/compile/ninja/android.ninja 2021-10-27 21:37:31.217928132 +0530 +@@ -116,7 +116,7 @@ + build $obj/source_bootstrap/progdir.obj: cxx_source_bootstrap $ + 3rd/bee.lua/bootstrap/progdir.cpp + rule link_luamake +- command = $cc $in -o $out -lm -ldl -Wl,-E -lstdc++ -s ++ command = $cc $in -o $out -lm -ldl -Wl,-E -lstdc++ -landroid-spawn -s + description = Link Exe $out + build $bin/luamake: link_luamake $obj/source_bootstrap/main.obj $ + $obj/source_bootstrap/progdir.obj $obj/source_bee/lua-seri.obj $ diff --git a/packages/lua-language-server/bee.lua-project-common.patch b/packages/lua-language-server/bee.lua-project-common.patch index 3163ee840..1e02083e0 100644 --- a/packages/lua-language-server/bee.lua-project-common.patch +++ b/packages/lua-language-server/bee.lua-project-common.patch @@ -1,11 +1,10 @@ --- lua-language-server/3rd/bee.lua/project/common.lua 2021-10-22 15:08:44.191055637 +0530 -+++ lua-language-server-patch/3rd/bee.lua/project/common.lua 2021-10-25 22:52:35.474777452 +0530 -@@ -45,6 +45,8 @@ ++++ lua-language-server-patch/3rd/bee.lua/project/common.lua 2021-10-27 20:49:53.575106308 +0530 +@@ -45,6 +45,7 @@ } }, android = { -+ flags ="-fPIC", -+ ldflags ="-L@TERMUX_PREFIX@/lib -landroid-spawn", ++ ldflags ="-landroid-spawn", sources = { "!bee/**_win.cpp", "!bee/**_osx.cpp", diff --git a/packages/lua-language-server/build.sh b/packages/lua-language-server/build.sh index bef611a11..3cc247724 100644 --- a/packages/lua-language-server/build.sh +++ b/packages/lua-language-server/build.sh @@ -13,6 +13,12 @@ TERMUX_PKG_BUILD_IN_SRC=true # https://github.com/actboy168/bee.lua/blob/32f65b92739fa236d87fc1b2e7617470d47f0355/bee/thread/spinlock.h#L14 TERMUX_PKG_BLACKLISTED_ARCHES="arm,i686" +termux_step_pre_configure() { + if [ "${TERMUX_ON_DEVICE_BUILD}" = true ]; then + patch --silent -p1 <"${TERMUX_PKG_BUILDER_DIR}"/android.patch.ondevice + fi +} + termux_step_host_build() { termux_setup_ninja @@ -20,16 +26,17 @@ termux_step_host_build() { cp -a "${TERMUX_PKG_SRCDIR}"/3rd/luamake 3rd/ cd 3rd/luamake - if [ "${TERMUX_ON_DEVICE_BUILD}" = true ]; then - sed -i "s/-lstdc++/-lc++_static -lc++abi -landroid-spawn/g" ./compile/ninja/android.ninja - fi ./compile/install.sh } termux_step_make() { + sed -i "s%\@FLAGS\@%${CFLAGS} ${CPPFLAGS}%g" "${TERMUX_PKG_BUILDER_DIR}"/make.lua.nopatch + sed -i "s%\@LDFLAGS\@%${LDFLAGS}%g" "${TERMUX_PKG_BUILDER_DIR}"/make.lua.nopatch + + patch --silent -p1 <"${TERMUX_PKG_BUILDER_DIR}"/make.lua.nopatch + "${TERMUX_PKG_HOSTBUILD_DIR}"/3rd/luamake/luamake \ -cc "${CC}" \ - -flags "${CFLAGS} ${CPPFLAGS}" \ -hostos "android" } diff --git a/packages/lua-language-server/make.lua.patch b/packages/lua-language-server/make.lua.nopatch similarity index 77% rename from packages/lua-language-server/make.lua.patch rename to packages/lua-language-server/make.lua.nopatch index b43b39762..cf4cba623 100644 --- a/packages/lua-language-server/make.lua.patch +++ b/packages/lua-language-server/make.lua.nopatch @@ -1,15 +1,18 @@ ---- a/make.lua 2021-10-22 13:27:28.381004922 +0530 -+++ b/make.lua 2021-10-22 13:30:47.541004846 +0530 -@@ -2,7 +2,7 @@ +--- lua-language-server/make.lua 2021-10-22 15:07:23.591055667 +0530 ++++ lua-language-server-patch/make.lua 2021-10-27 20:41:28.435106500 +0530 +@@ -2,7 +2,10 @@ local platform = require 'bee.platform' local exe = platform.OS == 'Windows' and ".exe" or "" -lm.bindir = "bin/"..platform.OS +lm.bindir = "bin/Android" ++ ++lm.flags = "@FLAGS@" ++lm.ldflags = "@LDFLAGS@" lm.EXE_DIR = "" lm:import "3rd/bee.lua/make.lua" -@@ -42,29 +42,7 @@ +@@ -42,29 +45,7 @@ output = lm.bindir.."/main.lua", } From 2ee5fbd234d384edc88577cbd8feba8046abbede Mon Sep 17 00:00:00 2001 From: Aditya Alok Date: Thu, 28 Oct 2021 00:04:35 +0530 Subject: [PATCH 2/7] lua-language-server: bump revision --- packages/lua-language-server/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/lua-language-server/build.sh b/packages/lua-language-server/build.sh index 3cc247724..8ae6d1218 100644 --- a/packages/lua-language-server/build.sh +++ b/packages/lua-language-server/build.sh @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Sumneko Lua Language Server coded in Lua" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="MrAdityaAlok " TERMUX_PKG_VERSION=2.4.5 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/sumneko/lua-language-server.git TERMUX_PKG_GIT_BRANCH="${TERMUX_PKG_VERSION}" TERMUX_PKG_BUILD_DEPENDS="libandroid-spawn" From 28771a5914ad318c57c0f6da53af72b3ada53627 Mon Sep 17 00:00:00 2001 From: Aditya Alok Date: Thu, 28 Oct 2021 01:07:08 +0530 Subject: [PATCH 3/7] lua-language-server: remove manual patch step --- packages/lua-language-server/build.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/lua-language-server/build.sh b/packages/lua-language-server/build.sh index 8ae6d1218..38b9d7315 100644 --- a/packages/lua-language-server/build.sh +++ b/packages/lua-language-server/build.sh @@ -14,12 +14,6 @@ TERMUX_PKG_BUILD_IN_SRC=true # https://github.com/actboy168/bee.lua/blob/32f65b92739fa236d87fc1b2e7617470d47f0355/bee/thread/spinlock.h#L14 TERMUX_PKG_BLACKLISTED_ARCHES="arm,i686" -termux_step_pre_configure() { - if [ "${TERMUX_ON_DEVICE_BUILD}" = true ]; then - patch --silent -p1 <"${TERMUX_PKG_BUILDER_DIR}"/android.patch.ondevice - fi -} - termux_step_host_build() { termux_setup_ninja From e2d8192560d565c68d2a6c7c556c357622d721a2 Mon Sep 17 00:00:00 2001 From: Aditya Alok Date: Thu, 28 Oct 2021 01:15:01 +0530 Subject: [PATCH 4/7] lua-language-server: sed and patch in pipe command --- packages/lua-language-server/build.sh | 7 +++---- .../{make.lua.nopatch => make.lua.diff} | 0 2 files changed, 3 insertions(+), 4 deletions(-) rename packages/lua-language-server/{make.lua.nopatch => make.lua.diff} (100%) diff --git a/packages/lua-language-server/build.sh b/packages/lua-language-server/build.sh index 38b9d7315..2aa0b544a 100644 --- a/packages/lua-language-server/build.sh +++ b/packages/lua-language-server/build.sh @@ -25,10 +25,9 @@ termux_step_host_build() { } termux_step_make() { - sed -i "s%\@FLAGS\@%${CFLAGS} ${CPPFLAGS}%g" "${TERMUX_PKG_BUILDER_DIR}"/make.lua.nopatch - sed -i "s%\@LDFLAGS\@%${LDFLAGS}%g" "${TERMUX_PKG_BUILDER_DIR}"/make.lua.nopatch - - patch --silent -p1 <"${TERMUX_PKG_BUILDER_DIR}"/make.lua.nopatch + sed \ + -e "s%\@FLAGS\@%${CFLAGS} ${CPPFLAGS}%g" "${TERMUX_PKG_BUILDER_DIR}"/make.lua.diff \ + -e "s%\@LDFLAGS\@%${LDFLAGS}%g" "${TERMUX_PKG_BUILDER_DIR}"/make.lua.diff | patch --silent -p1 "${TERMUX_PKG_HOSTBUILD_DIR}"/3rd/luamake/luamake \ -cc "${CC}" \ diff --git a/packages/lua-language-server/make.lua.nopatch b/packages/lua-language-server/make.lua.diff similarity index 100% rename from packages/lua-language-server/make.lua.nopatch rename to packages/lua-language-server/make.lua.diff From e1c980b84bad2b7106334a1837258579284fc720 Mon Sep 17 00:00:00 2001 From: Aditya Alok Date: Thu, 28 Oct 2021 01:26:40 +0530 Subject: [PATCH 5/7] lua-language-server: apply ondevice patch before host build --- ...atch.ondevice => android.patch.ondevice.beforehostbuild} | 0 packages/lua-language-server/build.sh | 6 ++++++ 2 files changed, 6 insertions(+) rename packages/lua-language-server/{android.patch.ondevice => android.patch.ondevice.beforehostbuild} (100%) diff --git a/packages/lua-language-server/android.patch.ondevice b/packages/lua-language-server/android.patch.ondevice.beforehostbuild similarity index 100% rename from packages/lua-language-server/android.patch.ondevice rename to packages/lua-language-server/android.patch.ondevice.beforehostbuild diff --git a/packages/lua-language-server/build.sh b/packages/lua-language-server/build.sh index 2aa0b544a..f0f246376 100644 --- a/packages/lua-language-server/build.sh +++ b/packages/lua-language-server/build.sh @@ -14,6 +14,12 @@ TERMUX_PKG_BUILD_IN_SRC=true # https://github.com/actboy168/bee.lua/blob/32f65b92739fa236d87fc1b2e7617470d47f0355/bee/thread/spinlock.h#L14 TERMUX_PKG_BLACKLISTED_ARCHES="arm,i686" +termux_step_pre_configure() { + if [ "${TERMUX_ON_DEVICE_BUILD}" = true ]; then + patch --silent -p1 <"${TERMUX_PKG_BUILDER_DIR}"/android.patch.ondevice.beforehostbuild + fi +} + termux_step_host_build() { termux_setup_ninja From e97dd8baff07bea94f49adb602c266552def9cc4 Mon Sep 17 00:00:00 2001 From: Aditya Alok Date: Thu, 28 Oct 2021 01:35:46 +0530 Subject: [PATCH 6/7] lua-language-server: update patch logic --- packages/lua-language-server/build.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/lua-language-server/build.sh b/packages/lua-language-server/build.sh index f0f246376..c4a824192 100644 --- a/packages/lua-language-server/build.sh +++ b/packages/lua-language-server/build.sh @@ -14,13 +14,19 @@ TERMUX_PKG_BUILD_IN_SRC=true # https://github.com/actboy168/bee.lua/blob/32f65b92739fa236d87fc1b2e7617470d47f0355/bee/thread/spinlock.h#L14 TERMUX_PKG_BLACKLISTED_ARCHES="arm,i686" -termux_step_pre_configure() { +_patch() { if [ "${TERMUX_ON_DEVICE_BUILD}" = true ]; then + current_dir=$(pwd) + + cd "${TERMUX_PKG_SRCDIR}" patch --silent -p1 <"${TERMUX_PKG_BUILDER_DIR}"/android.patch.ondevice.beforehostbuild + + cd "${current_dir}" fi } termux_step_host_build() { + _patch termux_setup_ninja mkdir 3rd @@ -32,8 +38,9 @@ termux_step_host_build() { termux_step_make() { sed \ - -e "s%\@FLAGS\@%${CFLAGS} ${CPPFLAGS}%g" "${TERMUX_PKG_BUILDER_DIR}"/make.lua.diff \ - -e "s%\@LDFLAGS\@%${LDFLAGS}%g" "${TERMUX_PKG_BUILDER_DIR}"/make.lua.diff | patch --silent -p1 + -e "s%\@FLAGS\@%${CFLAGS} ${CPPFLAGS}%g" \ + -e "s%\@LDFLAGS\@%${LDFLAGS}%g" \ + "${TERMUX_PKG_BUILDER_DIR}"/make.lua.diff | patch --silent -p1 "${TERMUX_PKG_HOSTBUILD_DIR}"/3rd/luamake/luamake \ -cc "${CC}" \ From 67193538872387bc5bfa2741a065d8df6e5af632 Mon Sep 17 00:00:00 2001 From: Aditya Alok Date: Sat, 30 Oct 2021 18:55:22 +0530 Subject: [PATCH 7/7] lua-language-server: update to 2.4.6 --- packages/lua-language-server/build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/lua-language-server/build.sh b/packages/lua-language-server/build.sh index c4a824192..dc271753d 100644 --- a/packages/lua-language-server/build.sh +++ b/packages/lua-language-server/build.sh @@ -2,8 +2,7 @@ TERMUX_PKG_HOMEPAGE="https://github.com/sumneko/lua-language-server" TERMUX_PKG_DESCRIPTION="Sumneko Lua Language Server coded in Lua" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="MrAdityaAlok " -TERMUX_PKG_VERSION=2.4.5 -TERMUX_PKG_REVISION=1 +TERMUX_PKG_VERSION=2.4.6 TERMUX_PKG_SRCURL=https://github.com/sumneko/lua-language-server.git TERMUX_PKG_GIT_BRANCH="${TERMUX_PKG_VERSION}" TERMUX_PKG_BUILD_DEPENDS="libandroid-spawn"