termux-packages/packages/nano/build.sh
Henrik Grimler 3efa45721a Update various packages (#5113)
* calcurse: update to 4.6.0

* dialog: update to 20200327

* dictd: update to 1.13.0

* gitea: update to 1.11.4

* jfrog-cli: update to 1.35.3

* libgd: update to 2.3.0

* libgit2: update to 1.0.0

* libgraphite: update to 1.3.14

* libnftnl: update to 1.1.6

* vim, vim-python: update to 8.2.0500

* unrar: update to 5.9.2

* remind: update to 03.03.01

* nano: update to 4.9.1

* seafile-client: update to 7.0.7

* libgnutls: update to 3.6.13

* apache2: update to 2.4.43
2020-04-03 17:30:41 +02:00

52 lines
1.7 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://www.nano-editor.org/
TERMUX_PKG_DESCRIPTION="Small, free and friendly text editor"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=4.9.1
TERMUX_PKG_SRCURL=https://nano-editor.org/dist/latest/nano-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_SHA256=52cd5a0cefaa6be199bf1a8f5295e2ef1f787f9533d1ab9ed1e52d3a242aba6c
TERMUX_PKG_DEPENDS="libandroid-support, libandroid-glob, ncurses"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
ac_cv_header_pwd_h=no
--disable-libmagic
--enable-utf8
--with-wordbounds
"
TERMUX_PKG_CONFFILES="etc/nanorc"
TERMUX_PKG_RM_AFTER_INSTALL="bin/rnano share/man/man1/rnano.1 share/nano/man-html"
termux_step_pre_configure() {
LDFLAGS+=" -landroid-glob"
if $TERMUX_DEBUG; then
# When doing debug build, -D_FORTIFY_SOURCE=2 gives this error:
# /home/builder/.termux-build/_lib/16-aarch64-21-v3/bin/../sysroot/usr/include/bits/fortify/string.h:79:26: error: use of undeclared identifier '__USE_FORTIFY_LEVEL'
export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
fi
}
termux_step_post_make_install() {
# Configure nano to use syntax highlighting:
NANORC=$TERMUX_PREFIX/etc/nanorc
echo include \"$TERMUX_PREFIX/share/nano/\*nanorc\" > $NANORC
}
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/nano 20
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/nano
fi
fi
EOF
}