From 9137583d3d733c2d9300b86d1fcbdd868ba3784f Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Tue, 1 Feb 2022 23:41:59 +0200 Subject: [PATCH] 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 (cherry picked from commit 85cb71d8d81af3c549406d5f42080ed58be9b9b0) --- utils/nano/Makefile | 57 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/utils/nano/Makefile b/utils/nano/Makefile index f12866d892..2c07bda7bf 100644 --- a/utils/nano/Makefile +++ b/utils/nano/Makefile @@ -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 += \ +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 \ + --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 \ - --disable-utf8 \ + --enable-linenumbers \ --disable-color \ - --enable-linenumbers + --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 +define Package/nano-plus/install + $(call Package/nano/install,$1) +endef + $(eval $(call BuildPackage,nano)) +$(eval $(call BuildPackage,nano-plus)) -- 2.30.2