All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCHv2 0/4] Ncurses wide support
@ 2014-08-20 14:06 Gustavo Zacarias
  2014-08-20 14:06 ` [Buildroot] [PATCHv2 1/4] package/ncurses: Allow building wide char support Gustavo Zacarias
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Gustavo Zacarias @ 2014-08-20 14:06 UTC (permalink / raw)
  To: buildroot

This is the compiled series for ncurses wide support.
Tested a while ago with an allyespackageconfig.
Closes bug #6950

Changes for v2:
  Make the static fix patch also do it for dynamic targets as well

Gustavo Zacarias (3):
  package/ncurses: fixup library symlink for static libs
  nano: enable ncursesw support
  httping: enable ncurses support

Jeremy Kerr (1):
  package/ncurses: Allow building wide char support

 package/httping/httping.mk |  3 ++-
 package/nano/nano.mk       |  9 +++++++--
 package/ncurses/Config.in  |  8 ++++++++
 package/ncurses/ncurses.mk | 35 +++++++++++++++++++++++++++++++++--
 4 files changed, 50 insertions(+), 5 deletions(-)

-- 
1.8.5.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCHv2 1/4] package/ncurses: Allow building wide char support
  2014-08-20 14:06 [Buildroot] [PATCHv2 0/4] Ncurses wide support Gustavo Zacarias
@ 2014-08-20 14:06 ` Gustavo Zacarias
  2014-09-15 21:42   ` Peter Korsgaard
  2014-08-20 14:06 ` [Buildroot] [PATCHv2 2/4] package/ncurses: fixup library symlink for static libs Gustavo Zacarias
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Gustavo Zacarias @ 2014-08-20 14:06 UTC (permalink / raw)
  To: buildroot

From: Jeremy Kerr <jk@ozlabs.org>

Allow ncurses to be configured with wide char support; this causes the
libraries to be built with the 'w' suffix (eg libncursesw.so,
libmenuw.so, etc), so we need to create a few symlinks.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/ncurses/Config.in  |  6 ++++++
 package/ncurses/ncurses.mk | 24 ++++++++++++++++++++++--
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/package/ncurses/Config.in b/package/ncurses/Config.in
index e8ab710..b90ec9e 100644
--- a/package/ncurses/Config.in
+++ b/package/ncurses/Config.in
@@ -10,6 +10,12 @@ config BR2_PACKAGE_NCURSES
 
 if BR2_PACKAGE_NCURSES
 
+config BR2_PACKAGE_NCURSES_WCHAR
+	bool "enable wide char support"
+	depends on BR2_USE_WCHAR
+	help
+	  Enable wide char & UTF-8 support in ncurses libraries
+
 config BR2_PACKAGE_NCURSES_TARGET_PANEL
 	bool "ncurses libpanel in target"
 	help
diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
index 4bba8f1..bd2aac0 100644
--- a/package/ncurses/ncurses.mk
+++ b/package/ncurses/ncurses.mk
@@ -12,7 +12,7 @@ HOST_NCURSES_DEPENDENCIES =
 NCURSES_PROGS = clear infocmp tabs tic toe tput tset
 NCURSES_LICENSE = MIT with advertising clause
 NCURSES_LICENSE_FILES = README
-NCURSES_CONFIG_SCRIPTS = ncurses5-config
+NCURSES_CONFIG_SCRIPTS = ncurses$(NCURSES_LIB_SUFFIX)5-config
 
 NCURSES_CONF_OPT = \
 	$(if $(BR2_PREFER_STATIC_LIB),--without-shared,--with-shared) \
@@ -36,6 +36,24 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 	NCURSES_DEPENDENCIES += busybox
 endif
 
+ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
+NCURSES_CONF_OPT += --enable-widec
+NCURSES_LIB_SUFFIX = w
+
+define NCURSES_LINK_LIBS
+	for lib in $(NCURSES_LIBS-y); do \
+		ln -sf $${lib}$(NCURSES_LIB_SUFFIX).so \
+			$(1)/usr/lib/$${lib}.so; \
+	done
+endef
+
+NCURSES_LINK_TARGET_LIBS =  $(call NCURSES_LINK_LIBS, $(TARGET_DIR))
+NCURSES_LINK_STAGING_LIBS =  $(call NCURSES_LINK_LIBS, $(STAGING_DIR))
+
+NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_LIBS
+
+endif
+
 NCURSES_LIBS-y = libncurses
 NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_MENU) += libmenu
 NCURSES_LIBS-$(BR2_PACKAGE_NCURSES_TARGET_PANEL) += libpanel
@@ -56,7 +74,8 @@ endef
 ifneq ($(BR2_PREFER_STATIC_LIB),y)
 define NCURSES_INSTALL_TARGET_LIBS
 	for lib in $(NCURSES_LIBS-y); do \
-		cp -dpf $(NCURSES_DIR)/lib/$${lib}.so* $(TARGET_DIR)/usr/lib/; \
+		cp -dpf $(NCURSES_DIR)/lib/$${lib}$(NCURSES_LIB_SUFFIX).so* \
+			$(TARGET_DIR)/usr/lib/; \
 	done
 endef
 endif
@@ -74,6 +93,7 @@ endif
 define NCURSES_INSTALL_TARGET_CMDS
 	mkdir -p $(TARGET_DIR)/usr/lib
 	$(NCURSES_INSTALL_TARGET_LIBS)
+	$(NCURSES_LINK_TARGET_LIBS)
 	$(NCURSES_INSTALL_TARGET_PROGS)
 	ln -snf /usr/share/terminfo $(TARGET_DIR)/usr/lib/terminfo
 	mkdir -p $(TARGET_DIR)/usr/share/terminfo/x
-- 
1.8.5.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCHv2 2/4] package/ncurses: fixup library symlink for static libs
  2014-08-20 14:06 [Buildroot] [PATCHv2 0/4] Ncurses wide support Gustavo Zacarias
  2014-08-20 14:06 ` [Buildroot] [PATCHv2 1/4] package/ncurses: Allow building wide char support Gustavo Zacarias
@ 2014-08-20 14:06 ` Gustavo Zacarias
  2014-08-20 14:06 ` [Buildroot] [PATCHv2 3/4] nano: enable ncursesw support Gustavo Zacarias
  2014-08-20 14:06 ` [Buildroot] [PATCHv2 4/4] httping: enable ncurses support Gustavo Zacarias
  3 siblings, 0 replies; 7+ messages in thread
From: Gustavo Zacarias @ 2014-08-20 14:06 UTC (permalink / raw)
  To: buildroot

As stated on the list we need to copy static libraries when doing static
targets so add the logic for that.

Also exclude the wide option for blackfin flat since there seem to be
toolchain issues with that combination - since it's a new feature option
someone interested might look into it later.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/ncurses/Config.in  |  2 ++
 package/ncurses/ncurses.mk | 15 +++++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/package/ncurses/Config.in b/package/ncurses/Config.in
index b90ec9e..3cc0a37 100644
--- a/package/ncurses/Config.in
+++ b/package/ncurses/Config.in
@@ -13,6 +13,8 @@ if BR2_PACKAGE_NCURSES
 config BR2_PACKAGE_NCURSES_WCHAR
 	bool "enable wide char support"
 	depends on BR2_USE_WCHAR
+	# Build broken @ curses.priv.h with bad declarations
+	depends on !(BR2_bfin && BR2_BINFMT_FLAT)
 	help
 	  Enable wide char & UTF-8 support in ncurses libraries
 
diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
index bd2aac0..81a3998 100644
--- a/package/ncurses/ncurses.mk
+++ b/package/ncurses/ncurses.mk
@@ -40,15 +40,26 @@ ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
 NCURSES_CONF_OPT += --enable-widec
 NCURSES_LIB_SUFFIX = w
 
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
 define NCURSES_LINK_LIBS
 	for lib in $(NCURSES_LIBS-y); do \
