Browse Source

vim, vim-python: add support for dpkg alternatives

Provide $PREFIX/bin/vim as alternative for $PREFIX/bin/editor.
emacs-27
Leonid Plyushch 5 years ago
parent
commit
de8f966397
No known key found for this signature in database GPG Key ID: 45F2964132545795
  1. 22
      packages/vim-python/build.sh
  2. 22
      packages/vim/build.sh

22
packages/vim-python/build.sh

@ -6,6 +6,7 @@ TERMUX_PKG_RECOMMENDS="diffutils"
# vim should only be updated every 50 releases on multiples of 50. # vim should only be updated every 50 releases on multiples of 50.
# Update both vim and vim-python to the same version in one PR. # Update both vim and vim-python to the same version in one PR.
TERMUX_PKG_VERSION=8.1.1800 TERMUX_PKG_VERSION=8.1.1800
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL="https://github.com/vim/vim/archive/v${TERMUX_PKG_VERSION}.tar.gz" TERMUX_PKG_SRCURL="https://github.com/vim/vim/archive/v${TERMUX_PKG_VERSION}.tar.gz"
TERMUX_PKG_SHA256=dbb55d75b604a51d2a05b25e023d45e9e3f88da73c790960f7dfd93949a5f534 TERMUX_PKG_SHA256=dbb55d75b604a51d2a05b25e023d45e9e3f88da73c790960f7dfd93949a5f534
TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
@ -75,3 +76,24 @@ termux_step_post_make_install() {
cd $TERMUX_PREFIX/bin cd $TERMUX_PREFIX/bin
ln -f -s vim vi ln -f -s vim vi
} }
termux_step_create_debscripts() {
cat <<- EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
if [ "\$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/vim 25
fi
fi
EOF
cat <<- EOF > ./prerm
#!$TERMUX_PREFIX/bin/sh
if [ "\$1" != "upgrade" ]; then
if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then
update-alternatives --remove editor $TERMUX_PREFIX/bin/vim
fi
fi
EOF
}

22
packages/vim/build.sh

@ -6,6 +6,7 @@ TERMUX_PKG_RECOMMENDS="diffutils"
# vim should only be updated every 50 releases on multiples of 50. # vim should only be updated every 50 releases on multiples of 50.
# Update both vim and vim-python to the same version in one PR. # Update both vim and vim-python to the same version in one PR.
TERMUX_PKG_VERSION=8.1.1800 TERMUX_PKG_VERSION=8.1.1800
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL="https://github.com/vim/vim/archive/v${TERMUX_PKG_VERSION}.tar.gz" TERMUX_PKG_SRCURL="https://github.com/vim/vim/archive/v${TERMUX_PKG_VERSION}.tar.gz"
TERMUX_PKG_SHA256=dbb55d75b604a51d2a05b25e023d45e9e3f88da73c790960f7dfd93949a5f534 TERMUX_PKG_SHA256=dbb55d75b604a51d2a05b25e023d45e9e3f88da73c790960f7dfd93949a5f534
TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
@ -62,3 +63,24 @@ termux_step_post_make_install() {
cd $TERMUX_PREFIX/bin cd $TERMUX_PREFIX/bin
ln -f -s vim vi ln -f -s vim vi
} }
termux_step_create_debscripts() {
cat <<- EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
if [ "\$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/vim 25
fi
fi
EOF
cat <<- EOF > ./prerm
#!$TERMUX_PREFIX/bin/sh
if [ "\$1" != "upgrade" ]; then
if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then
update-alternatives --remove editor $TERMUX_PREFIX/bin/vim
fi
fi
EOF
}

Loading…
Cancel
Save