Files
buildroot/package/nnn/nnn.mk
Alexander Shirokov 7856e41685 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 <shirokovalexs@gmail.com>
[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 <arnout@rnout.be>
2025-08-28 16:25:53 +02:00

41 lines
964 B
Makefile

################################################################################
#
# 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))