upgpkg(main/luarocks): to 3.9.1

- Also use lua-5.1 as default as it will allow users to use packages like
  neovim and luajit without any special configuration.

Closes(supersedes) #12535

Signed-off-by: Aditya Alok <alok@termux.dev>
This commit is contained in:
Aditya Alok 2022-11-01 01:23:31 +05:30
parent 5c8b6e6bf4
commit 3a726d529e
No known key found for this signature in database
GPG Key ID: 345AE134142077D8
4 changed files with 41 additions and 36 deletions

View File

@ -2,38 +2,40 @@ TERMUX_PKG_HOMEPAGE=https://luarocks.org/
TERMUX_PKG_DESCRIPTION="Deployment and management system for Lua modules"
TERMUX_PKG_LICENSE="BSD"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=3.8.0
TERMUX_PKG_VERSION=3.9.1
TERMUX_PKG_SRCURL=https://luarocks.org/releases/luarocks-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=56ab9b90f5acbc42eb7a94cf482e6c058a63e8a1effdf572b8b2a6323a06d923
TERMUX_PKG_DEPENDS="curl, lua53"
TERMUX_PKG_BUILD_DEPENDS="liblua53"
TERMUX_PKG_SHA256=ffafd83b1c42aa38042166a59ac3b618c838ce4e63f4ace9d961a5679ef58253
__LUA_VERSION=5.1 # Lua version against which it will be built.
# Do not use varible here since buildorder.py do not evaluate bash before reading.
TERMUX_PKG_DEPENDS="curl, lua51"
TERMUX_PKG_BUILD_DEPENDS="liblua51"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
termux_step_configure() {
if $TERMUX_ON_DEVICE_BUILD; then
TERMUX_PKG_EXTRA_MAKE_ARGS="LUA=$TERMUX_PREFIX/bin/lua5.3"
else
TERMUX_PKG_EXTRA_MAKE_ARGS="LUA=/usr/bin/lua5.3"
if [ "$TERMUX_ON_DEVICE_BUILD" != true ]; then
# Create temporary symlink to workaround luarock bootstrap
# script trying to run cross-compiled lua
mv "$TERMUX_PREFIX"/bin/lua"$__LUA_VERSION"{,.bak}
ln -sf /usr/bin/lua"$__LUA_VERSION" "$TERMUX_PREFIX"/bin/lua"$__LUA_VERSION"
fi
./configure --prefix=$TERMUX_PREFIX \
--with-lua=$TERMUX_PREFIX
# Create temporary symlink to workaround luarock bootstrap
# script trying to run cross-compiled lua
mv $TERMUX_PREFIX/bin/lua5.3{,.bak}
ln -sf /usr/bin/lua5.3 $TERMUX_PREFIX/bin/lua5.3
./configure --prefix="$TERMUX_PREFIX" \
--with-lua="$TERMUX_PREFIX"
}
termux_step_post_make_install() {
# Restore lua
unlink $TERMUX_PREFIX/bin/lua5.3
mv $TERMUX_PREFIX/bin/lua5.3{.bak,}
if [ "$TERMUX_ON_DEVICE_BUILD" != "true" ]; then
# Restore lua
unlink "$TERMUX_PREFIX"/bin/lua"$__LUA_VERSION"
mv "$TERMUX_PREFIX"/bin/lua"$__LUA_VERSION"{.bak,}
fi
}
termux_step_post_massage() {
# Remove lua, due to us moving it back and fourth the package
# thinks it is a newly compiled program
rm bin/lua5.3
if [ "$TERMUX_ON_DEVICE_BUILD" != true ]; then
# Remove lua, due to us moving it back and fourth, the build system
# thinks it is a newly compiled package.
rm bin/lua"$__LUA_VERSION"
fi
}

View File

@ -1,11 +1,11 @@
--- ./src/luarocks/core/cfg.lua~ 2018-10-30 18:31:40.000000000 +0100
+++ ./src/luarocks/core/cfg.lua 2019-03-10 16:33:24.676428404 +0100
@@ -358,7 +358,7 @@
--- ./src/luarocks/core/cfg.lua 2022-11-01 02:42:26.659749921 +0530
+++ ./src/luarocks/core/cfg.lua 2022-11-01 02:39:51.899749980 +0530
@@ -360,7 +360,7 @@
defaults.static_lib_extension = "a"
defaults.external_lib_extension = "so"
defaults.obj_extension = "o"
- defaults.external_deps_dirs = { "/usr/local", "/usr", "/" }
+ defaults.external_deps_dirs = { "@TERMUX_PREFIX@/local", "@TERMUX_PREFIX@" }
defaults.variables.CFLAGS = "-O2"
defaults.cmake_generator = "Unix Makefiles"
defaults.variables.CC = "gcc"
defaults.variables.CFLAGS = os.getenv("CFLAGS") or "-O2"
-- we pass -fPIC via CFLAGS because of old Makefile-based Lua projects

View File

@ -1,8 +1,8 @@
--- ./src/luarocks/core/sysdetect.lua.orig 2022-01-30 15:20:11.835200454 +0100
+++ ./src/luarocks/core/sysdetect.lua 2022-01-30 15:21:17.085262684 +0100
@@ -136,62 +136,7 @@
--- ./src/luarocks/core/sysdetect.lua.orig 2022-11-01 03:04:32.179749415 +0530
+++ ./src/luarocks/core/sysdetect.lua 2022-11-01 03:05:38.819749390 +0530
@@ -136,65 +136,7 @@
end
local function detect_elf_system(fd, hdr, sections)
- local system = e_osabi[hdr.osabi]
- local endian = hdr.endian
@ -21,6 +21,9 @@
- return "netbsd"
- elseif sections[".note.openbsd.ident"] then
- return "openbsd"
- elseif sections[".note.tag"] and
- sections[".note.tag"].namedata == "DragonFly" then
- return "dragonfly"
- end
-
- local gnu_version_r = sections[".gnu.version_r"]
@ -62,5 +65,5 @@
- return system
+ return "linux"
end
local function read_elf_header(fd)

View File

@ -1,9 +1,9 @@
--- ./src/luarocks/fs/unix/tools.lua.orig 2019-03-10 16:35:27.583094191 +0100
+++ ./src/luarocks/fs/unix/tools.lua 2019-03-10 16:36:17.913093843 +0100
@@ -300,7 +300,7 @@
--- ./src/luarocks/fs/unix/tools.lua.orig 2022-11-01 03:10:35.169749277 +0530
+++ ./src/luarocks/fs/unix/tools.lua 2022-11-01 03:11:27.189749257 +0530
@@ -263,7 +263,7 @@
assert(type(name_pattern) == "string")
name_pattern = dir.normalize(name_pattern)
- local template = (os.getenv("TMPDIR") or "/tmp") .. "/luarocks_" .. name_pattern:gsub("/", "_") .. "-XXXXXX"
+ local template = (os.getenv("TMPDIR") or "@TERMUX_PREFIX@/tmp") .. "/luarocks_" .. name_pattern:gsub("/", "_") .. "-XXXXXX"
local pipe = io.popen(vars.MKTEMP.." -d "..fs.Q(template))