# Maintainer: Natanael Copa pkgname=ncurses pkgver=6.4_p20230722 _pkgver=${pkgver/_p/-} pkgrel=0 pkgdesc="Console display library" url="https://invisible-island.net/ncurses/" arch="all" options="!check" # "tests" are actual demo programs, not a test suite. license="X11" makedepends_build="ncurses" subpackages=" $pkgname-static $pkgname-dev $pkgname-doc $pkgname-terminfo-base:base:noarch $pkgname-terminfo:terminfo:noarch $pkgname-libs:compat:noarch libformw libmenuw libncurses++:pp libncursesw libpanelw " _kitty_ver=0.29.0 # see comment in package() source="https://invisible-mirror.net/archives/ncurses/current/ncurses-$_pkgver.tgz xterm-kitty-$_kitty_ver::https://github.com/kovidgoyal/kitty/raw/v$_kitty_ver/terminfo/x/xterm-kitty cleanup-pkgconfig-ldflags.patch " builddir="$srcdir/$pkgname-$_pkgver" # secfixes: # 6.4_p20230424-r0: # - CVE-2023-29491 # 6.3_p20220416-r0: # - CVE-2022-29458 # 6.2_p20200530-r0: # - CVE-2021-39537 # 6.1_p20180414-r0: # - CVE-2018-10754 # 6.0_p20171125-r0: # - CVE-2017-16879 # 6.0_p20170701-r0: # - CVE-2017-10684 # Terminfo definitions to be included in ncurses-terminfo-base. _basic_terms=" alacritty ansi console dumb gnome gnome-256color konsole konsole-256color konsole-linux linux putty putty-256color rxvt rxvt-256color screen screen-256color st-* sun terminator terminology* tmux tmux-256color vt100 vt102 vt200 vt220 vt52 vte vte-256color xterm xterm-256color xterm-color xterm-kitty xterm-xfree86 " build() { export CFLAGS="$CFLAGS -D_GNU_SOURCE" ./configure \ --build=$CBUILD \ --host=$CHOST \ --mandir=/usr/share/man \ --without-ada \ --without-tests \ --disable-termcap \ --disable-root-access \ --disable-rpath-hack \ --disable-setuid-environ \ --disable-stripping \ --with-pkg-config-libdir=/usr/lib/pkgconfig \ --with-cxx-binding \ --with-cxx-shared \ --with-terminfo-dirs="/etc/terminfo:/usr/share/terminfo:/lib/terminfo:/usr/lib/terminfo" \ --enable-pc-files \ --with-shared \ --enable-widec make } package() { make -j1 DESTDIR="$pkgdir" install cd "$pkgdir" # kitty terminfo in ncurses database is outdated and upstream doesn't # cooperate, so Kitty now uses xterm-kitty instead. # https://github.com/kovidgoyal/kitty/issues/879 install -m644 "$srcdir"/xterm-kitty-$_kitty_ver usr/share/terminfo/x/xterm-kitty # force link against *w.so local lib; for lib in ncurses ncurses++ form panel menu; do ln -s ${lib}w.pc usr/lib/pkgconfig/$lib.pc ln -s lib${lib}w.a usr/lib/lib$lib.a echo "INPUT(-l${lib}w)" > usr/lib/lib$lib.so done # link curses -> ncurses ln -s libncurses.a usr/lib/libcurses.a ln -s libncurses.so usr/lib/libcurses.so echo 'INPUT(-lncursesw)' > usr/lib/libcursesw.so # Install basic terms in /etc/terminfo local i; for i in $_basic_terms; do local termfiles=$(find usr/share/terminfo/ -name "$i" 2>/dev/null) || true [ -z "$termfiles" ] && continue for termfile in $termfiles; do local basedir=$(basename "$(dirname "$termfile")") install -d etc/terminfo/$basedir mv "$termfile" etc/terminfo/$basedir/ ln -s "../../../../etc/terminfo/$basedir/${termfile##*/}" \ "usr/share/terminfo/$basedir/${termfile##*/}" done done } dev() { default_dev # also move symlinks amove usr/lib/*.so } terminfo() { pkgdesc="$pkgdesc (other terminfo files)" depends="$pkgname-terminfo-base=$pkgver-r$pkgrel" replaces="kitty<0.25.2-r1" # /usr/share/terminfo/x/xterm-kitty (Alpine <3.17) amove usr/share/terminfo # also move symlink amove usr/lib/terminfo } compat() { pkgdesc="Ncurses libraries (old compat to pull sublibs)" provides="ncurses-widec-libs=$pkgver-r$pkgrel" depends=" libformw=$pkgver-r$pkgrel libmenuw=$pkgver-r$pkgrel libncursesw=$pkgver-r$pkgrel libpanelw=$pkgver-r$pkgrel " mkdir -p "$subpkgdir" } libmenuw() { pkgdesc="$pkgdesc ($subpkgname)" depends="$pkgname-terminfo-base=$pkgver-r$pkgrel" amove usr/lib/libmenuw.so.* } libformw() { pkgdesc="$pkgdesc ($subpkgname)" depends="$pkgname-terminfo-base=$pkgver-r$pkgrel" amove usr/lib/libformw.so.* } pp() { pkgdesc="$pkgdesc ($subpkgname)" depends="$pkgname-terminfo-base=$pkgver-r$pkgrel" amove usr/lib/libncurses++w.so.* } libncursesw() { pkgdesc="$pkgdesc ($subpkgname)" depends="$pkgname-terminfo-base=$pkgver-r$pkgrel" amove usr/lib/libncursesw.so.* } libpanelw() { pkgdesc="$pkgdesc ($subpkgname)" depends="$pkgname-terminfo-base=$pkgver-r$pkgrel" amove usr/lib/libpanelw.so.* } base() { pkgdesc="Descriptions of common terminals" depends="" amove etc/terminfo } sha512sums=" 262e1efbb5fbfe44f8efe2737c08cdf304f39671bab03cdc1c61ddf2ff7025e3f335d7b06ff812344b9d305c6c7baac7d624a691011caea6ab39932f417ec58e ncurses-6.4-20230722.tgz 783820287e2f04f235bfd9ca6198be28b16819d2eb6d3d85755789ec9e09be6e347ac40f2adc22a359e98526946eb5318481e7c3e30839c717f4c667ae2d7359 xterm-kitty-0.29.0 201ef1876655101cedabc83a0ce46f75079b08f565ca8de4cf96fd69e41332a2d0597b77fe360dc58b10772586fa39bd52ac9ee670a912fef84840278356065a cleanup-pkgconfig-ldflags.patch "