2016-11-11 01:39:54 +01:00
TERMUX_PKG_HOMEPAGE = https://www.nano-editor.org/
2015-06-13 01:03:31 +02:00
TERMUX_PKG_DESCRIPTION = "Small, free and friendly text editor"
2019-01-21 13:53:58 +01:00
TERMUX_PKG_LICENSE = "GPL-2.0"
2020-04-13 12:04:37 +02:00
TERMUX_PKG_VERSION = 4.9.2
2018-09-11 00:45:49 +02:00
TERMUX_PKG_SRCURL = https://nano-editor.org/dist/latest/nano-$TERMUX_PKG_VERSION .tar.xz
2020-04-13 12:04:37 +02:00
TERMUX_PKG_SHA256 = d8a25eea942ecee2d57b8e037eb4b28f030f818b78773b8fcb994ed5835d2ef6
2016-09-23 04:37:42 +02:00
TERMUX_PKG_DEPENDS = "libandroid-support, libandroid-glob, ncurses"
2017-04-02 12:38:29 +02:00
TERMUX_PKG_EXTRA_CONFIGURE_ARGS = "
2018-01-05 22:57:31 +01:00
ac_cv_header_pwd_h = no
2017-04-02 12:38:29 +02:00
--disable-libmagic
--enable-utf8
--with-wordbounds
"
2019-02-12 23:33:47 +01:00
TERMUX_PKG_CONFFILES = "etc/nanorc"
2015-06-13 01:03:31 +02:00
TERMUX_PKG_RM_AFTER_INSTALL = "bin/rnano share/man/man1/rnano.1 share/nano/man-html"
2016-09-03 23:48:41 +02:00
termux_step_pre_configure( ) {
LDFLAGS += " -landroid-glob"
2019-08-12 17:28:41 +02:00
if $TERMUX_DEBUG ; then
2018-06-13 02:12:36 +02:00
# 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
2016-09-03 23:48:41 +02:00
}
2015-06-13 01:03:31 +02:00
2019-02-08 10:37:29 +01:00
termux_step_post_make_install( ) {
2015-06-13 01:03:31 +02:00
# Configure nano to use syntax highlighting:
NANORC = $TERMUX_PREFIX /etc/nanorc
echo include \" $TERMUX_PREFIX /share/nano/\* nanorc\" > $NANORC
}
2019-08-10 01:55:04 +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/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
}