From 64ebfde150233797678cbd7f77e51e314ca21fe7 Mon Sep 17 00:00:00 2001 From: Brett Jia Date: Mon, 23 Dec 2024 18:33:17 -0500 Subject: [PATCH] Add terminfo fallbacks + enable wide-character support in ncurses (#117) * add terminfo fallbacks * disable macos/freebsd/solaris terminfo + update cosmo/linux builds * libgpm? * Revert "libgpm?" This reverts commit 7f594f5565c5d02e4f8b4a3f4c4ebae4eb76894e. * drop WITH_STATIC_DEPENDENCIES * Update build_cosmo.sh * Revert "Update build_cosmo.sh" This reverts commit 3886abc157a3106c2d98ee104e259ebe04dd7a01. * Revert "drop WITH_STATIC_DEPENDENCIES" This reverts commit 5ea2c27012f5acf70c7a7272b77ee8a9f72f22af. * bring back macos terminfo * use tic from homebrew * use widec on macos * libpanelw * use widec for cosmo * try older c standard * libtinfow * widec * enable widec, terminfo on freebsd/solaris * update handling of tinfo * use gtic * use ginfocmp --- .github/workflows/build_python.yml | 4 +++- scripts/build_cosmo.sh | 7 ++++--- scripts/build_freebsd.sh | 6 +++--- scripts/build_linux_zig.sh | 6 +++--- scripts/build_macos.sh | 6 +++--- scripts/build_solaris.sh | 6 +++--- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_python.yml b/.github/workflows/build_python.yml index d776e69a..3a64e81c 100644 --- a/.github/workflows/build_python.yml +++ b/.github/workflows/build_python.yml @@ -257,9 +257,11 @@ jobs: - name: Install tools run: | - brew install coreutils gpatch autoconf automake libtool + brew install coreutils gpatch autoconf automake libtool ncurses # use gpatch's "patch" executable echo "/usr/local/opt/gpatch/libexec/gnubin" >> $GITHUB_PATH + # use ncurses's "tic" executable + echo "/usr/local/opt/ncurses/bin/" >> $GITHUB_PATH - name: Build run: | diff --git a/scripts/build_cosmo.sh b/scripts/build_cosmo.sh index 736b9695..c0be5b86 100755 --- a/scripts/build_cosmo.sh +++ b/scripts/build_cosmo.sh @@ -102,7 +102,7 @@ cd ${BUILDDIR} download_verify_extract ncurses-6.4.tar.gz cd ncurses* -./configure --with-normal --without-progs --enable-overwrite --disable-stripping --prefix=${DEPSDIR} +CFLAGS="${CFLAGS} -std=c89" ./configure --with-normal --without-progs --enable-overwrite --disable-stripping --enable-widec --with-termlib --disable-database --with-fallbacks=xterm,xterm-256color,screen-256color,linux,vt100 --prefix=${DEPSDIR} make -j4 make install cp lib/.aarch64/lib*.a ${DEPSDIR}/lib/.aarch64 @@ -235,8 +235,9 @@ function build_python () { -DBZIP2_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libbz2.a \ -DREADLINE_INCLUDE_PATH:PATH=${DEPSDIR}/include \ -DREADLINE_LIBRARY:FILEPATH=${DEPSDIR}/lib/libreadline.a \ - -DCURSES_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libncurses.a \ - -DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanel.a \ + -DCURSES_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libncursesw.a \ + -DTINFO_LIBRARY:FILEPATH=${DEPSDIR}/lib/libtinfow.a \ + -DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanelw.a \ -DGDBM_INCLUDE_PATH:PATH=${DEPSDIR}/include \ -DGDBM_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm.a \ -DGDBM_COMPAT_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm_compat.a \ diff --git a/scripts/build_freebsd.sh b/scripts/build_freebsd.sh index ca52109d..41201261 100755 --- a/scripts/build_freebsd.sh +++ b/scripts/build_freebsd.sh @@ -92,7 +92,7 @@ cd ${BUILDDIR} download_verify_extract ncurses-6.4.tar.gz cd ncurses* -./configure --with-normal --without-shared --without-progs --enable-overwrite --disable-stripping --prefix=${DEPSDIR} +./configure --with-normal --without-shared --without-progs --enable-overwrite --disable-stripping --enable-widec --with-termlib --disable-database --with-fallbacks=xterm,xterm-256color,screen-256color,linux,vt100 --prefix=${DEPSDIR} gmake -j4 gmake install.libs install_license @@ -418,8 +418,8 @@ function build_python () { -DLibFFI_LIBRARY:FILEPATH=${DEPSDIR}/lib/libffi.a \ -DREADLINE_INCLUDE_PATH:PATH=${DEPSDIR}/include \ -DREADLINE_LIBRARY:FILEPATH=${DEPSDIR}/lib/libreadline.a \ - -DCURSES_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libncurses.a \ - -DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanel.a \ + -DCURSES_LIBRARIES="${DEPSDIR}/lib/libncursesw.a;${DEPSDIR}/lib/libtinfow.a" \ + -DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanelw.a \ -DGDBM_INCLUDE_PATH:PATH=${DEPSDIR}/include \ -DGDBM_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm.a \ -DGDBM_COMPAT_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm_compat.a \ diff --git a/scripts/build_linux_zig.sh b/scripts/build_linux_zig.sh index 427b41ca..5ad2dfcb 100755 --- a/scripts/build_linux_zig.sh +++ b/scripts/build_linux_zig.sh @@ -229,7 +229,7 @@ cd ${BUILDDIR} download_verify_extract ncurses-6.4.tar.gz cd ncurses* -./configure --host=${CHOST} --with-normal --without-progs --enable-overwrite --disable-stripping --prefix=${DEPSDIR} +./configure --host=${CHOST} --with-normal --without-progs --enable-overwrite --disable-stripping --enable-widec --with-termlib --disable-database --with-fallbacks=xterm,xterm-256color,screen-256color,linux,vt100 --prefix=${DEPSDIR} make -j4 make install install_license @@ -614,8 +614,8 @@ function build_python () { -DREADLINE_INCLUDE_PATH:PATH=${DEPSDIR}/include \ -DREADLINE_LIBRARY:FILEPATH=${DEPSDIR}/lib/libreadline.a \ -DUUID_LIBRARY:FILEPATH=${DEPSDIR}/lib/libuuid.a \ - -DCURSES_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libncurses.a \ - -DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanel.a \ + -DCURSES_LIBRARIES="${DEPSDIR}/lib/libncursesw.a;${DEPSDIR}/lib/libtinfow.a" \ + -DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanelw.a \ -DGDBM_INCLUDE_PATH:PATH=${DEPSDIR}/include \ -DGDBM_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm.a \ -DGDBM_COMPAT_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm_compat.a \ diff --git a/scripts/build_macos.sh b/scripts/build_macos.sh index 03b0db82..3ff62365 100755 --- a/scripts/build_macos.sh +++ b/scripts/build_macos.sh @@ -32,7 +32,7 @@ cd ${BUILDDIR} download_verify_extract ncurses-6.4.tar.gz cd ncurses* -CC=clang CXX=clang++ CFLAGS="${CFLAGS} -arch x86_64 -arch arm64" CXXFLAGS="${CXXFLAGS} -arch x86_64 -arch arm64" ./configure --with-normal --without-progs --enable-overwrite --disable-stripping --prefix=${DEPSDIR} +CC=clang CXX=clang++ CFLAGS="${CFLAGS} -arch x86_64 -arch arm64" CXXFLAGS="${CXXFLAGS} -arch x86_64 -arch arm64" ./configure --with-normal --without-progs --enable-overwrite --disable-stripping --enable-widec --with-termlib --disable-database --with-fallbacks=xterm,xterm-256color,screen-256color,linux,vt100 --prefix=${DEPSDIR} make -j4 make install.libs install_license @@ -329,8 +329,8 @@ function build_python () { -DREADLINE_INCLUDE_PATH:PATH=${DEPSDIR}/include \ -DREADLINE_LIBRARY:FILEPATH=${DEPSDIR}/lib/libreadline.a \ -DUUID_LIBRARY:FILEPATH=${DEPSDIR}/lib/libuuid.a \ - -DCURSES_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libncurses.a \ - -DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanel.a \ + -DCURSES_LIBRARIES="${DEPSDIR}/lib/libncursesw.a;${DEPSDIR}/lib/libtinfow.a" \ + -DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanelw.a \ -DGDBM_INCLUDE_PATH:PATH=${DEPSDIR}/include \ -DGDBM_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm.a \ -DGDBM_COMPAT_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm_compat.a \ diff --git a/scripts/build_solaris.sh b/scripts/build_solaris.sh index 21305f91..b7e2c60f 100755 --- a/scripts/build_solaris.sh +++ b/scripts/build_solaris.sh @@ -115,7 +115,7 @@ cd ${BUILDDIR} download_verify_extract ncurses-6.4.tar.gz cd ncurses* -./configure --with-normal --without-shared --without-progs --enable-overwrite --disable-stripping --prefix=${DEPSDIR} +./configure --with-normal --without-shared --without-progs --enable-overwrite --disable-stripping --enable-widec --with-termlib --disable-database --with-fallbacks=xterm,xterm-256color,screen-256color,linux,vt100 --with-tic-path=/usr/bin/gtic --with-infocmp-path=/usr/bin/ginfocmp --prefix=${DEPSDIR} gmake -j4 gmake install.libs install_license @@ -452,8 +452,8 @@ function build_python () { -DLibFFI_LIBRARY:FILEPATH=${DEPSDIR}/lib/libffi.a \ -DREADLINE_INCLUDE_PATH:PATH=${DEPSDIR}/include \ -DREADLINE_LIBRARY:FILEPATH=${DEPSDIR}/lib/libreadline.a \ - -DCURSES_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libncurses.a \ - -DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanel.a \ + -DCURSES_LIBRARIES="${DEPSDIR}/lib/libncursesw.a;${DEPSDIR}/lib/libtinfow.a" \ + -DPANEL_LIBRARIES:FILEPATH=${DEPSDIR}/lib/libpanelw.a \ -DGDBM_INCLUDE_PATH:PATH=${DEPSDIR}/include \ -DGDBM_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm.a \ -DGDBM_COMPAT_LIBRARY:FILEPATH=${DEPSDIR}/lib/libgdbm_compat.a \