mirror of
https://github.com/termux/termux-packages.git
synced 2025-09-24 07:12:30 +00:00
42 lines
1.2 KiB
Bash
42 lines
1.2 KiB
Bash
TERMUX_PKG_HOMEPAGE=https://github.com/hboetes/mg
|
|
TERMUX_PKG_DESCRIPTION="microscopic GNU Emacs-style editor"
|
|
TERMUX_PKG_LICENSE="Public Domain"
|
|
TERMUX_PKG_MAINTAINER="@termux"
|
|
TERMUX_PKG_VERSION="20240709"
|
|
TERMUX_PKG_SRCURL=https://github.com/hboetes/mg/archive/$TERMUX_PKG_VERSION.tar.gz
|
|
TERMUX_PKG_SHA256=8b2c7574f161172098d6e7feb8a8b7112afbc0604a53cb3a04268e7b32fe45ad
|
|
TERMUX_PKG_AUTO_UPDATE=true
|
|
TERMUX_PKG_UPDATE_VERSION_REGEXP="\d{8}"
|
|
TERMUX_PKG_DEPENDS="libbsd, ncurses"
|
|
TERMUX_PKG_BUILD_IN_SRC=true
|
|
|
|
termux_step_post_get_source() {
|
|
# force make
|
|
rm CMakeLists.txt meson.build
|
|
}
|
|
|
|
termux_step_pre_configure() {
|
|
CFLAGS+=" $CPPFLAGS -fcommon"
|
|
}
|
|
|
|
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/editor editor $TERMUX_PREFIX/bin/mg 30
|
|
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 editor $TERMUX_PREFIX/bin/mg
|
|
fi
|
|
fi
|
|
EOF
|
|
}
|