[oe-commits] Enrico Scholz : ncurses: swapped installation of widec and narrowc headers

git version control git at git.openembedded.org
Wed Aug 11 16:31:22 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 02b206798943259214336d2a6ffbacfdf5562e44
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=02b206798943259214336d2a6ffbacfdf5562e44

Author: Enrico Scholz <enrico.scholz at sigma-chemnitz.de>
Date:   Wed Aug 11 15:27:46 2010 +0200

ncurses: swapped installation of widec and narrowc headers

Widec headers contain additional definitions and shall be installed
last hence.  To ensure compatibility of both headers a sanity check
was added.

Thanks to Martin Jansa for noticing this issue.

Signed-off-by: Enrico Scholz <enrico.scholz at sigma-chemnitz.de>

---

 recipes/ncurses/ncurses_5.7.bb |   41 +++++++++++++++++++++++++++++++++------
 1 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/recipes/ncurses/ncurses_5.7.bb b/recipes/ncurses/ncurses_5.7.bb
index 3562685..ab029ae 100644
--- a/recipes/ncurses/ncurses_5.7.bb
+++ b/recipes/ncurses/ncurses_5.7.bb
@@ -4,15 +4,15 @@ LICENSE = "MIT"
 SECTION = "libs"
 PATCHDATE = "20100501"
 PKGV = "${PV}+${PATCHDATE}"
-PR = "r10"
+PR = "r11"
 
 # recipe is experimental for now...
 DEFAULT_PREFERENCE = "-99"
 
-DEPENDS = "ncurses-native"
-DEPENDS_virtclass-native = ""
+DEPENDS = "ncurses-native unifdef-native"
+DEPENDS_virtclass-native = "unifdef-native"
 
-inherit autotools binconfig
+inherit autotools binconfig test
 
 SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz;name=tarball \
         ftp://invisible-island.net/ncurses/5.7/ncurses-5.7-20100424-patch.sh.bz2;apply=yes;name=p20100424sh \
@@ -83,6 +83,30 @@ do_compile() {
             oe_runmake -C widec libs
 }
 
+# set of expected differences between narrowc and widec header
+#
+# TODO: the NCURSES_CH_T difference can cause real problems :(
+_unifdef_cleanup = " \
+  -e '\!/\* \$Id: curses.wide,v!,\!/\* \$Id: curses.tail,v!d' \
+  -e '/^#define NCURSES_CH_T /d' \
+  -e '/^#include <wchar.h>/d' \
+  -e '\!^/\* .* \*/!d' \
+"
+
+do_test[dirs] = "${S}"
+do_test() {
+        ${ENABLE_WIDEC} || return 0
+
+        # make sure that the narrow and widec header are compatible
+        # and differ only in minor details.
+        unifdef -k narrowc/include/curses.h | \
+            sed ${_unifdef_cleanup} > curses-narrowc.h
+        unifdef -k widec/include/curses.h | \
+            sed ${_unifdef_cleanup} > curses-widec.h
+
+        diff curses-narrowc.h curses-widec.h
+}
+
 _install_opts = "\
   DESTDIR='${D}' \
   PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' \
@@ -90,12 +114,15 @@ _install_opts = "\
 "
 
 do_install() {
+        # Order of installation is important; widec installs a 'curses.h'
+        # header with more definitions and must be installed last hence.
+        # Compatibility of these headers will be checked in 'do_test()'.
+        oe_runmake -C narrowc ${_install_opts} \
+                install.data install.progs
+
         ! ${ENABLE_WIDEC} || \
             oe_runmake -C widec ${_install_opts}
 
-        oe_runmake -C narrowc ${_install_opts} \
-		install.data install.progs
-
 
         cd narrowc
 





More information about the Openembedded-commits mailing list