From 55dec17a72221bd28f3b5cea29912a5d7a598ed0 Mon Sep 17 00:00:00 2001 From: its-pointless Date: Sat, 8 Jun 2019 09:53:52 +1000 Subject: [PATCH] fix luarocks and liblua --- packages/liblua/build.sh | 2 +- packages/liblua/fix-lua_tmpnametemplate.patch | 15 +++++++++------ packages/luarocks/GNUmakefile.patch | 11 +++++++++++ packages/luarocks/build.sh | 9 +++++++-- packages/luarocks/lua.lua.patch | 18 +++++++++--------- 5 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 packages/luarocks/GNUmakefile.patch diff --git a/packages/liblua/build.sh b/packages/liblua/build.sh index 61d39d18a..b79d350eb 100644 --- a/packages/liblua/build.sh +++ b/packages/liblua/build.sh @@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.lua.org/ TERMUX_PKG_DESCRIPTION="Shared library for the Lua interpreter" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=5.3.5 -TERMUX_PKG_REVISION=2 +TERMUX_PKG_REVISION=3 TERMUX_PKG_SHA256=0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac TERMUX_PKG_SRCURL=https://www.lua.org/ftp/lua-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_EXTRA_MAKE_ARGS=linux diff --git a/packages/liblua/fix-lua_tmpnametemplate.patch b/packages/liblua/fix-lua_tmpnametemplate.patch index 7ae2fae0c..b716e51d7 100644 --- a/packages/liblua/fix-lua_tmpnametemplate.patch +++ b/packages/liblua/fix-lua_tmpnametemplate.patch @@ -1,12 +1,15 @@ -diff -uNr lua-5.3.4/src/loslib.c lua-5.3.4.mod/src/loslib.c ---- lua-5.3.4/src/loslib.c 2016-07-18 20:58:58.000000000 +0300 -+++ lua-5.3.4.mod/src/loslib.c 2017-09-14 13:42:35.922862573 +0300 -@@ -115,7 +115,7 @@ - #define LUA_TMPNAMBUFSIZE 32 +--- ./src/loslib.c.orig 2019-06-07 23:19:03.666887235 +0000 ++++ ./src/loslib.c 2019-06-07 23:19:47.295164822 +0000 +@@ -112,10 +112,10 @@ + + #include + +-#define LUA_TMPNAMBUFSIZE 32 ++#define LUA_TMPNAMBUFSIZE 128 #if !defined(LUA_TMPNAMTEMPLATE) -#define LUA_TMPNAMTEMPLATE "/tmp/lua_XXXXXX" +#define LUA_TMPNAMTEMPLATE "@TERMUX_PREFIX@/tmp/lua_XXXXXX" #endif - #define lua_tmpnam(b,e) { \ + #define lua_tmpnam(b,e,s) { \ diff --git a/packages/luarocks/GNUmakefile.patch b/packages/luarocks/GNUmakefile.patch new file mode 100644 index 000000000..d1e191914 --- /dev/null +++ b/packages/luarocks/GNUmakefile.patch @@ -0,0 +1,11 @@ +--- ./GNUmakefile.orig 2019-06-07 23:32:53.163938603 +0000 ++++ ./GNUmakefile 2019-06-07 23:33:13.536058761 +0000 +@@ -52,7 +52,7 @@ + echo "unset LUA_PATH LUA_PATH_5_2 LUA_PATH_5_3 LUA_PATH_5_4" >> luarocks + echo 'LUAROCKS_SYSCONFDIR="$(luarocksconfdir)" LUA_PATH="$(CURDIR)/src/?.lua;;" exec "$(LUA)" "$(CURDIR)/src/bin/luarocks" --project-tree="$(CURDIR)/lua_modules" "$$@"' >> luarocks + chmod +rx ./luarocks +- ./luarocks init ++ ./luarocks init --lua-dir=$(PREFIX) + cp $(builddir)/config-$(LUA_VERSION).lua .luarocks/config-$(LUA_VERSION).lua + + luarocks-admin: config.unix diff --git a/packages/luarocks/build.sh b/packages/luarocks/build.sh index ab2ebe90f..dce8c7fb8 100644 --- a/packages/luarocks/build.sh +++ b/packages/luarocks/build.sh @@ -1,9 +1,9 @@ TERMUX_PKG_HOMEPAGE=https://luarocks.org/ TERMUX_PKG_DESCRIPTION="Deployment and management system for Lua modules" TERMUX_PKG_LICENSE="BSD" -TERMUX_PKG_VERSION=3.0.4 +TERMUX_PKG_VERSION=3.1.3 TERMUX_PKG_SRCURL=https://luarocks.org/releases/luarocks-${TERMUX_PKG_VERSION}.tar.gz -TERMUX_PKG_SHA256=1236a307ca5c556c4fed9fdbd35a7e0e80ccf063024becc8c3bf212f37ff0edf +TERMUX_PKG_SHA256=c573435f495aac159e34eaa0a3847172a2298eb6295fcdc35d565f9f9b990513 TERMUX_PKG_DEPENDS="curl, lua" TERMUX_PKG_BUILD_DEPENDS="liblua-dev" TERMUX_PKG_BUILD_IN_SRC=yes @@ -13,5 +13,10 @@ TERMUX_PKG_EXTRA_MAKE_ARGS="LUA=/usr/bin/lua5.3" termux_step_configure() { ./configure --prefix=$TERMUX_PREFIX \ --with-lua=$TERMUX_PREFIX \ + --with-lua-include=$TERMUX_PREFIX/include \ --lua-version=5.3 } +termux_step_post_massage() { + sed -i "1 s|$|lua|" bin/luarocks + sed -i "1 s|$|lua|" bin/luarocks-admin +} diff --git a/packages/luarocks/lua.lua.patch b/packages/luarocks/lua.lua.patch index a725d1958..feae10004 100644 --- a/packages/luarocks/lua.lua.patch +++ b/packages/luarocks/lua.lua.patch @@ -1,11 +1,11 @@ ---- ./src/luarocks/fs/lua.lua.orig 2019-03-10 15:14:28.333129223 +0100 -+++ ./src/luarocks/fs/lua.lua 2019-03-10 15:32:29.349788026 +0100 -@@ -961,7 +961,7 @@ - assert(type(name_pattern) == "string") - name_pattern = dir.normalize(name_pattern) - -- return posix.mkdtemp((os.getenv("TMPDIR") or "/tmp") .. "/luarocks_" .. name_pattern:gsub("/", "_") .. "-XXXXXX") -+ return posix.mkdtemp((os.getenv("TMPDIR") or "@TERMUX_PREFIX@/tmp") .. "/luarocks_" .. name_pattern:gsub("/", "_") .. "-XXXXXX") +--- ./src/luarocks/fs/lua.lua.orig 2019-06-07 22:33:12.441995154 +0000 ++++ ./src/luarocks/fs/lua.lua 2019-06-07 22:33:22.938066139 +0000 +@@ -259,7 +259,7 @@ end - end -- if posix.mkdtemp + function fs_lua.system_temp_dir() +- return os.getenv("TMPDIR") or os.getenv("TEMP") or "/tmp" ++ return os.getenv("TMPDIR") or os.getenv("TEMP") or "@TERMUX_PREFIX@/tmp" + end + + ---------------------------------------------------------------------