liblua5{2,3,4}: Use update-alternatives

This commit is contained in:
Tee KOBAYASHI 2021-12-03 18:46:30 +09:00 committed by Henrik Grimler
parent da51ef0d6e
commit 3d7c5aa219
6 changed files with 74 additions and 3 deletions

View File

@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Shared library for the Lua interpreter (v5.2.x)"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=5.2.4
TERMUX_PKG_REVISION=5
TERMUX_PKG_REVISION=6
TERMUX_PKG_SRCURL=https://www.lua.org/ftp/lua-$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b
TERMUX_PKG_BREAKS="liblua52-dev"

View File

@ -1,3 +1,27 @@
TERMUX_SUBPKG_DESCRIPTION="Simple, extensible, embeddable programming language"
TERMUX_SUBPKG_DEPENDS="readline"
TERMUX_SUBPKG_INCLUDE="bin/ share/man/man1/"
termux_step_create_debscripts() {
cat <<- EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
if [ "$TERMUX_PACKAGE_FORMAT" = "pacman" ] || [ "\$1" = "configure" ] || [ "\$1" = "abort-upgrade" ]; then
if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then
update-alternatives --install \
$TERMUX_PREFIX/bin/lua lua $TERMUX_PREFIX/bin/lua5.2 120
update-alternatives --install \
$TERMUX_PREFIX/bin/luac luac $TERMUX_PREFIX/bin/luac5.2 120
fi
fi
EOF
cat <<- EOF > ./prerm
#!$TERMUX_PREFIX/bin/sh
if [ "$TERMUX_PACKAGE_FORMAT" = "pacman" ] || [ "\$1" != "upgrade" ]; then
if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then
update-alternatives --remove lua $TERMUX_PREFIX/bin/lua
update-alternatives --remove luac $TERMUX_PREFIX/bin/luac
fi
fi
EOF
}

View File

@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Shared library for the Lua interpreter (v5.3.x)"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=5.3.5
TERMUX_PKG_REVISION=7
TERMUX_PKG_REVISION=8
TERMUX_PKG_SRCURL=https://www.lua.org/ftp/lua-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac
TERMUX_PKG_EXTRA_MAKE_ARGS=linux

View File

@ -3,3 +3,27 @@ TERMUX_SUBPKG_DESCRIPTION="Simple, extensible, embeddable programming language"
TERMUX_SUBPKG_DEPENDS="readline"
TERMUX_SUBPKG_BREAKS="lua (<< 5.3.5-6)"
TERMUX_SUBPKG_REPLACES="lua (<< 5.3.5-6)"
termux_step_create_debscripts() {
cat <<- EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
if [ "$TERMUX_PACKAGE_FORMAT" = "pacman" ] || [ "\$1" = "configure" ] || [ "\$1" = "abort-upgrade" ]; then
if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then
update-alternatives --install \
$TERMUX_PREFIX/bin/lua lua $TERMUX_PREFIX/bin/lua5.3 130
update-alternatives --install \
$TERMUX_PREFIX/bin/luac luac $TERMUX_PREFIX/bin/luac5.3 130
fi
fi
EOF
cat <<- EOF > ./prerm
#!$TERMUX_PREFIX/bin/sh
if [ "$TERMUX_PACKAGE_FORMAT" = "pacman" ] || [ "\$1" != "upgrade" ]; then
if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then
update-alternatives --remove lua $TERMUX_PREFIX/bin/lua
update-alternatives --remove luac $TERMUX_PREFIX/bin/luac
fi
fi
EOF
}

View File

@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Shared library for the Lua interpreter"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=5.4.3
TERMUX_PKG_REVISION=3
TERMUX_PKG_REVISION=4
TERMUX_PKG_SRCURL=https://www.lua.org/ftp/lua-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=f8612276169e3bfcbcfb8f226195bfc6e466fe13042f1076cbde92b7ec96bbfb
TERMUX_PKG_EXTRA_MAKE_ARGS=linux-readline

View File

@ -2,3 +2,26 @@ TERMUX_SUBPKG_INCLUDE="bin/ share/man/man1/"
TERMUX_SUBPKG_DESCRIPTION="Simple, extensible, embeddable programming language"
TERMUX_SUBPKG_DEPENDS="readline"
termux_step_create_debscripts() {
cat <<- EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
if [ "$TERMUX_PACKAGE_FORMAT" = "pacman" ] || [ "\$1" = "configure" ] || [ "\$1" = "abort-upgrade" ]; then
if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then
update-alternatives --install \
$TERMUX_PREFIX/bin/lua lua $TERMUX_PREFIX/bin/lua5.4 140
update-alternatives --install \
$TERMUX_PREFIX/bin/luac luac $TERMUX_PREFIX/bin/luac5.4 140
fi
fi
EOF
cat <<- EOF > ./prerm
#!$TERMUX_PREFIX/bin/sh
if [ "$TERMUX_PACKAGE_FORMAT" = "pacman" ] || [ "\$1" != "upgrade" ]; then
if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then
update-alternatives --remove lua $TERMUX_PREFIX/bin/lua
update-alternatives --remove luac $TERMUX_PREFIX/bin/luac
fi
fi
EOF
}