Package: ncurses
Severity: wishlist
Tags: patch

It would be very useful to have a lib32ncursesw5 in addition to the
other lib32 ncurses libraries. I've attached a patch to version 5.6
+20071124-1 which provides lib32ncursesw5 and lib32ncursesw5-dev
packages.

There's one less-than-admirable part of the patch, namely explicitly
setting BUILD_CPPFLAGS="-D_GNU_SOURCE".  That flag is required to
compile the wide character support, and configure correctly figures out
that it is needed, but unfortunately it's not passed on to the native
build flags if 
cross-compiling.

Thanks!

Diab Jerius

P.S.  The request for this is driven by the recent release of one of the
major astronomy software packages (CIAO, from
http://asc.harvard.edu/ciao/).  Unfortunately the only binary packages
are for Fedora.  While source is provided (and it's GPL'd), CIAO is not
simple to compile, so without lib32ncursesw, most Debian x86_64 users
will not be able to run it.


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.18-5-xen-vserver-amd64 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

# This is a patch for ncurses-5.6+20071124.orig to update it to ncurses-5.6+20071124
# 
# To apply this patch:
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'applypatch' program with this patch file as input.
#
# If you do not have 'applypatch', it is part of the 'makepatch' package
# that you can fetch from the Comprehensive Perl Archive Network:
# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
# In the above URL, 'x' should be 2 or higher.
#
# To apply this patch without the use of 'applypatch':
# STEP 1: Chdir to the source directory.
# If you have a decent Bourne-type shell:
# STEP 2: Run the shell with this file as input.
# If you don't have such a shell, you may need to manually create
# the files as shown below.
# STEP 3: Run the 'patch' program with this file as input.
#
# These are the commands needed to create/delete files/directories:
#
touch 'debian/lib32ncursesw5-dev.files'
chmod 0644 'debian/lib32ncursesw5-dev.files'
touch 'debian/lib32ncursesw5.files'
chmod 0644 'debian/lib32ncursesw5.files'
#
# This command terminates the shell and need not be executed manually.
exit
#
#### End of Preamble ####

#### Patch data follows ####
diff -c 'ncurses-5.6+20071124.orig/debian/control' 'ncurses-5.6+20071124/debian/control'
Index: ./debian/control
*** ./debian/control	Fri Dec 21 21:24:59 2007
--- ./debian/control	Fri Dec 21 18:51:56 2007
***************
*** 120,125 ****
--- 120,152 ----
   This package supports the 32-bit ABI variant of your system's
   architecure.
  
+ Package: lib32ncursesw5
+ Architecture: amd64 ppc64
+ Section: libs
+ Priority: optional
+ Depends: ${shlibs:Depends}, ${misc:Depends}
+ Recommends: libgpmg1
+ Description: Shared libraries for terminal handling (wide character support) (32-bit)
+  This package contains the shared libraries necessary to run programs
+  compiled with ncursesw, which includes support for wide characters.
+  .
+  This package supports the 64-bit ABI variant of your system's
+  architecure.
+ 
+ Package: lib32ncursesw5-dev
+ Architecture: amd64 ppc64
+ Section: libdevel
+ Priority: optional
+ Depends: lib32ncursesw5 (= ${Source-Version}), lib32ncursesw5-dev, lib32c-dev
+ Suggests: lib32ncurses5-dev
+ Description: Developer's libraries for ncursesw (32-bit)
+  This package contains the header files, static libraries
+  and symbolic links that developers using ncursesw will need.
+  .
+  This package includes support for wide characters.
+  This package supports the 64-bit ABI variant of your system's
+  architecure.
+ 
  Package: ncurses-bin
  Architecture: any
  Section: utils
diff -c /dev/null 'ncurses-5.6+20071124/debian/lib32ncursesw5-dev.files'
Index: ./debian/lib32ncursesw5-dev.files
*** ./debian/lib32ncursesw5-dev.files	Thu Jan  1 00:00:00 1970
--- ./debian/lib32ncursesw5-dev.files	Fri Dec 21 18:45:52 2007
***************
*** 0 ****
--- 1,12 ----
+ emul/ia32-linux/usr/lib/libncursesw.so
+ emul/ia32-linux/usr/lib/libticw.so
+ emul/ia32-linux/usr/lib/libformw.so
+ emul/ia32-linux/usr/lib/libmenuw.so
+ emul/ia32-linux/usr/lib/libpanelw.so
+ emul/ia32-linux/usr/lib/libncursesw.a
+ emul/ia32-linux/usr/lib/libncurses++w.a
+ emul/ia32-linux/usr/lib/libticw.a
+ emul/ia32-linux/usr/lib/libformw.a
+ emul/ia32-linux/usr/lib/libmenuw.a
+ emul/ia32-linux/usr/lib/libpanelw.a
+ 
diff -c /dev/null 'ncurses-5.6+20071124/debian/lib32ncursesw5.files'
Index: ./debian/lib32ncursesw5.files
*** ./debian/lib32ncursesw5.files	Thu Jan  1 00:00:00 1970
--- ./debian/lib32ncursesw5.files	Fri Dec 21 18:46:31 2007
***************
*** 0 ****
--- 1,5 ----
+ emul/ia32-linux/lib/libncursesw.so.*
+ emul/ia32-linux/lib/libticw.so.*
+ emul/ia32-linux/usr/lib/libpanelw.so.*
+ emul/ia32-linux/usr/lib/libformw.so.*
+ emul/ia32-linux/usr/lib/libmenuw.so.*
diff -c 'ncurses-5.6+20071124.orig/debian/rules' 'ncurses-5.6+20071124/debian/rules'
Index: ./debian/rules
*** ./debian/rules	Fri Dec 21 21:24:59 2007
--- ./debian/rules	Fri Dec 21 20:43:13 2007
***************
*** 19,28 ****
--- 19,30 ----
  package-lib-32=lib32ncurses$(soname)
  package-lib-64=lib64ncurses$(soname)
  package-libw=libncursesw$(soname)
+ package-libw-32=lib32ncursesw$(soname)
  package-dev=libncurses$(soname)-dev
  package-dev-32=lib32ncurses$(soname)-dev
  package-dev-64=lib64ncurses$(soname)-dev
  package-devw=libncursesw$(soname)-dev
+ package-devw-32=lib32ncursesw$(soname)-dev
  package-dbg=libncurses$(soname)-dbg
  package-dbgw=libncursesw$(soname)-dbg
  package-term=ncurses-term
***************
*** 36,41 ****
--- 38,44 ----
  objdir-32=$(srcdir)/obj-32
  objdir-64=$(srcdir)/obj-64
  wobjdir=$(srcdir)/obj-wide
+ wobjdir-32=$(srcdir)/obj-wide-32
  objdir-debug=$(srcdir)/obj-debug
  wobjdir-debug=$(srcdir)/obj-wide-debug
  
***************
*** 66,79 ****
  
  ifeq ($(DEB_HOST_ARCH),amd64)
  build_32_target = i486-$(DEB_HOST_GNU_SYSTEM)
! build_32 = build-32
  lib32 = /emul/ia32-linux/lib
  usr_lib32 = /emul/ia32-linux/usr/lib
  endif
  
  ifeq ($(DEB_HOST_ARCH),ppc64)
  build_32_target = powerpc-$(DEB_HOST_GNU_SYSTEM)
! build_32 = build-32
  lib32 = /lib32
  usr_lib32 = /usr/lib32
  endif
--- 69,82 ----
  
  ifeq ($(DEB_HOST_ARCH),amd64)
  build_32_target = i486-$(DEB_HOST_GNU_SYSTEM)
! build_32 = build-32 build-wide-32
  lib32 = /emul/ia32-linux/lib
  usr_lib32 = /emul/ia32-linux/usr/lib
  endif
  
  ifeq ($(DEB_HOST_ARCH),ppc64)
  build_32_target = powerpc-$(DEB_HOST_GNU_SYSTEM)
! build_32 = build-32 build-wide-32
  lib32 = /lib32
  usr_lib32 = /usr/lib32
  endif
***************
*** 184,189 ****
--- 187,207 ----
  		--with-install-prefix=$(fulltempdir) \
  		--disable-overwrite --enable-widec
  
+ $(wobjdir-32)/config.status: patch
+ 	test -d $(wobjdir-32) || mkdir $(wobjdir-32)
+ 
+ 	cd $(wobjdir-32) && CFLAGS="$(CFLAGS)" CC="gcc -m32" \
+ 		BUILD_CC="gcc" BUILD_CPPFLAGS="-D_GNU_SOURCE" CXX="g++ -m32" \
+ 		$(srcdir)/configure \
+ 		$(CONFARGS) \
+ 		--build=$(DEB_BUILD_GNU_TYPE) \
+ 		--host=$(build_32_target) \
+ 		--without-gpm \
+ 		--with-install-prefix=$(fulltempdir) \
+ 		--disable-overwrite --enable-widec \
+ 		--libdir=$(usr_lib32)
+ 
+ 
  build: build-normal build-wide build-debug build-wide-debug \
  	$(build_64) $(build_32)
  
***************
*** 209,214 ****
--- 227,236 ----
  	cd $(wobjdir) && $(MAKE)
  	touch $@
  
+ build-wide-32: $(wobjdir-32)/config.status
+ 	cd $(wobjdir-32) && $(MAKE)
+ 	touch $@
+ 
  build-wide-debug: $(wobjdir-debug)/config.status
  	cd $(wobjdir-debug) && $(MAKE)
  	touch $@
***************
*** 221,226 ****
--- 243,249 ----
  	rm -rf $(objdir-32)
  	rm -rf $(objdir-64)
  	rm -rf $(wobjdir)
+ 	rm -rf $(wobjdir-32)
  	rm -rf $(objdir-debug)
  	rm -rf $(wobjdir-debug)
  	rm -f build-normal build-wide build-debug build-wide-debug \
***************
*** 239,247 ****
--- 262,273 ----
  
  ifneq ($(build_32),)
  	$(MAKE) -C $(objdir-32) install.libs
+ 	$(MAKE) -C $(wobjdir-32) install.libs
  	test -d $(tempdir)$(lib32) || mkdir $(tempdir)$(lib32)
  	mv $(tempdir)$(usr_lib32)/libncurses.so.$(vername) $(tempdir)$(lib32)/
  	mv $(tempdir)$(usr_lib32)/libncurses.so.$(soname) $(tempdir)$(lib32)/
+ 	mv $(tempdir)$(usr_lib32)/libncursesw.so.$(vername) $(tempdir)$(lib32)/
+ 	mv $(tempdir)$(usr_lib32)/libncursesw.so.$(soname) $(tempdir)$(lib32)/
  	mv $(tempdir)$(usr_lib32)/libtic.so.$(vername) $(tempdir)$(lib32)/
  	mv $(tempdir)$(usr_lib32)/libtic.so.$(soname) $(tempdir)$(lib32)/
  endif
***************
*** 345,350 ****
--- 371,377 ----
  	# Since the 32-bit libraries live in /emul, we can use a relative
  	# symlink.
  	ln -sf /lib32/libncurses.so.$(soname) debian/$(package-dev-32)$(usr_lib32)/libncurses.so
+ 	ln -sf /lib32/libncursesw.so.$(soname) debian/$(package-devw-32)$(usr_lib32)/libncursesw.so
  	ln -sf /lib32/libtic.so.$(soname) debian/$(package-dev-32)$(usr_lib32)/libtic.so
  endif
  ifneq ($(build_64),)
***************
*** 387,392 ****
--- 414,420 ----
  	dh_makeshlibs -p$(package-libw) -V "$(package-libw) $(sodepver)"
  ifneq ($(build_32),)
  	dh_makeshlibs -p$(package-lib-32) -V "$(package-lib-32) $(sodepver)"
+ 	dh_makeshlibs -p$(package-libw-32) -V "$(package-libw-32) $(sodepver)"
  endif
  ifneq ($(build_64),)
  	dh_makeshlibs -p$(package-lib-64) -V "$(package-lib-64) $(sodepver)"
***************
*** 403,408 ****
--- 431,439 ----
  	dh_shlibdeps -p$(package-lib-32) \
  		-l$(lib32):$(usr_lib32):debian/$(package-lib-32)$(lib32):debian/$(package-lib-32)$(usr_lib32) \
  		-- -L$(shell pwd)/debian/shlibs.dummy
+ 	dh_shlibdeps -p$(package-libw-32) \
+ 		-l$(lib32):$(usr_lib32):debian/$(package-libw-32)$(lib32):debian/$(package-libw-32)$(usr_lib32) \
+ 		-- -L$(shell pwd)/debian/shlibs.dummy
  endif
  
  ifneq ($(build_64),)
***************
*** 422,428 ****
  	  debian/$(package-libw)/DEBIAN/shlibs > debian/shlibs.local
  
  	dh_shlibdeps -s -N$(package-lib) -N$(package-libw) \
! 		-N$(package-lib-32) -N$(package-lib-64) \
  		-ldebian/$(package-lib)/lib:debian/$(package-lib)/usr/lib:debian/$(package-libw)/usr/lib
  
  	dh_gencontrol -s
--- 453,459 ----
  	  debian/$(package-libw)/DEBIAN/shlibs > debian/shlibs.local
  
  	dh_shlibdeps -s -N$(package-lib) -N$(package-libw) \
! 		-N$(package-lib-32) -N$(package-libw-32) -N$(package-lib-64) \
  		-ldebian/$(package-lib)/lib:debian/$(package-lib)/usr/lib:debian/$(package-libw)/usr/lib
  
  	dh_gencontrol -s
#### End of Patch data ####

#### ApplyPatch data follows ####
# Data version        : 1.0
# Date generated      : Fri Dec 21 21:26:25 2007
# Generated by        : makepatch 2.00_12*
# Recurse directories : Yes
# Excluded files      : (\A|/).*\~\Z
#                       (\A|/).*\.a\Z
#                       (\A|/).*\.bak\Z
#                       (\A|/).*\.BAK\Z
#                       (\A|/).*\.elc\Z
#                       (\A|/).*\.exe\Z
#                       (\A|/).*\.gz\Z
#                       (\A|/).*\.ln\Z
#                       (\A|/).*\.o\Z
#                       (\A|/).*\.obj\Z
#                       (\A|/).*\.olb\Z
#                       (\A|/).*\.old\Z
#                       (\A|/).*\.orig\Z
#                       (\A|/).*\.rej\Z
#                       (\A|/).*\.so\Z
#                       (\A|/).*\.Z\Z
#                       (\A|/)\.del\-.*\Z
#                       (\A|/)\.make\.state\Z
#                       (\A|/)\.nse_depinfo\Z
#                       (\A|/)core\Z
#                       (\A|/)tags\Z
#                       (\A|/)TAGS\Z
# p 'debian/control' 5135 1198263116 0100644
# c 'debian/lib32ncursesw5-dev.files' 0 1198262752 0100644
# c 'debian/lib32ncursesw5.files' 0 1198262791 0100644
# p 'debian/rules' 14753 1198269793 0100755
#### End of ApplyPatch data ####

#### End of Patch kit [created: Fri Dec 21 21:26:25 2007] ####
#### Patch checksum: 279 9508 48654 ####
#### Checksum: 311 10712 19161 ####

Reply via email to