From a129ebfb0dea5683eabff90e1bf420b98087289e Mon Sep 17 00:00:00 2001 From: Jose Blanquicet Date: Wed, 17 Mar 2021 17:19:35 +0100 Subject: [PATCH 1/3] sys-libs/ncurses: Sync with Gentoo's upstream This commit synchronises ncurses with gentoo/gentoo@69bf5af thus it updates the package from 6.1-r2 to 6.2-r1. Check issue kinvolk/Flatcar#364 for further details. Signed-off-by: Jose Blanquicet --- .../coreos-overlay/sys-libs/ncurses/Manifest | 2 +- .../ncurses/files/ncurses-6.0-gfbsd.patch | 24 ---- .../ncurses-6.1-st07_terminfo_typo.patch | 14 -- .../ncurses-6.2-no_user_ldflags_in_libs.patch | 40 ++++++ .../sys-libs/ncurses/metadata.xml | 3 + ...es-6.1-r2.ebuild => ncurses-6.2-r1.ebuild} | 124 ++++++++++-------- 6 files changed, 114 insertions(+), 93 deletions(-) delete mode 100644 sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/files/ncurses-6.0-gfbsd.patch delete mode 100644 sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/files/ncurses-6.1-st07_terminfo_typo.patch create mode 100644 sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/files/ncurses-6.2-no_user_ldflags_in_libs.patch rename sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/{ncurses-6.1-r2.ebuild => ncurses-6.2-r1.ebuild} (70%) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/Manifest b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/Manifest index ec49f33417..61cb703f5f 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/Manifest +++ b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/Manifest @@ -1 +1 @@ -DIST ncurses-6.1.tar.gz 3365395 SHA256 aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17 SHA512 e308af43f8b7e01e98a55f4f6c4ee4d1c39ce09d95399fa555b3f0cdf5fd0db0f4c4d820b4af78a63f6cf6d8627587114a40af48cfc066134b600520808a77ee WHIRLPOOL ae1af38f8085fd9c80d1695243e2f8f21771db07d3ffe8ecf8c45945481fbac6d597459a86eaeee7d413154d05c2be8baa95077856124fd3584d30f78f26aab3 +DIST ncurses-6.2.tar.gz 3425862 BLAKE2B 6680cd7a369a4cb8234442a70869c283f0db6db9d7da1da2a7a5c519eb862a2c9b9411957d99f9ebb5089cad00b42e1ca6bc0784327461113df2eeaec695913c SHA512 4c1333dcc30e858e8a9525d4b9aefb60000cfc727bc4a1062bace06ffc4639ad9f6e54f6bdda0e3a0e5ea14de995f96b52b3327d9ec633608792c99a1e8d840d diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/files/ncurses-6.0-gfbsd.patch b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/files/ncurses-6.0-gfbsd.patch deleted file mode 100644 index 1403a29c93..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/files/ncurses-6.0-gfbsd.patch +++ /dev/null @@ -1,24 +0,0 @@ -we'll hijack the freebsd* case that comes later - ---- ncurses-6.0/aclocal.m4 -+++ ncurses-6.0/aclocal.m4 -@@ -5711,7 +5711,7 @@ - fi - cf_cv_rm_so_locs=yes - ;; -- (linux*|gnu*|k*bsd*-gnu) -+ (linux*|gnu*|k*bsd*-gnu|freebsd*|dragonfly*) - if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" ---- ncurses-6.0/configure -+++ ncurses-6.0/configure -@@ -6188,7 +6188,7 @@ - fi - cf_cv_rm_so_locs=yes - ;; -- (linux*|gnu*|k*bsd*-gnu) -+ (linux*|gnu*|k*bsd*-gnu|freebsd*|dragonfly*) - if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/files/ncurses-6.1-st07_terminfo_typo.patch b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/files/ncurses-6.1-st07_terminfo_typo.patch deleted file mode 100644 index 4532d648a6..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/files/ncurses-6.1-st07_terminfo_typo.patch +++ /dev/null @@ -1,14 +0,0 @@ -https://github.com/tmux/tmux/issues/1264 -https://bugs.gentoo.org/651494 - ---- ncurses-6.1/misc/terminfo.src -+++ ncurses-6.1/misc/terminfo.src -@@ -6260,7 +6260,7 @@ - %=%t3%e%p1%d%;m, - sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%| - %t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m, -- Ss=\E]52;%p1%s;%p2%s\007, kDN3=\E[1;3B, kDN5=\E[1;5B, -+ Ms=\E]52;%p1%s;%p2%s\007, kDN3=\E[1;3B, kDN5=\E[1;5B, - kLFT3=\E[1;3D, kLFT5=\E[1;5D, kNXT3=\E[6;3~, - kNXT5=\E[6;5~, kPRV3=\E[5;3~, kPRV5=\E[5;5~, - kRIT3=\E[1;3C, kRIT5=\E[1;5C, kUP3=\E[1;3A, kUP5=\E[1;5A, diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/files/ncurses-6.2-no_user_ldflags_in_libs.patch b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/files/ncurses-6.2-no_user_ldflags_in_libs.patch new file mode 100644 index 0000000000..66345b51fe --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/files/ncurses-6.2-no_user_ldflags_in_libs.patch @@ -0,0 +1,40 @@ +From be554be06475b36da2f69aabfd873ad55f7ef95c Mon Sep 17 00:00:00 2001 +From: Lars Wendler +Date: Thu, 13 Feb 2020 11:51:09 +0100 +Subject: [PATCH] Don't bleed user LDFLAGS into Libs + +Signed-off-by: Lars Wendler +--- + misc/gen-pkgconfig.in | 2 +- + misc/ncurses-config.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/misc/gen-pkgconfig.in b/misc/gen-pkgconfig.in +index 8f00b824..009d2156 100644 +--- a/misc/gen-pkgconfig.in ++++ b/misc/gen-pkgconfig.in +@@ -80,7 +80,7 @@ if [ "$includedir" != "/usr/include" ]; then + fi + + lib_flags= +-for opt in -L$libdir @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ ++for opt in -L$libdir @LIBS@ + do + case $opt in + -l*) # LIBS is handled specially below +diff --git a/misc/ncurses-config.in b/misc/ncurses-config.in +index 7f8ba697..2f1915cd 100644 +--- a/misc/ncurses-config.in ++++ b/misc/ncurses-config.in +@@ -101,7 +101,7 @@ fi + # There is no portable way to find the list of standard library directories. + # Require a POSIX shell anyway, to keep this simple. + lib_flags= +-for opt in -L$libdir @LDFLAGS@ @EXTRA_LDFLAGS@ $LIBS ++for opt in -L$libdir $LIBS + do + case $opt in + -specs*) # ignore linker specs-files which were used to build library +-- +2.25.0 + diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/metadata.xml b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/metadata.xml index 888a6adf66..1030e9cebb 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/metadata.xml +++ b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/metadata.xml @@ -14,4 +14,7 @@ Enable test trace() support in ncurses calls + + cpe:/a:gnu:ncurses + diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.1-r2.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.2-r1.ebuild similarity index 70% rename from sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.1-r2.ebuild rename to sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.2-r1.ebuild index b2b90f6152..3876d51a41 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.1-r2.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.2-r1.ebuild @@ -1,22 +1,27 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=6 +EAPI=7 -inherit flag-o-matic toolchain-funcs multilib-minimal +inherit flag-o-matic toolchain-funcs multilib-minimal preserve-libs usr-ldscript -MY_PV=${PV:0:3} -PV_SNAP=${PV:4} -MY_P=${PN}-${MY_PV} +MY_PV="${PV:0:3}" +MY_P="${PN}-${MY_PV}" DESCRIPTION="console display library" -HOMEPAGE="https://www.gnu.org/software/ncurses/ http://dickey.his.com/ncurses/" +HOMEPAGE="https://www.gnu.org/software/ncurses/ https://invisible-island.net/ncurses/" SRC_URI="mirror://gnu/ncurses/${MY_P}.tar.gz" +if [[ "${PV}" == *_p* ]] ; then + SRC_URI+=" ftp://ftp.invisible-island.net/${PN}/${PV/_p*}/${P/_p/-}-patch.sh.bz2 + https://invisible-mirror.net/archives/${PN}/${PV/_p*}/${P/_p/-}-patch.sh.bz2" +fi + LICENSE="MIT" # The subslot reflects the SONAME. SLOT="0/6" -KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd" -IUSE="ada +cxx debug doc gpm minimal profile static-libs symlink-usr test threads tinfo trace unicode" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="ada +cxx debug doc gpm minimal profile static-libs test threads tinfo trace unicode" +RESTRICT="!test? ( test )" DEPEND="gpm? ( sys-libs/gpm[${MULTILIB_USEDEP}] )" # berkdb? ( sys-libs/db )" @@ -25,30 +30,24 @@ RDEPEND="${DEPEND} !<=sys-libs/ncurses-5.9-r4:5 !& /dev/null \ @@ -106,12 +105,10 @@ multilib_src_configure() { } do_configure() { - addwrite /dev/ptmx - local target=$1 shift - mkdir "${BUILD_DIR}/${target}" + mkdir "${BUILD_DIR}/${target}" || die cd "${BUILD_DIR}/${target}" || die local conf=( @@ -197,9 +194,18 @@ do_configure() { src_compile() { # See comments in src_configure. - if ! ROOT=/ has_version "~sys-libs/${P}:0" ; then - BUILD_DIR="${WORKDIR}" \ - do_compile cross -C progs tic + if ! has_version -b "~sys-libs/${P}:0" ; then + # We could possibly merge these two branches but opting to be + # conservative when merging some of the Prefix changes. + + if [[ ${CHOST} == *-cygwin* ]] && ! multilib_is_native_abi ; then + # We make 'tic$(x)' here, for Cygwin having x=".exe". + BUILD_DIR="${WORKDIR}" \ + do_compile cross -C progs all PROGS='tic$(x)' + else + BUILD_DIR="${WORKDIR}" \ + do_compile cross -C progs tic + fi fi multilib-minimal_src_compile @@ -228,7 +234,7 @@ do_compile() { # compiled libraries which depends on sources which ... # Manually delete the pc-files file so the install step will # create the .pc files we want. - rm -f misc/pc-files + rm -f misc/pc-files || die emake "$@" } @@ -255,46 +261,56 @@ multilib_src_install() { fi # Build fails to create this ... - dosym ../share/terminfo /usr/$(get_libdir)/terminfo + # -FIXME- + # Ugly hackaround for riscv having two parts libdir (#689240) + # Replace this hack with an official solution once we have one... + # -FIXME- + dosym $(sed 's@[^/]\+@..@g' <<< $(get_libdir))/share/terminfo \ + /usr/$(get_libdir)/terminfo } multilib_src_install_all() { - if ! use symlink-usr ; then - # We need the basic terminfo files in /etc, bug #37026 +# if ! use berkdb ; then + # We need the basic terminfo files in /etc for embedded/recovery. #37026 einfo "Installing basic terminfo files in /etc..." + local terms=( + # Dumb/simple values that show up when using the in-kernel VT. + ansi console dumb linux + vt{52,100,102,200,220} + # [u]rxvt users used to be pretty common. Probably should drop this + # since upstream is dead and people are moving away from it. + rxvt{,-unicode}{,-256color} + # xterm users are common, as is terminals re-using/spoofing it. + xterm xterm-{,256}color + # screen is common (and reused by tmux). + screen{,-256color} + screen.xterm-256color + ) local x - for x in "${MINIMAL_TERMINFO[@]}" - do + for x in "${terms[@]}"; do local termfile=$(find "${ED}"/usr/share/terminfo/ -name "${x}" 2>/dev/null) - local basedir=$(basename $(dirname "${termfile}")) + local basedir=$(basename "$(dirname "${termfile}")") if [[ -n ${termfile} ]] ; then - dodir /etc/terminfo/${basedir} - mv ${termfile} "${ED}"/etc/terminfo/${basedir}/ - dosym ../../../../etc/terminfo/${basedir}/${x} \ - /usr/share/terminfo/${basedir}/${x} + dodir "/etc/terminfo/${basedir}" + mv "${termfile}" "${ED}/etc/terminfo/${basedir}/" || die + dosym "../../../../etc/terminfo/${basedir}/${x}" \ + "/usr/share/terminfo/${basedir}/${x}" fi done +# fi - echo "CONFIG_PROTECT_MASK=\"/etc/terminfo\"" > "${T}"/50ncurses - doenvd "${T}"/50ncurses + echo "CONFIG_PROTECT_MASK=\"/etc/terminfo\"" | newenvd - 50ncurses - use minimal && rm -r "${ED}"/usr/share/terminfo* - # Because ncurses5-config --terminfo returns the directory we keep it - keepdir /usr/share/terminfo #245374 - elif use minimal; then - # prune all files and symlinks not listed in MINIMAL_TERMINFO - find "${D}"/usr/share/terminfo ! -type d \ - ${MINIMAL_TERMINFO[@]/#/! -name } \ - -delete || die - find "${D}"/usr/share/terminfo -type d -empty -delete || die - fi + use minimal && rm -r "${ED}"/usr/share/terminfo* + # Because ncurses5-config --terminfo returns the directory we keep it + keepdir /usr/share/terminfo #245374 - cd "${S}" + cd "${S}" || die dodoc ANNOUNCE MANIFEST NEWS README* TO-DO doc/*.doc if use doc ; then docinto html - dohtml -r doc/html/ + dodoc -r doc/html/ fi } From 7c7eed243fb142f7d32246abd1377557537fe2e0 Mon Sep 17 00:00:00 2001 From: David Michael Date: Fri, 20 Apr 2018 13:26:06 -0400 Subject: [PATCH 2/3] sys-libs/ncurses: Apply Flatcar patches Cherry-picked from kinvolk/coreos-overlay@d0426cf. Add a symlink-usr USE flag for keeping a minimal set of terminfo files in /usr/share/terminfo. Also allow writes to /dev/ptmx, which sometimes causes the sandbox to fail Jenkins builds. Check issue kinvolk/Flatcar#364 for further details. Signed-off-by: Jose Blanquicet --- .../sys-libs/ncurses/ncurses-6.2-r1.ebuild | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.2-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.2-r1.ebuild index 3876d51a41..402a49762e 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.2-r1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.2-r1.ebuild @@ -20,7 +20,7 @@ LICENSE="MIT" # The subslot reflects the SONAME. SLOT="0/6" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="ada +cxx debug doc gpm minimal profile static-libs test threads tinfo trace unicode" +IUSE="ada +cxx debug doc gpm minimal profile static-libs symlink-usr test threads tinfo trace unicode" RESTRICT="!test? ( test )" DEPEND="gpm? ( sys-libs/gpm[${MULTILIB_USEDEP}] )" @@ -34,6 +34,12 @@ RDEPEND="${DEPEND} S="${WORKDIR}/${MY_P}" +MINIMAL_TERMINFO=( + ansi console dumb linux rxvt rxvt-256color rxvt-unicode rxvt-unicode-256color + screen screen-16color screen-256color sun vt{52,100,102,200,220} + xterm xterm-color xterm-256color xterm-xfree86 +) + PATCHES=( "${FILESDIR}/${PN}-5.7-nongnu.patch" "${FILESDIR}/${PN}-6.0-rxvt-unicode-9.15.patch" #192083 #383871 @@ -105,6 +111,8 @@ multilib_src_configure() { } do_configure() { + addwrite /dev/ptmx + local target=$1 shift @@ -270,24 +278,11 @@ multilib_src_install() { } multilib_src_install_all() { -# if ! use berkdb ; then + if ! use symlink-usr ; then # We need the basic terminfo files in /etc for embedded/recovery. #37026 einfo "Installing basic terminfo files in /etc..." - local terms=( - # Dumb/simple values that show up when using the in-kernel VT. - ansi console dumb linux - vt{52,100,102,200,220} - # [u]rxvt users used to be pretty common. Probably should drop this - # since upstream is dead and people are moving away from it. - rxvt{,-unicode}{,-256color} - # xterm users are common, as is terminals re-using/spoofing it. - xterm xterm-{,256}color - # screen is common (and reused by tmux). - screen{,-256color} - screen.xterm-256color - ) local x - for x in "${terms[@]}"; do + for x in "${MINIMAL_TERMINFO[@]}"; do local termfile=$(find "${ED}"/usr/share/terminfo/ -name "${x}" 2>/dev/null) local basedir=$(basename "$(dirname "${termfile}")") @@ -298,13 +293,19 @@ multilib_src_install_all() { "/usr/share/terminfo/${basedir}/${x}" fi done -# fi - echo "CONFIG_PROTECT_MASK=\"/etc/terminfo\"" | newenvd - 50ncurses + echo "CONFIG_PROTECT_MASK=\"/etc/terminfo\"" | newenvd - 50ncurses - use minimal && rm -r "${ED}"/usr/share/terminfo* - # Because ncurses5-config --terminfo returns the directory we keep it - keepdir /usr/share/terminfo #245374 + use minimal && rm -r "${ED}"/usr/share/terminfo* + # Because ncurses5-config --terminfo returns the directory we keep it + keepdir /usr/share/terminfo #245374 + elif use minimal; then + # prune all files and symlinks not listed in MINIMAL_TERMINFO + find "${D}"/usr/share/terminfo ! -type d \ + ${MINIMAL_TERMINFO[@]/#/! -name } \ + -delete || die + find "${D}"/usr/share/terminfo -type d -empty -delete || die + fi cd "${S}" || die dodoc ANNOUNCE MANIFEST NEWS README* TO-DO doc/*.doc From 91c9486ad579027137f98791c369c2dbb5222443 Mon Sep 17 00:00:00 2001 From: Jose Blanquicet Date: Fri, 19 Mar 2021 16:00:55 +0100 Subject: [PATCH 3/3] sys-libs/ncurses: Apply Flatcar patches This commit adds some comments to help other folks to easily recognize Flatcar-specific code. Check issue #364 for further details. Signed-off-by: Jose Blanquicet --- .../coreos-overlay/sys-libs/ncurses/ncurses-6.2-r1.ebuild | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.2-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.2-r1.ebuild index 402a49762e..5ad1d57a45 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.2-r1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-libs/ncurses/ncurses-6.2-r1.ebuild @@ -111,6 +111,8 @@ multilib_src_configure() { } do_configure() { + # Flatcar: Also allow writes to /dev/ptmx, which sometimes + # causes the sandbox to fail Jenkins builds. addwrite /dev/ptmx local target=$1 @@ -278,6 +280,8 @@ multilib_src_install() { } multilib_src_install_all() { + # Flatcar: Add a symlink-usr USE flag for keeping a minimal + # set of terminfo files in /usr/share/terminfo. if ! use symlink-usr ; then # We need the basic terminfo files in /etc for embedded/recovery. #37026 einfo "Installing basic terminfo files in /etc..."