+		ln -sf $${lib}$(NCURSES_LIB_SUFFIX).a \
+			$(1)/usr/lib/$${lib}.a; \
+	done
+endef
+else
+define NCURSES_LINK_LIBS
+	for lib in $(NCURSES_LIBS-y); do \
+		ln -sf $${lib}$(NCURSES_LIB_SUFFIX).a \
+			$(1)/usr/lib/$${lib}.a; \
 		ln -sf $${lib}$(NCURSES_LIB_SUFFIX).so \
 			$(1)/usr/lib/$${lib}.so; \
 	done
 endef
+endif
 
-NCURSES_LINK_TARGET_LIBS =  $(call NCURSES_LINK_LIBS, $(TARGET_DIR))
-NCURSES_LINK_STAGING_LIBS =  $(call NCURSES_LINK_LIBS, $(STAGING_DIR))
+NCURSES_LINK_TARGET_LIBS = $(call NCURSES_LINK_LIBS, $(TARGET_DIR))
+NCURSES_LINK_STAGING_LIBS = $(call NCURSES_LINK_LIBS, $(STAGING_DIR))
 
 NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_LIBS
 
-- 
1.8.5.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCHv2 3/4] nano: enable ncursesw support
  2014-08-20 14:06 [Buildroot] [PATCHv2 0/4] Ncurses wide support Gustavo Zacarias
  2014-08-20 14:06 ` [Buildroot] [PATCHv2 1/4] package/ncurses: Allow building wide char support Gustavo Zacarias
  2014-08-20 14:06 ` [Buildroot] [PATCHv2 2/4] package/ncurses: fixup library symlink for static libs Gustavo Zacarias
@ 2014-08-20 14:06 ` Gustavo Zacarias
  2014-08-20 14:06 ` [Buildroot] [PATCHv2 4/4] httping: enable ncurses support Gustavo Zacarias
  3 siblings, 0 replies; 7+ messages in thread
From: Gustavo Zacarias @ 2014-08-20 14:06 UTC (permalink / raw)
  To: buildroot

Enable support for ncurses widechar by specifying the proper
ncursesw-config when it's enabled, otherwise keep the old trick in place
when it's not to avoid automatically picking up the host/distro one.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/nano/nano.mk | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/nano/nano.mk b/package/nano/nano.mk
index 9557a93..038aaa5 100644
--- a/package/nano/nano.mk
+++ b/package/nano/nano.mk
@@ -9,11 +9,16 @@ NANO_VERSION = $(NANO_VERSION_MAJOR).6
 NANO_SITE = http://www.nano-editor.org/dist/v$(NANO_VERSION_MAJOR)
 NANO_LICENSE = GPLv3+
 NANO_LICENSE_FILES = COPYING
-NANO_MAKE_ENV = CURSES_LIB="-lncurses"
 NANO_CONF_OPT = --without-slang
-NANO_CONF_ENV = ac_cv_prog_NCURSESW_CONFIG=false
 NANO_DEPENDENCIES = ncurses
 
+ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
+	NANO_CONF_ENV += ac_cv_prog_NCURSESW_CONFIG="$(STAGING_DIR)/usr/bin/ncursesw5-config"
+else
+	NANO_CONF_ENV += ac_cv_prog_NCURSESW_CONFIG=false
+	NANO_MAKE_ENV += CURSES_LIB="-lncurses"
+endif
+
 ifeq ($(BR2_PACKAGE_FILE),y)
 	NANO_DEPENDENCIES += file
 else
-- 
1.8.5.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCHv2 4/4] httping: enable ncurses support
  2014-08-20 14:06 [Buildroot] [PATCHv2 0/4] Ncurses wide support Gustavo Zacarias
                   ` (2 preceding siblings ...)
  2014-08-20 14:06 ` [Buildroot] [PATCHv2 3/4] nano: enable ncursesw support Gustavo Zacarias
