[PATCH v2] ncurses: Introduce configs to install ncurses progs
Charlie Jenkins
thecharlesjenkins at gmail.com
Wed Sep 2 00:10:37 PDT 2026
ncurses ships with a variety of programs: clear, infocmp, tabs, tic,
toe, tput, and tset/reset. Introduce a new package for each of these
programs.
The compile time is fast, so build all of the packages by default, but
only install when the package is selected.
clear and reset commands are also supplied by busybox. Configure these
programs with alternatives in ncurses to override the busybox
implementations. 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>
---
Changes in v2:
- Make individual package for each ncurses program
- Make clear and reset alternatives to override busybox implementations
---
package/libs/ncurses/Makefile | 145 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 142 insertions(+), 3 deletions(-)
diff --git a/package/libs/ncurses/Makefile b/package/libs/ncurses/Makefile
index 3d0de70638..7163f9a98d 100644
--- a/package/libs/ncurses/Makefile
+++ b/package/libs/ncurses/Makefile
@@ -47,6 +47,71 @@ define Package/libncurses
ABI_VERSION:=6
endef
+define Package/libncurses-clear
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=ncurses clear program
+ URL:=https://www.gnu.org/software/ncurses/
+ PROVIDES:=clear
+ DEPENDS:= +libncurses
+ ALTERNATIVES:=200:/usr/bin/clear:/usr/bin/ncurses-clear
+endef
+
+define Package/libncurses-infocmp
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=ncurses infocmp program
+ URL:=https://www.gnu.org/software/ncurses/
+ PROVIDES:=infocmp
+ DEPENDS:= +libncurses
+endef
+
+define Package/libncurses-tabs
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=ncurses tabs program
+ URL:=https://www.gnu.org/software/ncurses/
+ PROVIDES:=tabs
+ DEPENDS:= +libncurses
+endef
+
+define Package/libncurses-tic
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=ncurses tic program
+ URL:=https://www.gnu.org/software/ncurses/
+ PROVIDES:=tic captoinfo infotocap
+ DEPENDS:= +libncurses
+endef
+
+define Package/libncurses-toe
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=ncurses toe program
+ URL:=https://www.gnu.org/software/ncurses/
+ PROVIDES:=toe
+ DEPENDS:= +libncurses
+endef
+
+define Package/libncurses-tput
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=ncurses tput program
+ URL:=https://www.gnu.org/software/ncurses/
+ PROVIDES:=tput
+ DEPENDS:= +libncurses
+endef
+
+define Package/libncurses-tset
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=ncurses tset and reset program
+ URL:=https://www.gnu.org/software/ncurses/
+ PROVIDES:=tset reset
+ DEPENDS:= +libncurses
+ ALTERNATIVES:=200:/usr/bin/reset:/usr/bin/ncurses-reset
+endef
+
define Package/libncurses-dev
SECTION:=devel
CATEGORY:=Development
@@ -59,6 +124,36 @@ define Package/libncurses/config
source "$(SOURCE)/Config.in"
endef
+define Package/libncurses-clear/description
+ This clear implementation clears the terminal screen and its
+ scrollback buffer if the terminal emulator supports the E3 extension.
+endef
+
+define Package/libncurses-infocmp/description
+ infocmp is used to compare or print out terminfo descriptions.
+endef
+
+define Package/libncurses-tabs/description
+ tabs is used to set terminal tab stops.
+endef
+
+define Package/libncurses-tic/description
+ tic is used to compile terminal descriptions for terminfo or termcap.
+endef
+
+define Package/libncurses-toe/description
+ toe is used to list table entries of terminfo terminal types.
+endef
+
+define Package/libncurses-tput/description
+ tput is used to initialize a terminal, exercise its capabilities, or query
+ terminfo database.
+endef
+
+define Package/libncurses-tset/description
+ tset/reset is used to initialize or reset terminal state.
+endef
+
TARGET_CFLAGS += $(FPIC) -std=gnu17
CONFIGURE_ARGS += \
@@ -71,7 +166,7 @@ CONFIGURE_ARGS += \
--without-debug \
--without-manpages \
--without-profile \
- --without-progs \
+ --with-strip-program=$(TARGET_CROSS)strip \
--without-tests \
--disable-big-core \
--disable-home-terminfo \
@@ -100,7 +195,6 @@ HOST_CONFIGURE_ARGS += \
--without-curses-h \
--disable-db-install
-
ifeq ($(HOST_OS),FreeBSD)
CONFIGURE_ARGS +=
--with-terminfo=/usr/share/terminfo.db
@@ -117,7 +211,7 @@ define Build/Install/Default
$(MAKE_VARS) \
$(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
$(MAKE_INSTALL_FLAGS) \
- $(1) install.libs install.data;
+ $(1) install.libs install.data install.progs;
endef
define Package/terminfo/install
@@ -165,6 +259,44 @@ define Package/libncurses/install
done
endef
+define Package/libncurses-clear/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clear $(1)/usr/bin/ncurses-clear
+endef
+
+define Package/libncurses-infocmp/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/infocmp $(1)/usr/bin/
+endef
+
+define Package/libncurses-tabs/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tabs $(1)/usr/bin/
+endef
+
+define Package/libncurses-tic/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tic $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/captoinfo $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/infotocap $(1)/usr/bin/
+endef
+
+define Package/libncurses-toe/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/toe $(1)/usr/bin/
+endef
+
+define Package/libncurses-tput/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tput $(1)/usr/bin/
+endef
+
+define Package/libncurses-tset/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tset $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/reset $(1)/usr/bin/ncurses-reset
+endef
+
define Package/libncurses-dev/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
@@ -203,3 +335,10 @@ $(eval $(call HostBuild))
$(eval $(call BuildPackage,terminfo))
$(eval $(call BuildPackage,libncurses))
$(eval $(call BuildPackage,libncurses-dev))
+$(eval $(call BuildPackage,libncurses-clear))
+$(eval $(call BuildPackage,libncurses-infocmp))
+$(eval $(call BuildPackage,libncurses-tabs))
+$(eval $(call BuildPackage,libncurses-tic))
+$(eval $(call BuildPackage,libncurses-toe))
+$(eval $(call BuildPackage,libncurses-tput))
+$(eval $(call BuildPackage,libncurses-tset))
---
base-commit: 93cf01b0b6fe169492be255db8613016b9d0c3cd
change-id: 20260830-ncurses_progs-e2702f4974f3
Best regards,
--
- Charlie
More information about the openwrt-devel
mailing list