Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,43 @@
From 168ba7a681be73ac024438e33e14fde1d5aea97d Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Fri, 30 Mar 2018 10:02:24 +0800
Subject: [PATCH 1/2] tic hang
Upstream-Status: Inappropriate [configuration]
'tic' of some linux distributions (e.g. fedora 11) hang in an infinite
loop when processing the original file.
Signed-off-by: anonymous
Rebase to 6.1
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
misc/terminfo.src | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/misc/terminfo.src b/misc/terminfo.src
index 84f4810..6b385ec 100644
--- a/misc/terminfo.src
+++ b/misc/terminfo.src
@@ -5562,12 +5562,11 @@ konsole-xf3x|KDE console window with keyboard for XFree86 3.x xterm,
# The value for kbs (see konsole-vt100) reflects local customization rather
# than the settings used for XFree86 xterm.
konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm,
- kend=\EOF, khome=\EOH, use=konsole+pcfkeys,
- use=konsole-vt100,
-
-konsole+pcfkeys|konsole subset of xterm+pcfkeys,
- kcbt=\E[Z, use=xterm+pcc2, use=xterm+pcf0,
- use=xterm+pce2,
+ kend=\EOF, kf1=\EOP, kf13=\EO2P, kf14=\EO2Q, kf15=\EO2R,
+ kf16=\EO2S, kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~,
+ kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~,
+ kf23=\E[23;2~, kf24=\E[24;2~, kf3=\EOR, kf4=\EOS,
+ khome=\EOH, use=konsole-vt100,
# Obsolete: vt100.keymap
# KDE's "vt100" keyboard has no relationship to any terminal that DEC made, but
--
1.8.3.1
@@ -0,0 +1,33 @@
From ec87e53066a9942e9aaba817d71268342f5e83b9 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Wed, 16 Aug 2017 14:45:27 +0800
Subject: [PATCH] configure: reproducible
"configure" enforces -U for ar flags, breaking deterministic builds.
The flag was added to fix some vaguely specified "recent POSIX binutil
build problems" in 2015.
Upstream-Status: Pending
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Rebase to 6.1
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 421cf859..a1b7840d 100755
--- a/configure
+++ b/configure
@@ -5072,7 +5072,7 @@ else
;;
(*)
cf_cv_ar_flags=unknown
- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
+ for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
do
# check if $ARFLAGS already contains this choice
@@ -0,0 +1,30 @@
From 10cd0c12a6e14fb4f0498c299c1dd32720b710da Mon Sep 17 00:00:00 2001
From: Nathan Rossi <nathan@nathanrossi.com>
Date: Mon, 14 Dec 2020 13:39:02 +1000
Subject: [PATCH] gen-pkgconfig.in: Do not include LDFLAGS in generated pc
files
Including the LDFLAGS in the pkgconfig output is problematic as OE
includes build host specific paths and options (e.g. uninative and
'-Wl,--dynamic-linker=').
Upstream-Status: Inappropriate [OE Specific]
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
---
misc/gen-pkgconfig.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc/gen-pkgconfig.in b/misc/gen-pkgconfig.in
index a45dd54f..85273054 100644
--- a/misc/gen-pkgconfig.in
+++ b/misc/gen-pkgconfig.in
@@ -83,7 +83,7 @@ if [ "$includedir" != "/usr/include" ]; then
fi
lib_flags=
-for opt in -L$libdir @EXTRA_PKG_LDFLAGS@ @LIBS@
+for opt in -L$libdir @LIBS@
do
case $opt in
-l*) # LIBS is handled specially below
@@ -0,0 +1,32 @@
From 4a769a441d7e57a23017c3037cde3e53fb9f35fe Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 30 Aug 2022 15:58:32 -0700
Subject: [PATCH] Add needed headers for including mbstate_t and exit()
Upstream-Status: Inappropriate [Reconfigure will solve it]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configure b/configure
index f377f551..163f8899 100755
--- a/configure
+++ b/configure
@@ -3423,6 +3423,7 @@ rm -f "conftest.$ac_objext" "conftest.$ac_ext"
cat >"conftest.$ac_ext" <<_ACEOF
#line 3424 "configure"
#include "confdefs.h"
+#include <stdlib.h>
$ac_declaration
int
main (void)
@@ -13111,6 +13112,7 @@ cat >"conftest.$ac_ext" <<_ACEOF
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
+#include <wchar.h>
#ifdef HAVE_LIBUTF8_H
#include <libutf8.h>
#endif
+327
View File
@@ -0,0 +1,327 @@
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"
DEPENDS = "ncurses-native"
DEPENDS:class-native = ""
BINCONFIG = "${bindir}/ncurses5-config ${bindir}/ncursesw5-config \
${bindir}/ncurses6-config ${bindir}/ncursesw6-config"
inherit autotools binconfig-disabled multilib_header pkgconfig
# Upstream has useful patches at times at ftp://invisible-island.net/ncurses/
SRC_URI = "git://github.com/mirror/ncurses.git;protocol=https;branch=master"
EXTRA_AUTORECONF = "-I m4"
CACHED_CONFIGUREVARS = "cf_cv_func_nanosleep=yes"
CACHED_CONFIGUREVARS:append:linux = " cf_cv_working_poll=yes"
EXTRASITECONFIG = "CFLAGS='${CFLAGS} -I${SYSROOT_DESTDIR}${includedir}'"
# Whether to enable separate widec libraries; must be 'true' or 'false'
#
# TODO: remove this variable when widec is supported in every setup?
ENABLE_WIDEC ?= "true"
# _GNU_SOURCE is required for widec stuff and is detected automatically
# for target objects. But it must be set manually for native and sdk
# builds.
BUILD_CPPFLAGS += "-D_GNU_SOURCE"
# natives don't generally look in base_libdir
base_libdir:class-native = "${libdir}"
# Display corruption occurs on 64 bit hosts without these settings
# This was derrived from the upstream debian ncurses which uses
# these settings for 32 and 64 bit hosts.
EXCONFIG_ARGS = ""
EXCONFIG_ARGS:class-native = " \
--disable-lp64 \
--with-chtype='long' \
--with-mmask-t='long'"
EXCONFIG_ARGS:class-nativesdk = " \
--disable-lp64 \
--with-chtype='long' \
--with-mmask-t='long'"
PACKAGES_DYNAMIC = "^${PN}-lib.*"
# Fall back to the host termcap / terminfo for -nativesdk and -native
# The reality is a work around for strange problems with things like
# "bitbake -c menuconfig busybox" where it cannot find the terminfo
# because the sstate had a hard coded search path. Until this is fixed
# another way this is deemed good enough.
EX_TERMCAP = ""
EX_TERMCAP:class-native = ":/etc/termcap:/usr/share/misc/termcap"
EX_TERMCAP:class-nativesdk = ":/etc/termcap:/usr/share/misc/termcap"
EX_TERMINFO = ""
EX_TERMINFO:class-native = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo"
EX_TERMINFO:class-nativesdk = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo"
EX_TERMLIB ?= "tinfo"
# Helper function for do_configure to allow multiple configurations
# $1 the directory to run configure in
# $@ the arguments to pass to configure
ncurses_configure() {
mkdir -p $1
cd $1
shift
oe_runconf \
--without-debug \
--without-ada \
--without-gpm \
--enable-hard-tabs \
--enable-xmc-glitch \
--enable-colorfgbg \
--with-termpath='${sysconfdir}/termcap:${datadir}/misc/termcap${EX_TERMCAP}' \
--with-terminfo-dirs='${sysconfdir}/terminfo:${datadir}/terminfo${EX_TERMINFO}' \
--with-shared \
--disable-big-core \
--program-prefix= \
--with-ticlib \
--with-termlib=${EX_TERMLIB} \
--enable-sigwinch \
--enable-pc-files \
--disable-rpath-hack \
${EXCONFIG_ARGS} \
--with-manpage-format=normal \
--without-manpage-renames \
--disable-stripping \
"$@" || return 1
cd ..
}
# Override the function from the autotools class; ncurses requires a
# patched autoconf213 to generate the configure script. This autoconf
# is not available so that the shipped script will be used.
do_configure() {
#Remove ${includedir} from CPPFLAGS, need for cross compile
sed -i 's#-I${cf_includedir}##g' ${S}/configure || die "sed CPPFLAGS"
# The --enable-pc-files requires PKG_CONFIG_LIBDIR existed
mkdir -p ${PKG_CONFIG_LIBDIR}
( cd ${S}; gnu-configize --force )
ncurses_configure "narrowc" || \
return 1
! ${ENABLE_WIDEC} || \
ncurses_configure "widec" "--enable-widec" "--without-progs"
}
do_compile() {
oe_runmake -C narrowc libs
oe_runmake -C narrowc/progs
! ${ENABLE_WIDEC} || \
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[depends] = "unifdef-native:do_populate_sysroot"
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
}
# Split original _install_opts to two parts.
# One is the options to install contents, the other is the parameters \
# when running command "make install"
# Note that install.libs will also implicitly install header files,
# so we do not need to explicitly specify install.includes.
# Doing so could in fact result in a race condition, as both targets
# (install.libs and install.includes) would install the same headers
# at the same time
_install_opts = " install.libs install.man "
_install_cfgs = "\
DESTDIR='${D}' \
PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' \
"
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_cfgs} ${_install_opts} \
install.progs
# The install.data should run after install.libs, otherwise
# there would be a race issue in a very critical conditon, since
# tic will be run by install.data, and tic needs libtinfo.so
# which would be regenerated by install.libs.
oe_runmake -C narrowc ${_install_cfgs} \
install.data
! ${ENABLE_WIDEC} || \
oe_runmake -C widec ${_install_cfgs} ${_install_opts}
cd narrowc
# include some basic terminfo files
# stolen ;) from gentoo and modified a bit
for x in ansi console dumb linux rxvt screen screen-256color sun vt52 vt100 vt102 vt200 vt220 xterm-color xterm-xfree86 xterm-256color
do
local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)"
local basedir="$(basename $(dirname "${termfile}"))"
if [ -n "${termfile}" ]
then
install -d ${D}${sysconfdir}/terminfo/${basedir}
mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/
ln -s /etc/terminfo/${basedir}/${x} \
${D}${datadir}/terminfo/${basedir}/${x}
fi
done
# i think we can use xterm-color as default xterm
if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ]
then
ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm
fi
# When changing ${libdir} to e.g. /usr/lib/myawesomelib/ ncurses
# still installs '/usr/lib/terminfo', so try to rm both
# the proper path and a slightly hardcoded one
rm -f ${D}${libdir}/terminfo ${D}${prefix}/lib/terminfo
# create linker scripts for libcurses.so and libncurses to
# link against -ltinfo when needed. Some builds might break
# else when '-Wl,--no-copy-dt-needed-entries' has been set in
# linker flags.
for i in libncurses libncursesw; do
f=${D}${libdir}/$i.so
test -h $f || continue
rm -f $f
echo '/* GNU ld script */' >$f
echo "INPUT($i.so.5 AS_NEEDED(-ltinfo))" >>$f
done
# Make sure that libcurses is linked so that it gets -ltinfo
# also, this should be addressed upstream really.
ln -sf libncurses.so ${D}${libdir}/libcurses.so
# create libtermcap.so linker script for backward compatibility
f=${D}${libdir}/libtermcap.so
echo '/* GNU ld script */' >$f
echo 'INPUT(AS_NEEDED(-ltinfo))' >>$f
if [ ! -d "${D}${base_libdir}" ]; then
# Setting base_libdir to libdir as is done in the -native
# case will skip this code
mkdir -p ${D}${base_libdir}
mv ${D}${libdir}/libncurses.so.* ${D}${base_libdir}
! ${ENABLE_WIDEC} || \
mv ${D}${libdir}/libncursesw.so.* ${D}${base_libdir}
mv ${D}${libdir}/libtinfo.so.* ${D}${base_libdir}
rm ${D}${libdir}/libtinfo.so
# Use ln -rs to ensure this is a relative link despite absolute paths
# (as we can't know the relationship between base_libdir and libdir).
ln -rs ${D}${base_libdir}/libtinfo.so.5 ${D}${libdir}/libtinfo.so
fi
if [ -d "${D}${includedir}/ncurses" ]; then
for f in `find ${D}${includedir}/ncurses -name "*.h"`
do
f=`basename $f`
test -e ${D}${includedir}/$f && continue
ln -sf ncurses/$f ${D}${includedir}/$f
done
fi
oe_multilib_header curses.h
}
python populate_packages:prepend () {
libdir = d.expand("${libdir}")
base_libdir = d.expand("${base_libdir}")
pnbase = d.expand("${PN}-lib%s")
do_split_packages(d, libdir, r'^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
if libdir is not base_libdir:
do_split_packages(d, base_libdir, r'^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
}
inherit update-alternatives
ALTERNATIVE_PRIORITY = "100"
ALTERNATIVE:ncurses-tools:class-target = "clear reset"
ALTERNATIVE:ncurses-terminfo:class-target = "st st-256color"
ALTERNATIVE_LINK_NAME[st] = "${datadir}/terminfo/s/st"
ALTERNATIVE_LINK_NAME[st-256color] = "${datadir}/terminfo/s/st-256color"
BBCLASSEXTEND = "native nativesdk"
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}/clear${@['', '.${BPN}']['${CLASSOVERRIDE}' == 'class-target']} \
${bindir}/reset${@['', '.${BPN}']['${CLASSOVERRIDE}' == 'class-target']} \
${bindir}/tack \
${bindir}/tabs \
"
# 'reset' is a symlink to 'tset' which is in the 'ncurses' package
RDEPENDS:${PN}-tools = "${PN} ${PN}-terminfo-base"
FILES:${PN}-terminfo = "\
${datadir}/terminfo \
"
FILES:${PN}-terminfo-base = "\
${sysconfdir}/terminfo \
"
RSUGGESTS:${PN}-libtinfo = "${PN}-terminfo"
RRECOMMENDS:${PN}-libtinfo = "${PN}-terminfo-base"
# 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}"
@@ -0,0 +1,15 @@
require ncurses.inc
SRC_URI += "file://0001-tic-hang.patch \
file://0002-configure-reproducible.patch \
file://0003-gen-pkgconfig.in-Do-not-include-LDFLAGS-in-generated.patch \
file://exit_prototype.patch \
"
# commit id corresponds to the revision in package version
SRCREV = "79b9071f2be20a24c7be031655a5638f6032f29f"
S = "${WORKDIR}/git"
EXTRA_OECONF += "--with-abi-version=5"
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)$"
# This is needed when using patchlevel versions like 6.1+20181013
#CVE_VERSION = "${@d.getVar("PV").split('+')[0]}.${@d.getVar("PV").split('+')[1]}"
@@ -0,0 +1,5 @@
curses.h
ncurses/curses.h
ncurses.h
ncurses/termcap.h