@ 2014-08-20 14:06 ` Gustavo Zacarias
  3 siblings, 0 replies; 7+ messages in thread
From: Gustavo Zacarias @ 2014-08-20 14:06 UTC (permalink / raw)
  To: buildroot

Enable automatic ncurses support now that we've got wide support.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/httping/httping.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/httping/httping.mk b/package/httping/httping.mk
index ca636c0..719b0db 100644
--- a/package/httping/httping.mk
+++ b/package/httping/httping.mk
@@ -15,11 +15,12 @@ HTTPING_LDFLAGS = $(TARGET_LDFLAGS) \
 HTTPING_DEPENDENCIES = host-gettext \
 	$(if $(BR2_NEEDS_GETTEXT),gettext) \
 	$(if $(BR2_PACKAGE_LIBICONV),libiconv) \
+	$(if $(BR2_PACKAGE_NCURSES_WCHAR),ncurses) \
 	$(if $(BR2_PACKAGE_OPENSSL),openssl) \
 	$(if $(BR2_PACKAGE_FFTW),fftw)
 HTTPING_MAKE_OPT = $(TARGET_CONFIGURE_OPTS) \
 	FW=$(if $(BR2_PACKAGE_FFTW),yes,no) \
-	NC=no \
+	NC=$(if $(BR2_PACKAGE_NCURSES_WCHAR),yes,no) \
 	SSL=$(if $(BR2_PACKAGE_OPENSSL),yes,no) \
 	TFO=$(if $(BR2_PACKAGE_HTTPING_TFO),yes,no)
 
-- 
1.8.5.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCHv2 1/4] package/ncurses: Allow building wide char support
  2014-08-20 14:06 ` [Buildroot] [PATCHv2 1/4] package/ncurses: Allow building wide char support Gustavo Zacarias
@ 2014-09-15 21:42   ` Peter Korsgaard
  2014-09-15 22:13     ` Gustavo Zacarias
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2014-09-15 21:42 UTC (permalink / raw)
  To: buildroot

>>>>> "Gustavo" == Gustavo Zacarias <gustavo@zacarias.com.ar> writes:

 > From: Jeremy Kerr <jk@ozlabs.org>
 > Allow ncurses to be configured with wide char support; this causes the
 > libraries to be built with the 'w' suffix (eg libncursesw.so,
 > libmenuw.so, etc), so we need to create a few symlinks.

 > Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
 > Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
 > Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
 > ---
 >  package/ncurses/Config.in  |  6 ++++++
 >  package/ncurses/ncurses.mk | 24 ++++++++++++++++++++++--
 >  2 files changed, 28 insertions(+), 2 deletions(-)

 > diff --git a/package/ncurses/Config.in b/package/ncurses/Config.in
 > index e8ab710..b90ec9e 100644
 > --- a/package/ncurses/Config.in
 > +++ b/package/ncurses/Config.in
 > @@ -10,6 +10,12 @@ config BR2_PACKAGE_NCURSES
 
 >  if BR2_PACKAGE_NCURSES
 
 > +config BR2_PACKAGE_NCURSES_WCHAR
 > +	bool "enable wide char support"
 > +	depends on BR2_USE_WCHAR
 > +	help
 > +	  Enable wide char & UTF-8 support in ncurses libraries
 > +
 >  config BR2_PACKAGE_NCURSES_TARGET_PANEL
 >  	bool "ncurses libpanel in target"
 >  	help
 > diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
 > index 4bba8f1..bd2aac0 100644
 > --- a/package/ncurses/ncurses.mk
 > +++ b/package/ncurses/ncurses.mk
 > @@ -12,7 +12,7 @@ HOST_NCURSES_DEPENDENCIES =
 >  NCURSES_PROGS = clear infocmp tabs tic toe tput tset
 >  NCURSES_LICENSE = MIT with advertising clause
 >  NCURSES_LICENSE_FILES = README
 > -NCURSES_CONFIG_SCRIPTS = ncurses5-config
 > +NCURSES_CONFIG_SCRIPTS = ncurses$(NCURSES_LIB_SUFFIX)5-config

