[PATCH] ncurses: Introduce configs to install ncurses progs
Charlie Jenkins
thecharlesjenkins at gmail.com
Sun Aug 30 19:35:18 PDT 2026
ncurses ships with a variety of programs: clear, infocmp, tabs, tic,
toe, tput, and tset/reset. Introduce configs to build/install each of
these programs individually. clear and reset commands are also supplied
by busybox, so these two are gated on the commands not being included by
busybox. The ncurses version of reset and clear will read the terminfo
to more accurately execute these commands.
Signed-off-by: Charlie Jenkins <thecharlesjenkins at gmail.com>
---
package/libs/ncurses/Config.in | 69 ++++++++++++++++++++++++++++++++++++++++++
package/libs/ncurses/Makefile | 48 +++++++++++++++++++++++++++--
2 files changed, 115 insertions(+), 2 deletions(-)
diff --git a/package/libs/ncurses/Config.in b/package/libs/ncurses/Config.in
index a18224c30c..9a8eae5e46 100644
--- a/package/libs/ncurses/Config.in
+++ b/package/libs/ncurses/Config.in
@@ -9,5 +9,74 @@ config LIBNCURSES_TERMINFO
Whitespace separated list of terminfo files to install
beyond the default terminfo files.
+config LIBNCURSES_PROGS
+ bool
+ help
+ Build ncurses with support for it's programs such as tic, clear,
+ reset, tabs, etc.
+
+ Busybox ships its own version of clear and reset, so those must be
+ disabled before trying to enable this option.
+
+config LIBNCURSES_INSTALL_CLEAR
+ bool "install clear"
+ depends on !BUSYBOX_CONFIG_CLEAR
+ select LIBNCURSES_PROGS
+ help
+ Install the ncurses clear program to the target.
+
+ This clear implementation clears the terminal screen and its
+ scrollback buffer if the terminal emulator supports the E3 extension.
+
+config LIBNCURSES_INSTALL_INFOCMP
+ bool "install infocmp"
+ select LIBNCURSES_PROGS
+ help
+ Install the ncurses infocmp program to the target.
+
+ infocmp is used to compare or print out terminfo descriptions.
+
+config LIBNCURSES_INSTALL_TABS
+ bool "install tabs"
+ select LIBNCURSES_PROGS
+ help
+ install the ncurses tabs program to the target.
+
+ tabs is used to set terminal tab stops.
+
+config LIBNCURSES_INSTALL_TIC
+ bool "install tic"
+ select LIBNCURSES_PROGS
+ help
+ Install the ncurses tic program to the target.
+
+ tic is used to compile terminal descriptions for terminfo or termcap.
+
+config LIBNCURSES_INSTALL_TOE
+ bool "install toe"
+ select LIBNCURSES_PROGS
+ help
+ Install the ncurses toe program to the target.
+
+ toe is used to list table entries of terminfo terminal types.
+
+config LIBNCURSES_INSTALL_TPUT
+ bool "install tput"
+ select LIBNCURSES_PROGS
+ help
+ Install the ncurses tput program to the target.
+
+ tput is used to initialize a terminal, exercise its capabilities, or query
+ terminfo database.
+
+config LIBNCURSES_INSTALL_TSET
+ bool "install tset/reset"
+ depends on !BUSYBOX_CONFIG_RESET
+ select LIBNCURSES_PROGS
+ help
+ Install the ncurses tset program to the target along with the reset symlink.
+
+ tset/reset is used to initialize or reset terminal state.
+
endmenu
diff --git a/package/libs/ncurses/Makefile b/package/libs/ncurses/Makefile
index 3d0de70638..f45dd4afab 100644
--- a/package/libs/ncurses/Makefile
+++ b/package/libs/ncurses/Makefile
@@ -71,7 +71,8 @@ CONFIGURE_ARGS += \
--without-debug \
--without-manpages \
--without-profile \
- --without-progs \
+ $(if $(CONFIG_LIBNCURSES_PROGS),,--without-progs) \
+ --with-strip-program=$(TARGET_CROSS)strip \
--without-tests \
--disable-big-core \
--disable-home-terminfo \
@@ -100,6 +101,38 @@ HOST_CONFIGURE_ARGS += \
--without-curses-h \
--disable-db-install
+NCURSES_PROGS=
+
+ifeq ($(CONFIG_LIBNCURSES_INSTALL_CLEAR),y)
+ NCURSES_PROGS += "clear"
+endif
+
+ifeq ($(CONFIG_LIBNCURSES_INSTALL_INFOCMP),y)
+ NCURSES_PROGS += "infocmp"
+endif
+
+ifeq ($(CONFIG_LIBNCURSES_INSTALL_TABS),y)
+ NCURSES_PROGS += "tabs"
+endif
+
+ifeq ($(CONFIG_LIBNCURSES_INSTALL_TIC),y)
+ NCURSES_PROGS += "tic"
+ NCURSES_PROGS += "captoinfo"
+ NCURSES_PROGS += "infotocap"
+endif
+
+ifeq ($(CONFIG_LIBNCURSES_INSTALL_TOE),y)
+ NCURSES_PROGS += "toe"
+endif
+
+ifeq ($(CONFIG_LIBNCURSES_INSTALL_TPUT),y)
+ NCURSES_PROGS += "tput"
+endif
+
+ifeq ($(CONFIG_LIBNCURSES_INSTALL_TSET),y)
+ NCURSES_PROGS += "tset"
+ NCURSES_PROGS += "reset"
+endif
ifeq ($(HOST_OS),FreeBSD)
CONFIGURE_ARGS +=
@@ -113,11 +146,17 @@ MAKE_FLAGS += \
PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig \
libs
+NCURSES_INSTALL_TARGETS=install.libs install.data
+ifeq ($(CONFIG_LIBNCURSES_PROGS),y)
+ NCURSES_INSTALL_TARGETS += "install.progs"
+endif
+
+
define Build/Install/Default
$(MAKE_VARS) \
$(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
$(MAKE_INSTALL_FLAGS) \
- $(1) install.libs install.data;
+ $(1) $(NCURSES_INSTALL_TARGETS);
endef
define Package/terminfo/install
@@ -163,6 +202,11 @@ define Package/libncurses/install
ln -s $$$${so##*/} $$$${so%w.so*}.so$$$${so##*w.so}; \
done; \
done
+
+ $(INSTALL_DIR) $(1)/usr/bin
+ for prog in $(NCURSES_PROGS); do \
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$$$${prog} $(1)/usr/bin/; \
+ done
endef
define Package/libncurses-dev/install
---
base-commit: 93cf01b0b6fe169492be255db8613016b9d0c3cd
change-id: 20260830-ncurses_progs-e2702f4974f3
Best regards,
--
- Charlie
More information about the openwrt-devel
mailing list