# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/ncurses/hotfix-run_tic-cross.patch # Copyright (C) 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- --- ncurses-6.6/misc/run_tic.in 2025-09-13 18:52:46.000000000 +0200 +++ ncurses-6.5/misc/run_tic.in 2022-07-16 21:37:03.000000000 +0200 @@ -1,7 +1,7 @@ #!@SHELL@ -# $Id: run_tic.in,v 1.44 2025/09/13 16:52:46 tom Exp $ +# $Id: run_tic.in,v 1.40 2022/07/16 19:37:03 tom Exp $ ############################################################################## -# Copyright 2019-2024,2025 Thomas E. Dickey # +# Copyright 2019-2020,2022 Thomas E. Dickey # # Copyright 2000-2012,2017 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -42,59 +42,50 @@ # The script is designed to be run from the misc/Makefile as # make install.data -# Symbols which are not overridden by misc/Makefile: +: "${suffix:=@EXEEXT@}" +: "${DESTDIR:=@DESTDIR@}" : "${prefix:=@prefix@}" : "${exec_prefix:=@exec_prefix@}" +: "${bindir:=@bindir@}" : "${top_srcdir:=@top_srcdir@}" : "${srcdir:=@srcdir@}" : "${datarootdir:=@datarootdir@}" : "${datadir:=@datadir@}" -: "${cross_compiling:=@cross_compiling@}" -: "${suffix:=@EXEEXT@}" - -: "${ext_funcs:=@NCURSES_EXT_FUNCS@}" -: "${tic_path:=@TIC@}" +: "${TIC_PATH:=@TIC@}" : "${ticdir:=@TERMINFO@}" -: "${tic_source:=@TERMINFO_SRC@}" - -# Symbols which $DESTDIR and/or install-prefix may affect: -: "${INSTALL_PREFIX:=$prefix}" -: "${BINDIR:=@bindir@}" -: "${TICDIR:=$ticdir}" - -failed() { - echo "? $*" >&2 - exit 1 -} +: "${source:=@TERMINFO_SRC@}" +: "${cross_compiling:=no}" +: "${ext_funcs:=@NCURSES_EXT_FUNCS@}" -unset CDPATH +test -z "${DESTDIR}" && DESTDIR= # Allow tic to run either from the install-path, or from the build-directory. # Do not do this if we appear to be cross-compiling. In that case, we rely # on the host's copy of tic to compile the terminfo database. -if test "$cross_compiling" = "no" +if test "x$cross_compiling" = "xno" then - if test -f ../progs/tic"$suffix" + if test -f ../progs/tic$suffix then case "$PATH" in \@PATH_SEPARATOR@*) - PATH="../progs@PATH_SEPARATOR@../lib@PATH_SEPARATOR@${BINDIR}$PATH" + PATH="../progs@PATH_SEPARATOR@../lib@PATH_SEPARATOR@${DESTDIR}$bindir$PATH" ;; *) - PATH="../progs@PATH_SEPARATOR@../lib@PATH_SEPARATOR@${BINDIR}@PATH_SEPARATOR@$PATH" + PATH="../progs@PATH_SEPARATOR@../lib@PATH_SEPARATOR@${DESTDIR}$bindir@PATH_SEPARATOR@$PATH" ;; esac export PATH if test @DFT_LWR_MODEL@ = shared then SHLIB="sh $srcdir/shlib" - tic_path="$SHLIB tic" + TIC_PATH="$SHLIB tic" else - tic_path="tic" + TIC_PATH="tic" fi - elif test "$tic_path" = unknown + elif test "$TIC_PATH" = unknown then - failed "no tic program found" + echo "? no tic program found" + exit 1 fi else # Cross-compiling, so don't set PATH or run shlib. @@ -104,27 +95,26 @@ fi -# Set another env var that doesn't get reset when `shlib' runs, so `shlib' uses +# set another env var that doesn't get reset when `shlib' runs, so `shlib' uses # the PATH we just set. SHLIB_PATH=$PATH export SHLIB_PATH -# Set a variable to simplify environment update in the shlib script. +# set a variable to simplify environment update in shlib SHLIB_HOST=@host_os@ export SHLIB_HOST -# Don't use user's TERMINFO or TERMINFO_DIRS variables. The explicit "-o" -# option makes this moot, but this may reduce confusion. +# don't use user's TERMINFO variable unset TERMINFO_DIRS -unset TERMINFO +TERMINFO="${DESTDIR}$ticdir" ; export TERMINFO umask 022 # Construct the name of the old (obsolete) pathname, e.g., /usr/lib/terminfo. -OLD_DIR=`echo "$TICDIR" | sed -e 's%/share/\([^/]*\)$%/lib/\1%'` +TICDIR=`echo "$TERMINFO" | sed -e 's%/share/\([^/]*\)$%/lib/\1%'` # Parent directory may not exist, which would confuse the install for hashed # database. Fix. -PARENT=`echo "$TICDIR" | sed -e 's%/[^/]*$%%'` +PARENT=`echo "$TERMINFO" | sed -e 's%/[^/]*$%%'` if test -n "$PARENT" then mkdir -p "$PARENT" @@ -134,102 +124,87 @@ # would generate a lot of confusing error messages if we tried to overwrite it. # We explicitly remove its contents rather than the directory itself, in case # the directory is actually a symbolic link. -if test -d "$TICDIR" +if test -d "$TERMINFO" then - test -w "$TICDIR" || failed "existing $TICDIR is not writable" - ( cd "$TICDIR" && rm -fr ./? 2>/dev/null ) -elif test -f "$TICDIR.db" + ( cd "$TERMINFO" && rm -fr ./? 2>/dev/null ) +elif test -f "$TERMINFO.db" then - ( rm -f "$TICDIR.db" 2>/dev/null ) - test -f "$TICDIR.db" && failed "cannot remove $TICDIR.db" + ( rm -f "$TERMINFO.db" 2>/dev/null ) fi if test "$ext_funcs" = 1 ; then cat </dev/null ) - if ( cd "$OLD_DIR" 2>/dev/null ) +if test "$TICDIR" != "$TERMINFO" ; then + ( rm -f "$TICDIR" 2>/dev/null ) + if ( cd "$TICDIR" 2>/dev/null ) then - cd "$OLD_DIR" || exit - OLD_DIR=`pwd` - if test "$OLD_DIR " != "$TICDIR "; then + cd "$TICDIR" || exit + TICDIR=`pwd` + if test "$TICDIR " != "$TERMINFO "; then # Well, we tried. Some systems lie to us, so the # installer will have to double-check. - echo "Verify if $OLD_DIR and $TICDIR are the same." - echo "The new terminfo is in $TICDIR; the other should be a link to it." - echo "Otherwise, remove $OLD_DIR and link it to $TICDIR." + echo "Verify if $TICDIR and $TERMINFO are the same." + echo "The new terminfo is in $TERMINFO; the other should be a link to it." + echo "Otherwise, remove $TICDIR and link it to $TERMINFO." fi else - cd "${INSTALL_PREFIX}" || exit + cd ${DESTDIR}$prefix || exit # Construct a symbolic link that only assumes $ticdir has the # same $prefix as the other installed directories. - SOURCE=`echo "$ticdir"|sed -e 's%^'"$prefix"'/%%'` - if test "$SOURCE" != "$ticdir" ; then - SOURCE=../`echo "$ticdir"|sed -e 's%^'"$prefix"'/%%' -e 's%^/%%'` + RELATIVE=`echo $ticdir|sed -e 's%^'$prefix'/%%'` + if test "$RELATIVE" != "$ticdir" ; then + RELATIVE=../`echo $ticdir|sed -e 's%^'$prefix'/%%' -e 's%^/%%'` fi - test -d lib || mkdir lib - cd lib || exit - TARGET=`pwd`/terminfo - if ( @LN_S@ "$SOURCE" terminfo ) + if ( @LN_S@ "$RELATIVE" "$TICDIR" ) then - echo "** sym-linked $TARGET for compatibility" + echo "** sym-linked $TICDIR for compatibility" else - echo "** could not sym-link $TARGET for compatibility" + echo "** could not sym-link $TICDIR for compatibility" fi fi fi -# vile:shmode ts=4 sw=4 +# vile:shmode