TERMUX_PKG_HOMEPAGE=https://micro-editor.github.io/ TERMUX_PKG_DESCRIPTION="Modern and intuitive terminal-based text editor" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_VERSION=2.0.6 termux_step_extract_package() { local CHECKED_OUT_FOLDER=$TERMUX_PKG_CACHEDIR/checkout-$TERMUX_PKG_VERSION if [ ! -d $CHECKED_OUT_FOLDER ]; then local TMP_CHECKOUT=$TERMUX_PKG_TMPDIR/tmp-checkout rm -Rf $TMP_CHECKOUT mkdir -p $TMP_CHECKOUT git clone --depth 1 \ --branch v$TERMUX_PKG_VERSION \ https://github.com/zyedidia/micro.git \ $TMP_CHECKOUT cd $TMP_CHECKOUT git submodule update --init # --depth 1 mv $TMP_CHECKOUT $CHECKED_OUT_FOLDER fi mkdir $TERMUX_PKG_SRCDIR cd $TERMUX_PKG_SRCDIR cp -Rf $CHECKED_OUT_FOLDER/* . cp -Rf $CHECKED_OUT_FOLDER/.git . } termux_step_make() { return } termux_step_make_install() { termux_setup_golang export GOPATH=$TERMUX_PKG_BUILDDIR local MICRO_SRC=$GOPATH/src/github.com/zyedidia/micro cd $TERMUX_PKG_SRCDIR mkdir -p $MICRO_SRC cp -R . $MICRO_SRC cd $MICRO_SRC make build-quick mv micro $TERMUX_PREFIX/bin/micro } 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 }