termux-packages/packages/micro/build.sh

47 lines
1.2 KiB
Bash
Raw Normal View History

2017-04-10 22:24:50 +02:00
TERMUX_PKG_HOMEPAGE=https://micro-editor.github.io/
TERMUX_PKG_DESCRIPTION="Modern and intuitive terminal-based text editor"
2019-01-21 13:53:58 +01:00
TERMUX_PKG_LICENSE="MIT"
2020-03-01 18:30:57 +01:00
TERMUX_PKG_VERSION=2.0.2
2020-02-15 22:41:12 +01:00
TERMUX_PKG_SRCURL=https://github.com/zyedidia/micro/archive/v$TERMUX_PKG_VERSION.tar.gz
2020-03-01 18:30:57 +01:00
TERMUX_PKG_SHA256=47937983c503e56241f4457d27da7223eeda93d09c28c36c4617d031edb3a2a4
2017-04-10 22:24:50 +02:00
termux_step_make() {
return
}
termux_step_make_install() {
termux_setup_golang
2017-08-11 00:26:18 +02:00
export GOPATH=$TERMUX_PKG_BUILDDIR
local MICRO_SRC=$GOPATH/src/github.com/zyedidia/micro
2017-04-10 22:24:50 +02:00
2017-08-11 00:26:18 +02:00
cd $TERMUX_PKG_SRCDIR
mkdir -p $MICRO_SRC
cp -R . $MICRO_SRC
cd $MICRO_SRC
make build-quick
mv micro $TERMUX_PREFIX/bin/micro
2017-04-10 22:24:50 +02:00
}
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/micro 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/micro
fi
fi
EOF
}