nano: Add a plus variant with more features

Nano is by default built as "tiny" with most features disabled.
That is suitable for basic tasks in routers with small flash.

Add a new nano-plus variant that enables selected additional
features in the build config:
 * multiple files (multibuffer)
 * Unicode/utf8
 * justify
 * .nanorc support
 * help
 * also some key bindings get enabled as "tiny" configure option
   is removed.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
This commit is contained in:
Hannu Nyman 2022-01-31 18:04:08 +02:00
parent e87e3406ee
commit 85cb71d8d8
1 changed files with 54 additions and 7 deletions

View File

@ -25,15 +25,27 @@ PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/nano
define Package/nano/Default
SUBMENU:=Editors
SECTION:=utils
CATEGORY:=Utilities
TITLE:=GNU nano - enhanced clone of the Pico text editor
URL:=https://www.nano-editor.org/
DEPENDS:=+libncurses
endef
define Package/nano
$(call Package/nano/Default)
TITLE:=GNU nano text editor (minimal features)
VARIANT:=tiny
DEFAULT_VARIANT:=1
endef
define Package/nano-plus
$(call Package/nano/Default)
TITLE:=GNU nano text editor (more features, Unicode)
VARIANT:=plus
endef
define Package/nano/description
Nano is a small and simple text editor for use on the terminal.
@ -44,11 +56,41 @@ define Package/nano/description
Nano is an official GNU package.
endef
CONFIGURE_ARGS += \
--enable-tiny \
--disable-utf8 \
define Package/nano-plus/description
nano-plus - Additional features enabled, larger size than default nano.
(multibuffer, Unicode/UTF-8, help, justify, nanorc, some key bindings)
$(call Package/nano/description)
endef
ifeq ($(BUILD_VARIANT),plus)
# plus variant with more features included
CONFIGURE_ARGS += \
--enable-help \
--enable-justify \
--enable-linenumbers \
--enable-multibuffer \
--enable-nanorc \
--enable-utf8 \
--disable-browser \
--disable-color \
--enable-linenumbers
--disable-comment \
--disable-extra \
--disable-histories \
--disable-libmagic \
--disable-mouse \
--disable-operatingdir \
--disable-speller \
--disable-tabcomp \
--disable-wordcomp
else
# default tiny variant
CONFIGURE_ARGS += \
--enable-tiny \
--enable-linenumbers \
--disable-color \
--disable-utf8
endif
CONFIGURE_VARS += \
ac_cv_header_regex_h=no \
@ -58,5 +100,10 @@ define Package/nano/install
$(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
endef
$(eval $(call BuildPackage,nano))
define Package/nano-plus/install
$(call Package/nano/install,$1)
endef
$(eval $(call BuildPackage,nano))
$(eval $(call BuildPackage,nano-plus))