Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- ...st-ncurses-silence-capability-misuse.patch | 37 ++++++++ recipes-core/ncurses/ncurses-morello.inc | 87 +++++++++++++++++++ recipes-core/ncurses/ncurses-morello_6.4.bb | 16 ++++ recipes-core/ncurses/site_config/headers | 5 ++ 4 files changed, 145 insertions(+) create mode 100644 recipes-core/ncurses/cheri-patches/0001-test-ncurses-silence-capability-misuse.patch create mode 100644 recipes-core/ncurses/ncurses-morello.inc create mode 100644 recipes-core/ncurses/ncurses-morello_6.4.bb create mode 100644 recipes-core/ncurses/site_config/headers
diff --git a/recipes-core/ncurses/cheri-patches/0001-test-ncurses-silence-capability-misuse.patch b/recipes-core/ncurses/cheri-patches/0001-test-ncurses-silence-capability-misuse.patch new file mode 100644 index 0000000..4b13aa6 --- /dev/null +++ b/recipes-core/ncurses/cheri-patches/0001-test-ncurses-silence-capability-misuse.patch @@ -0,0 +1,37 @@ +From 41fce85513400f5fc6324516d5ac23628fc38ae2 Mon Sep 17 00:00:00 2001 +From: Pawel Zalewski pzalewski@thegoodpenguin.co.uk +Date: Tue, 11 Apr 2023 15:36:28 +0100 +Subject: [PATCH] test/ncurses: silence capability-misuse + +Cast the data to uintptr_t to silence the warning. + +Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk +--- + test/ncurses.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/ncurses.c b/test/ncurses.c +index afa631ad..65040902 100644 +--- a/test/ncurses.c ++++ b/test/ncurses.c +@@ -6392,7 +6392,7 @@ make_field(int frow, int fcol, int rows, int cols, bool secure) + + if (f) { + set_field_back(f, A_UNDERLINE); +- set_field_userptr(f, (void *) 0); ++ set_field_userptr(f, (void *)(uintptr_t)0); + } + return (f); + } +@@ -6487,7 +6487,7 @@ edit_secure(FIELD *me, int c) + break; + } + } +- set_field_userptr(me, (void *) len); ++ set_field_userptr(me, (void *)(uintptr_t)len); + free(temp); + } + } +-- +2.34.1 + diff --git a/recipes-core/ncurses/ncurses-morello.inc b/recipes-core/ncurses/ncurses-morello.inc new file mode 100644 index 0000000..b45aaf1 --- /dev/null +++ b/recipes-core/ncurses/ncurses-morello.inc @@ -0,0 +1,87 @@ +inherit autotools pkgconfig purecap-sysroot + +MORELLO_SRC = "poky/meta/recipes-core/ncurses/*" + +SUMMARY = "The New Curses library" +DESCRIPTION = "SVr4 and XSI-Curses compatible curses library and terminfo tools including tic, infocmp, captoinfo. Supports color, multiple highlights, forms-drawing characters, and automatic recognition of keypad and function-key sequences. Extensions include resizable windows and mouse support on both xterm and Linux console using the gpm library." +HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=c5a4600fdef86384c41ca33ecc70a4b8;endline=27" +SECTION = "libs" + +TOOLCHAIN = "${MORELLO_TOOLCHAIN}" + +DEPENDS += "ncurses-native" + +do_configure() { + oe_runconf \ + --without-debug \ + --without-ada \ + --without-gpm \ + --enable-termcap \ + --enable-echo \ + --enable-warnings \ + --with-shared \ + --disable-big-core \ + --program-prefix= \ + --with-manpage-format=normal \ + --without-manpage-renames \ + --disable-stripping \ + --disable-rpath-hack \ + --without-cxx-binding \ + --without-cxx \ + --enable-overwrite +} + +do_compile() { + oe_runmake all +} + +do_install:append() { + ${OBJDUMP_COMMAND} ${D}${libdir}/libcurses.so > ${D}${PURECAP_DEBUGDIR}/libcurses.dump + ${READELF_COMMAND} ${D}${libdir}/libcurses.so > ${D}${PURECAP_DEBUGDIR}/libcurses.readelf +} + +PACKAGES += " \ + ${PN}-tools \ + ${PN}-terminfo-base \ + ${PN}-terminfo \ +" + +FILES:${PN} += "\ + ${bindir}/tput \ + ${bindir}/tset \ + ${bindir}/ncurses5-config \ + ${bindir}/ncursesw5-config \ + ${bindir}/ncurses6-config \ + ${bindir}/ncursesw6-config \ + ${datadir}/tabset \ +" + +# This keeps only tput/tset in ncurses +# clear/reset are in already busybox +FILES:${PN}-tools = "\ + ${bindir}/tic \ + ${bindir}/toe \ + ${bindir}/infotocap \ + ${bindir}/captoinfo \ + ${bindir}/infocmp \ + ${bindir}/tack \ + ${bindir}/tabs \ + ${bindir}/clear \ + ${bindir}/reset \ + " + +FILES:${PN}-terminfo = "\ + ${datadir}/terminfo \ + ${libdir}/terminfo \ +" + +FILES:${PN}-terminfo-base = "\ + ${sysconfdir}/terminfo \ +" + +# Putting terminfo into the sysroot adds around 2800 files to +# each recipe specific sysroot. We can live without this, particularly +# as many recipes may have native and target copies. +SYSROOT_DIRS:remove = "${datadir}" \ No newline at end of file diff --git a/recipes-core/ncurses/ncurses-morello_6.4.bb b/recipes-core/ncurses/ncurses-morello_6.4.bb new file mode 100644 index 0000000..6ba7111 --- /dev/null +++ b/recipes-core/ncurses/ncurses-morello_6.4.bb @@ -0,0 +1,16 @@ +require ncurses-morello.inc + +FILESEXTRAPATHS:prepend := "${THISDIR}/cheri-patches:" + +SRC_URI += "git://github.com/mirror/ncurses;protocol=https;branch=${SRCBRANCH} \ + file://0001-test-ncurses-silence-capability-misuse.patch \ + " + +SRCBRANCH = "master" +SRCREV = "79b9071f2be20a24c7be031655a5638f6032f29f" + +S = "${WORKDIR}/git" + +RPROVIDES:${PN} = "ncurses-morello" + +RDEPENDS:${PN} += "bash" diff --git a/recipes-core/ncurses/site_config/headers b/recipes-core/ncurses/site_config/headers new file mode 100644 index 0000000..087b7bf --- /dev/null +++ b/recipes-core/ncurses/site_config/headers @@ -0,0 +1,5 @@ +curses.h +ncurses/curses.h +ncurses.h +ncurses/termcap.h +