Ticket #12725: termcap-1.3.1.p3.diff

File termcap-1.3.1.p3.diff, 2.3 KB (added by jdemeyer, 10 years ago)

Diff for the termcap spkg, for review only

  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    2727
    2828== Changelog ==
    2929
     30=== termcap-1.3.1.p3 (Jeroen Demeyer, 28 March 2012) ===
     31 * Trac #12725: Symlink libtermcap.a to libncurses.a if we cannot link
     32   programs against -lncurses.
     33
    3034=== termcap-1.3.1.p2 (Jeroen Demeyer, 11 January 2012) ===
    3135 * Trac #12282: Add patches/strcmp_NULL.patch to fix a bug when the
    3236   environment variable TERM is not set.
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    11#!/usr/bin/env bash
    22
    33if [ "$SAGE_LOCAL" = "" ]; then
    4    echo "SAGE_LOCAL undefined ... exiting";
    5    echo "Maybe run 'sage -sh'?"
    6    exit 1
     4    echo >&2 "SAGE_LOCAL undefined ... exiting"
     5    echo >&2 "Maybe run 'sage --sh'?"
     6    exit 1
    77fi
    88
    99CFLAGS="-O2 -g -fPIC $CFLAGS"
    1010
    1111if [ "x$SAGE64" = xyes ]; then
    12    CFLAGS="$CFLAGS -m64"
     12    CFLAGS="$CFLAGS -m64"
    1313fi
    1414export CFLAGS
    1515
     
    2727
    2828build()
    2929{
    30     if [ ! -f Makefile ]; then
    31         ./configure --prefix="$SAGE_LOCAL"
    32         if [ $? -ne 0 ]; then
    33             echo "ERROR configuring termcap"
    34             exit 1
    35         fi
     30    ./configure --prefix="$SAGE_LOCAL"
     31    if [ $? -ne 0 ]; then
     32        echo >&2 "Error configuring termcap"
     33        exit 1
    3634    fi
     35
    3736    $MAKE CFLAGS="$CFLAGS" install
    3837    if [ $? -ne 0 ]; then
    39         echo "ERROR building termcap"
     38        echo >&2 "Error building termcap"
    4039        exit 1
    4140    fi
    4241}
    4342
    4443build
    4544
    46 if [ $? -eq 0 -a $SAGE_LOCAL/lib/libtermcap.a ]; then
    47     echo "Success building termcap"
     45# If we cannot link programs against -lncurses, then symlink
     46# libtermcap.a to libncurses.a.  This is to support the PARI and
     47# Python build scripts when /usr/lib/libncurses.so exists but
     48# cannot be linked (e.g. because we are cross-compiling).
     49# See #12725.
     50if testcflags.sh -lncurses >/dev/null; then
     51    echo "Good, we can link against libncurses on your system."
    4852else
    49     echo "ERROR building termcap."
    50     exit 1
     53    echo "We cannot link against libncurses on your system,"
     54    echo "making a symbolic link libncurses.a -> libtermcap.a"
     55    echo "(to work around bugs in the PARI and Python build scripts)"
     56    cd "$SAGE_LOCAL/lib" && ln -s libtermcap.a libncurses.a
     57    if [ $? -ne 0 ]; then
     58        echo >&2 "Error making symbolic link libncurses.a -> libtermcap.a"
     59        exit 1
     60    fi
    5161fi
    52