2016-11-26 00:20:40 +01:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://luarocks.org/
|
2015-06-13 01:03:31 +02:00
|
|
|
TERMUX_PKG_DESCRIPTION="Deployment and management system for Lua modules"
|
2019-01-21 15:00:12 +01:00
|
|
|
TERMUX_PKG_LICENSE="BSD"
|
2020-12-20 14:16:34 +01:00
|
|
|
TERMUX_PKG_MAINTAINER="@termux"
|
2022-01-30 15:42:22 +01:00
|
|
|
TERMUX_PKG_VERSION=3.8.0
|
2016-11-26 00:20:40 +01:00
|
|
|
TERMUX_PKG_SRCURL=https://luarocks.org/releases/luarocks-${TERMUX_PKG_VERSION}.tar.gz
|
2022-01-30 15:42:22 +01:00
|
|
|
TERMUX_PKG_SHA256=56ab9b90f5acbc42eb7a94cf482e6c058a63e8a1effdf572b8b2a6323a06d923
|
2020-10-01 15:18:19 +02:00
|
|
|
TERMUX_PKG_DEPENDS="curl, lua53"
|
|
|
|
TERMUX_PKG_BUILD_DEPENDS="liblua53"
|
2019-08-12 17:28:41 +02:00
|
|
|
TERMUX_PKG_BUILD_IN_SRC=true
|
|
|
|
TERMUX_PKG_PLATFORM_INDEPENDENT=true
|
2015-06-13 01:03:31 +02:00
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_configure() {
|
2019-08-16 13:21:24 +02:00
|
|
|
if $TERMUX_ON_DEVICE_BUILD; then
|
2020-10-01 15:40:50 +02:00
|
|
|
TERMUX_PKG_EXTRA_MAKE_ARGS="LUA=$TERMUX_PREFIX/bin/lua5.3"
|
2019-08-16 13:21:24 +02:00
|
|
|
else
|
|
|
|
TERMUX_PKG_EXTRA_MAKE_ARGS="LUA=/usr/bin/lua5.3"
|
|
|
|
fi
|
|
|
|
|
2016-11-26 00:20:40 +01:00
|
|
|
./configure --prefix=$TERMUX_PREFIX \
|
|
|
|
--with-lua=$TERMUX_PREFIX \
|
2020-10-01 15:40:50 +02:00
|
|
|
--with-lua-include=$TERMUX_PREFIX/include/lua5.3 \
|
2017-01-18 00:58:39 +01:00
|
|
|
--lua-version=5.3
|
2022-01-30 15:42:22 +01:00
|
|
|
|
|
|
|
# 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
|
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_post_make_install() {
|
|
|
|
# Restore lua
|
|
|
|
unlink $TERMUX_PREFIX/bin/lua5.3
|
|
|
|
mv $TERMUX_PREFIX/bin/lua5.3{.bak,}
|
2015-06-13 01:03:31 +02:00
|
|
|
}
|
2020-10-01 15:40:50 +02:00
|
|
|
|
2019-06-08 01:53:52 +02:00
|
|
|
termux_step_post_massage() {
|
2019-07-20 10:42:33 +02:00
|
|
|
sed -i "1 s|$|lua|" bin/luarocks
|
2019-06-08 01:53:52 +02:00
|
|
|
sed -i "1 s|$|lua|" bin/luarocks-admin
|
2022-01-30 15:42:22 +01:00
|
|
|
|
|
|
|
# Remove lua, due to us moving it back and fourth the package
|
|
|
|
# thinks it is a newly compiled program
|
|
|
|
rm bin/lua5.3
|
2019-06-08 01:53:52 +02:00
|
|
|
}
|