Ticket #7610: trac_7610-readline-arch-workaround.patch

File trac_7610-readline-arch-workaround.patch, 4.1 KB (added by timdumol, 12 years ago)

Adds Arch Linux workaround (copies over system library)

  • SPKG.txt

    # HG changeset patch
    # User Tim Dumol <tim@timdumol.com>
    # Date 1260068003 -28800
    # Node ID 66bb8ee5a1f981c43ef23b8d879e80937de286cb
    # Parent  fc379bbd76ae85c607d38541af7d1ddcf030f234
    #7510 readline-6.0 causes "undefined symbol: PC" errors on Arch Linux
    
    diff -r fc379bbd76ae -r 66bb8ee5a1f9 SPKG.txt
    a b  
    3333   since it took tons of space; didn't delete anything else.
    3434 * Work around some MacOSX dynamic lib flags
    3535
     36== readline-6.0p1 (Tim Dumol, December 6th, 2009) ==
     37 * Add workaround for Arch Linux readline issues ("undefined symbol:
     38   PC") by copying over the system version.
     39
    3640=== readline-6.0 (William Stein and David Kirkby, Sept 16th, 2009) ===
    3741 * Upgrade to 6.0 (latest upstream)
    3842 * Remove numerous ugly build hacks needed only on OS X for older readline.
  • spkg-install

    diff -r fc379bbd76ae -r 66bb8ee5a1f9 spkg-install
    a b  
    153153
    154154
    155155echo "Deleting old readline headers and libs"
    156 rm -rf $SAGE_LOCAL/include/readline/
    157 rm -rf $SAGE_LOCAL/lib/libreadline.*
     156rm -rf "$SAGE_LOCAL"/include/readline/
     157rm -rf "$SAGE_LOCAL"/lib/libreadline.*
    158158
    159159# OVERWRITE_READLINE=false; export OVERWRITE_READLINE
    160160
     
    168168        if [ -d /usr/include/readline/ ]; then
    169169            echo "The development version of libreadline is installed -> copying"
    170170            if [ `uname -p` = "x86_64" ]; then
    171                 cp /lib64/libreadline.so.* $SAGE_LOCAL/lib
     171                cp /lib64/libreadline.so.* "$SAGE_LOCAL"/lib
    172172            else
    173                 cp /lib/libreadline.so.* $SAGE_LOCAL/lib
     173                cp /lib/libreadline.so.* "$SAGE_LOCAL"/lib
    174174            fi
    175             cp -r /usr/include/readline  $SAGE_LOCAL/include
     175            cp -r /usr/include/readline  "$SAGE_LOCAL"/include
    176176            exit 0
    177177        else
    178178            echo "No headers found, building library."
     
    182182    fi
    183183fi
    184184
     185# We also check for Arch Linux, since it crashes with "undefined symbol: PC".
     186# If anyone knows a better way to fix this, please do.
     187
     188if [ $UNAME = "Linux" -a -n "`uname -r | grep ARCH`" ]; then
     189    if [ -f "/usr/lib/libreadline.so" ]; then
     190        echo "Copying over system's libreadline."
     191        cp /lib/libreadline.so.* "$SAGE_LOCAL"/lib
     192        exit 0
     193    else
     194        echo "Could not find a system copy of libreadline. Exiting."
     195        exit 1
     196    fi
     197fi
     198
    185199
    186200cd src/
    187201
    188202build()
    189203{
    190     ./configure --prefix=$SAGE_LOCAL
     204    ./configure --prefix="$SAGE_LOCAL" $CONF_FLAGS
    191205    make install
    192206}
    193207
     
    200214set -e
    201215
    202216if [ $UNAME = "Darwin" ]; then
    203   DYLIB_NAME=$SAGE_LOCAL/lib/libreadline.dylib
     217  DYLIB_NAME="$SAGE_LOCAL"/lib/libreadline.dylib
    204218elif [ $UNAME = "CYGWIN" ]; then
    205219  # It is of course very lame that readline names the file .dll.a, but that's what it does.
    206   DYLIB_NAME=$SAGE_LOCAL/lib/libreadline.dll.a
     220  DYLIB_NAME="$SAGE_LOCAL"/lib/libreadline.dll.a
    207221elif [ "$UNAME" = "OpenBSD" ]; then
    208   DYLIB_NAME=$SAGE_LOCAL/lib/libreadline.so.6.0
     222  DYLIB_NAME="$SAGE_LOCAL"/lib/libreadline.so.6.0
    209223elif [ "$UNAME" = "FreeBSD" ]; then
    210   DYLIB_NAME=$SAGE_LOCAL/lib/libreadline.so.6
     224  DYLIB_NAME="$SAGE_LOCAL"/lib/libreadline.so.6
    211225else
    212   DYLIB_NAME=$SAGE_LOCAL/lib/libreadline.so
     226  DYLIB_NAME="$SAGE_LOCAL"/lib/libreadline.so
    213227fi
    214228
    215229# # We only enter this block on openSUSE 11.1.
     
    225239
    226240# Make sure that the install worked, despite whatever the error
    227241# code of build was.
    228 if [ -f $DYLIB_NAME -a -f $SAGE_LOCAL/lib/libreadline.a ]; then
     242if [ -f "$DYLIB_NAME" -a -f "$SAGE_LOCAL"/lib/libreadline.a ]; then
    229243  # Fix permissions.
    230   chmod 755 $SAGE_LOCAL/lib/libreadline.*
    231   chmod 755 $SAGE_LOCAL/lib/libhistory.*
     244  chmod 755 "$SAGE_LOCAL"/lib/libreadline.*
     245  chmod 755 "$SAGE_LOCAL"/lib/libhistory.*
    232246  if [ "$UNAME" = "FreeBSD" ]; then
    233     ln -s libreadline.so.6 $SAGE_LOCAL/lib/libreadline.so
    234     ln -s libhistory.so.6 $SAGE_LOCAL/lib/libhistory.so
     247    ln -s libreadline.so.6 $"SAGE_LOCAL"/lib/libreadline.so
     248    ln -s libhistory.so.6 "$SAGE_LOCAL"/lib/libhistory.so
    235249  fi
    236250  exit 0
    237251else