You don't seem to add a ncursesw5-config -> ncurses5-config symlink, but
we explicitly refer to ncurses5-config in several places (and some
configure scripts probably also expects it):

package/alsa-utils/alsa-utils.mk:       ac_cv_prog_ncurses5_config=$(STAGING_DIR)/bin/ncurses5-config
package/dialog/dialog.mk:DIALOG_CONF_OPT += NCURSES_CONFIG=$(STAGING_DIR)/usr/bin/ncurses5-config

 
 >  NCURSES_CONF_OPT = \
 >  	$(if $(BR2_PREFER_STATIC_LIB),--without-shared,--with-shared) \
 > @@ -36,6 +36,24 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 >  	NCURSES_DEPENDENCIES += busybox
 >  endif
 
 > +ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
 > +NCURSES_CONF_OPT += --enable-widec
 > +NCURSES_LIB_SUFFIX = w
 > +
 > +define NCURSES_LINK_LIBS
 > +	for lib in $(NCURSES_LIBS-y); do \
 > +		ln -sf $${lib}$(NCURSES_LIB_SUFFIX).so \
 > +			$(1)/usr/lib/$${lib}.so; \
 > +	done
 > +endef
 > +
 > +NCURSES_LINK_TARGET_LIBS =  $(call NCURSES_LINK_LIBS, $(TARGET_DIR))
 > +NCURSES_LINK_STAGING_LIBS =  $(call NCURSES_LINK_LIBS, $(STAGING_DIR))

What's with this extra whitespace? I see it gets fixed up in patch 2,
but we might as well do it right in patch 1 instead.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCHv2 1/4] package/ncurses: Allow building wide char support
  2014-09-15 21:42   ` Peter Korsgaard
@ 2014-09-15 22:13     ` Gustavo Zacarias
  0 siblings, 0 replies; 7+ messages in thread
From: Gustavo Zacarias @ 2014-09-15 22:13 UTC (permalink / raw)
  To: buildroot

On 09/15/2014 06:42 PM, Peter Korsgaard wrote:
> You don't seem to add a ncursesw5-config -> ncurses5-config symlink, but
> we explicitly refer to ncurses5-config in several places (and some
> configure scripts probably also expects it):
> 
> package/alsa-utils/alsa-utils.mk:       ac_cv_prog_ncurses5_config=$(STAGING_DIR)/bin/ncurses5-config
> package/dialog/dialog.mk:DIALOG_CONF_OPT += NCURSES_CONFIG=$(STAGING_DIR)/usr/bin/ncurses5-config

Hi.
Well to begin with it's not my patch :)
Usually ncurses5 + ncursesw5 configs are used when you need ABI
compatibility which isn't our case (and both libraries built side by side).
According to my tests (allyespackageconfig) other than the packages i've
sent fixes for before/with this set it all works smoothly.
Also packages that don't know about widec support usually don't look for
the non-w variant.

> What's with this extra whitespace? I see it gets fixed up in patch 2,
> but we might as well do it right in patch 1 instead.

As i've said before, not my patch, just fixed the issue.
I went for a followup patch rather than rebase Jeremy's patch in case he
sent a new version, which never happened of course.
Regards.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-15 22:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-20 14:06 [Buildroot] [PATCHv2 0/4] Ncurses wide support Gustavo Zacarias
2014-08-20 14:06 ` [Buildroot] [PATCHv2 1/4] package/ncurses: Allow building wide char support Gustavo Zacarias
2014-09-15 21:42   ` Peter Korsgaard
2014-09-15 22:13     ` Gustavo Zacarias
2014-08-20 14:06 ` [Buildroot] [PATCHv2 2/4] package/ncurses: fixup library symlink for static libs Gustavo Zacarias
2014-08-20 14:06 ` [Buildroot] [PATCHv2 3/4] nano: enable ncursesw support Gustavo Zacarias
2014-08-20 14:06 ` [Buildroot] [PATCHv2 4/4] httping: enable ncurses support Gustavo Zacarias

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.