From 7856e41685a179fdda7b21a10455e52fe5fa5cb0 Mon Sep 17 00:00:00 2001 From: Alexander Shirokov Date: Sun, 24 Aug 2025 15:52:17 +0200 Subject: [PATCH] package/nnn: new package nnn is a fast and minimal text-based file manager. It is written in C and has minimal dependencies, which makes it portable and suitable for embedded systems. Project page: https://github.com/jarun/nnn Wiki: https://en.wikipedia.org/wiki/Nnn_(file_manager) Signed-off-by: Alexander Shirokov [Arnout: - add missing dependency on BR2_USE_MMU (found with test-pkg); - add missing comment in Config.in; - add musl-fls dependency when needed (found with test-pkg); - add host-pkgconf dependency; - add NNN_MAKE_ENV to collect everything in make environment; - drop TARGET_MAKE_ENV from environment, it's already in TARGET_CONFIGURE_OPTS; - add PREFIX to NNN_MAKE_FLAGS: it is currently not used in the build step, but in the future it may be used; - use NORL=0/1 for readline optional dependency, the Makefile says that the "norl" target is legacy; - remove comment about readline dependency, it's obvious; - indent continuation line with an extra tab. ] Signed-off-by: Arnout Vandecappelle --- DEVELOPERS | 3 +++ package/Config.in | 1 + package/nnn/Config.in | 20 ++++++++++++++++++++ package/nnn/nnn.hash | 3 +++ package/nnn/nnn.mk | 40 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 67 insertions(+) create mode 100644 package/nnn/Config.in create mode 100644 package/nnn/nnn.hash create mode 100644 package/nnn/nnn.mk diff --git a/DEVELOPERS b/DEVELOPERS index cdcde0585f..0276f2f2cf 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -91,6 +91,9 @@ F: package/modem-manager/ N: Aleksandr Makarov F: package/cpp-httplib/ +N: Alexander Shirokov +F: package/nnn/ + N: Alessandro Partesotti F: package/oatpp/ diff --git a/package/Config.in b/package/Config.in index 137f74ed82..b4eac5cf91 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2973,6 +2973,7 @@ menu "Text editors and viewers" source "package/mg/Config.in" source "package/most/Config.in" source "package/nano/Config.in" + source "package/nnn/Config.in" source "package/uemacs/Config.in" source "package/vim/Config.in" endmenu diff --git a/package/nnn/Config.in b/package/nnn/Config.in new file mode 100644 index 0000000000..64cfa8e0a5 --- /dev/null +++ b/package/nnn/Config.in @@ -0,0 +1,20 @@ +config BR2_PACKAGE_NNN + bool "nnn" + depends on BR2_USE_MMU # fork + # Building nnn without widechar/UTF support is theoretically + # possible, but in practice it leads to unstable builds. + # That’s why the WCHAR dependency is here. + depends on BR2_USE_WCHAR + select BR2_PACKAGE_NCURSES + select BR2_PACKAGE_NCURSES_WCHAR + select BR2_PACKAGE_MUSL_FTS if !BR2_TOOLCHAIN_USES_GLIBC + help + nnn is a lightweight yet powerful terminal file manager. + It is written in C, has minimal dependency, and works + out of the box. + + https://github.com/jarun/nnn + +comment "nnn needs a toolchain with wchar" + depends on BR2_USE_MMU # fork + depends on !BR2_USE_WCHAR diff --git a/package/nnn/nnn.hash b/package/nnn/nnn.hash new file mode 100644 index 0000000000..670a591afb --- /dev/null +++ b/package/nnn/nnn.hash @@ -0,0 +1,3 @@ +# Locally computed +sha256 9faaff1e3f5a2fd3ed570a83f6fb3baf0bfc6ebd6a9abac16203d057ac3fffe3 nnn-5.1.tar.gz +sha256 829f485dc4f2f51c2471b36a99e22f15ff214966e16b72cd79768b2338b4132b LICENSE diff --git a/package/nnn/nnn.mk b/package/nnn/nnn.mk new file mode 100644 index 0000000000..acbd0ce314 --- /dev/null +++ b/package/nnn/nnn.mk @@ -0,0 +1,40 @@ +################################################################################ +# +# nnn +# +################################################################################ + +NNN_VERSION = 5.1 +NNN_LICENSE = BSD-2-Clause +NNN_LICENSE_FILES = LICENSE +NNN_SITE = $(call github,jarun,nnn,v$(NNN_VERSION)) +NNN_DEPENDENCIES = ncurses host-pkgconf + +NNN_MAKE_ENV = $(TARGET_CONFIGURE_OPTS) +NNN_MAKE_FLAGS = \ + CFLAGS_OPTIMIZATION= \ + PREFIX=/usr + +ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),) +NNN_DEPENDENCIES += musl-fts +# Must be passed in env so it can be appended to by the Makefile +NNN_MAKE_ENV += LDLIBS="-lfts" +endif + +ifeq ($(BR2_PACKAGE_READLINE),y) +NNN_DEPENDENCIES += readline +NNN_MAKE_FLAGS += O_NORL=0 +else +NNN_MAKE_FLAGS += O_NORL=1 +endif + +define NNN_BUILD_CMDS + $(NNN_MAKE_ENV) $(MAKE) -C $(@D) $(NNN_MAKE_FLAGS) +endef + +define NNN_INSTALL_TARGET_CMDS + $(NNN_MAKE_ENV) $(MAKE) -C $(@D) $(NNN_MAKE_FLAGS) \ + DESTDIR=$(TARGET_DIR) install +endef + +$(eval $(generic-package))