Skip to contentSkip to conversation

ncurses: Add wchar support

PATCH New Serj Kalichev 2 participants 3 messages Jan 17, 2011 – Feb 24, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ncurses: Add wchar support

When the BR2_USE_WCHAR is "y" the ncurses will be configured with wide char support. It will build ncursesw.* instead ncurses.*.

---
 package/ncurses/ncurses.mk |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)
package/ncurses/ncurses.mk +17 -11
index 0a49887..2e9c5d0 100644
@@ -43,11 +43,17 @@ NCURSES_CONF_OPT = \
 	--enable-broken_linker \
 	--disable-static
 
+ifeq ($(BR2_USE_WCHAR),y)
+NCURSES_CONF_OPT += \
+	--enable-widec \
+	--with-build-cppflags=-D_GNU_SOURCE
+NCURSES_W = w
+endif
+
 ifneq ($(BR2_ENABLE_DEBUG),y)
 NCURSES_CONF_OPT += --without-debug
 endif
 
-
 define NCURSES_BUILD_CMDS
 	$(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR)
 endef
@@ -67,38 +73,38 @@ define NCURSES_INSTALL_TARGET_DEVFILES
 	cp -dpf $(NCURSES_DIR)/include/term.h $(TARGET_DIR)/usr/include/
 	cp -dpf $(NCURSES_DIR)/include/unctrl.h $(TARGET_DIR)/usr/include/
 	cp -dpf $(NCURSES_DIR)/include/termcap.h $(TARGET_DIR)/usr/include/
-	cp -dpf $(NCURSES_DIR)/lib/libncurses.a $(TARGET_DIR)/usr/lib/
+	cp -dpf $(NCURSES_DIR)/lib/libncurses*.a $(TARGET_DIR)/usr/lib/
 	(cd $(TARGET_DIR)/usr/lib; \
-	 ln -fs libncurses.a libcurses.a; \
-	 ln -fs libncurses.a libtermcap.a; \
+	 ln -fs libncurses$(NCURSES_W).a libcurses.a; \
+	 ln -fs libncurses$(NCURSES_W).a libtermcap.a; \
 	)
 	(cd $(TARGET_DIR)/usr/include; ln -fs curses.h ncurses.h)
-	rm -f $(TARGET_DIR)/usr/lib/libncurses.so
-	(cd $(TARGET_DIR)/usr/lib; ln -fs libncurses.so.$(NCURSES_VERSION) libncurses.so)
+	rm -f $(TARGET_DIR)/usr/lib/libncurses*.so
+	(cd $(TARGET_DIR)/usr/lib; ln -fs libncurses$(NCURSES_W).so.$(NCURSES_VERSION) libncurses$(NCURSES_W).so)
 endef
 endif
 
 ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PANEL),y)
 define NCURSES_INSTALL_TARGET_PANEL
-	cp -dpf $(NCURSES_DIR)/lib/libpanel.so* $(TARGET_DIR)/usr/lib/
+	cp -dpf $(NCURSES_DIR)/lib/libpanel*.so* $(TARGET_DIR)/usr/lib/
 endef
 endif
 
 ifeq ($(BR2_PACKAGE_NCURSES_TARGET_FORM),y)
 define NCURSES_INSTALL_TARGET_FORM
-	cp -dpf $(NCURSES_DIR)/lib/libform.so* $(TARGET_DIR)/usr/lib/
+	cp -dpf $(NCURSES_DIR)/lib/libform*.so* $(TARGET_DIR)/usr/lib/
 endef
 endif
 
 ifeq ($(BR2_PACKAGE_NCURSES_TARGET_MENU),y)
 define NCURSES_INSTALL_TARGET_MENU
-	cp -dpf $(NCURSES_DIR)/lib/libmenu.so* $(TARGET_DIR)/usr/lib/
+	cp -dpf $(NCURSES_DIR)/lib/libmenu*.so* $(TARGET_DIR)/usr/lib/
 endef
 endif
 
 define NCURSES_INSTALL_TARGET_CMDS
 	mkdir -p $(TARGET_DIR)/usr/lib
-	cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/usr/lib/
+	cp -dpf $(NCURSES_DIR)/lib/libncurses*.so* $(TARGET_DIR)/usr/lib/
 	$(NCURSES_INSTALL_TARGET_PANEL)
 	$(NCURSES_INSTALL_TARGET_FORM)
 	$(NCURSES_INSTALL_TARGET_MENU)
@@ -116,7 +122,7 @@ define NCURSES_INSTALL_TARGET_CMDS
 	cp -dpf $(STAGING_DIR)/usr/share/terminfo/a/ansi $(TARGET_DIR)/usr/share/terminfo/a
 	mkdir -p $(TARGET_DIR)/usr/share/terminfo/l
 	cp -dpf $(STAGING_DIR)/usr/share/terminfo/l/linux $(TARGET_DIR)/usr/share/terminfo/l
-	-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libncurses.so*
+	-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libncurses*.so*
 	$(NCURSES_INSTALL_TARGET_DEVFILES)
 endef # NCURSES_INSTALL_TARGET_CMDS
 
Signature · 1 line
1.7.3.5
#1 lore raw

PATCH 2/2 dialog: Add wchar support

The dialog can be build with wide char version of ncursesw. The wide char support is depend on BR2_USE_WCHAR.

---
 package/dialog/dialog.mk |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
package/dialog/dialog.mk +6 -2
index e8f025f..d2d5862 100644
@@ -6,10 +6,14 @@
 DIALOG_VERSION:=1.1-20100428
 DIALOG_SOURCE:=dialog-$(DIALOG_VERSION).tgz
 DIALOG_SITE:=ftp://invisible-island.net/dialog
-DIALOG_CONF_OPT = --with-ncurses
-DIALOG_CONF_ENV = ac_cv_path_NCURSES_CONFIG=true LIBS=-lncurses
 DIALOG_DEPENDENCIES = ncurses
 
+ifneq ($(BR2_USE_WCHAR),y)
+DIALOG_CONF_OPT = --with-ncurses
+else
+DIALOG_CONF_OPT = --with-ncursesw --enable-widec
+endif
+
 ifneq ($(BR2_ENABLE_LOCALE),y)
 DIALOG_DEPENDENCIES+=libiconv
 endif
Signature · 1 line
1.7.3.5
#2 lore raw

PATCH 1/2 ncurses: Add wchar support

In reply to Serj Kalichev

Serj Kalichev <[email protected]>
wrote in news:1295280886-20910-1-git-send-email-serj.kalichev at gmail.com:

Quoted 5 lines

When the BR2_USE_WCHAR is "y" the ncurses will be configured with wide char support. It will build ncursesw.* instead ncurses.*.

---
 package/ncurses/ncurses.mk |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

Hi,

following up Thomas Petazzonis todays post about optimizing the ncurses build I would like to bump this patch as well for inclusion with the following change:

The line including NCURSES_CONFIG_SCRIPTS needs to be moved after the "ifeq ($(BR2_USE_WCHAR),y)"-area containing this line of code instead:

NCURSES_CONFIG_SCRIPTS = ncurses$(NCURSES_W)5-config

(Sorry, I do not use git)

Ncursesw seems to be needed[1] for VLC if BR2_PACKAGE_VLC_NCURSES=y is set, see http://patchwork.ozlabs.org/patch/171335/ for the VLC patch.

Regards,

Bernd

[1] http://forums.gentoo.org/viewtopic-p-7217872.html