Ticket #14405: readline-tinfo.diff
File readline-tinfo.diff, 10.5 KB (added by , 8 years ago) |
---|
-
SPKG.txt
diff -r c751f87f0077 -r 459e3c61c4b7 SPKG.txt
a b 13 13 14 14 == License == 15 15 16 * GPL V 2+16 * GPL V3+ 17 17 18 18 == SPKG Maintainers == 19 19 20 * Nobody20 * Volker Braun 21 21 22 22 == Upstream Contact == 23 23 … … 25 25 26 26 == Dependencies == 27 27 28 * GNU patch 29 30 * libtermcap (or libncurses or libtinfo), but not Sage's one, 31 since we only build a static version. I.e., the system has 32 to provide one of these. 28 * ncurses 33 29 34 30 == Special Update/Build Instructions == 35 31 36 * Deleted some files from the doc directory from the standard distro, 37 since it took tons of space; didn't delete anything else. 38 * Work around some MacOSX dynamic lib flags. 39 * When self-tests are added upstream, we may have to set up 40 variables like CFLAGS in the script spkg-check: imitate the 41 settings in spkg-install. For self-tests, when we use the system's 42 version of libreadline (e.g. [Open]SuSE or Arch Linux), we have to 43 make sure we don't try to run the test suite in `spkg-check`, since 44 this wouldn't work (and wouldn't make any sense either). 45 * In #11882, we turned off the fixes for Arch Linux and OpenSuSE by 46 changing various tests in spkg-install from "if ..." to "if false 47 && ...". When Arch Linux or OpenSuSE are updated, modified 48 versions of these tests may need to be reinstated. 32 We build readline using ncurses. Readline needs to be told to link 33 with libtinfo (part of ncurses), this is what the patch to shobj-conf 34 does. 35 36 37 == Patches == 38 39 * shobj-conf.patch: Readline's hand-crafted shared library options 40 are buggy (should be using libtool). 41 49 42 50 43 == Changelog == 51 44 52 45 === readline-6.2.p4 (Volker Braun, 3 April 2013) === 53 46 * Do not build static libraries 54 47 * Use ncurses instead of termcap 48 * Remove various commented-out hacks 49 * Patch to src/shlib/Makefile.in removed, this belongs into shobj-conf 55 50 56 51 === readline-6.2.p3 (Leif Leonhardy, 3 January 2012) === 57 52 * #11970: Support Ubuntu 11.10 by adding the library libreadline depends on -
deleted file patches/shlib__Makefile.in.patch
diff -r c751f87f0077 -r 459e3c61c4b7 patches/shlib__Makefile.in.patch
+ - 1 --- src/shlib/Makefile.in 2010-12-28 21:56:21.000000000 +01002 +++ src/shlib/Makefile.in 2011-10-28 06:39:23.000000000 +02003 @@ -166,7 +166,8 @@4 5 $(SHARED_READLINE): $(SHARED_OBJ)6 $(RM) $@7 - $(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} -o $@ $(SHARED_OBJ) $(SHLIB_LIBS)8 + # $(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} -o $@ $(SHARED_OBJ) $(SHLIB_LIBS)9 + $(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} -o $@ $(SHARED_OBJ) $(SHLIB_LIBS) $(TERMCAP_LIB)10 11 $(SHARED_HISTORY): $(SHARED_HISTOBJ) xmalloc.so xfree.so12 $(RM) $@ -
patches/shobj-conf.patch
diff -r c751f87f0077 -r 459e3c61c4b7 patches/shobj-conf.patch
a b 1 --- src/support/shobj-conf 2009-10-28 06:20:21.000000000 -0700 2 +++ src/support/shobj-conf 2011-09-30 09:49:02.000000000 -0700 1 --- src/support/shobj-conf 2009-10-28 13:20:21.000000000 +0000 2 +++ new/support/shobj-conf 2013-08-14 13:38:06.634576906 +0100 3 @@ -39,10 +39,10 @@ 4 SHOBJ_LD= 5 SHOBJ_LDFLAGS= 6 SHOBJ_XLDFLAGS= 7 -SHOBJ_LIBS= 8 +SHOBJ_LIBS='-ltinfo' 9 10 SHLIB_XLDFLAGS= 11 -SHLIB_LIBS= 12 +SHLIB_LIBS='-ltinfo' 13 14 SHLIB_DOT='.' 15 SHLIB_LIBPREF='lib' 3 16 @@ -109,7 +109,7 @@ 4 17 ;; 5 18 … … 9 22 SHOBJ_CFLAGS=-fPIC 10 23 SHOBJ_LD='${CC}' 11 24 SHOBJ_LDFLAGS='-shared -Wl,-soname,$@' 12 @@ -132, 11 +132,12@@25 @@ -132,7 +132,7 @@ 13 26 SHOBJ_CFLAGS=-fPIC 14 27 SHOBJ_LD='${CC}' 15 28 … … 18 31 SHOBJ_LDFLAGS='-shared -Wl,-soname,$@' 19 32 20 33 SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)' 21 SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' 22 + SHLIB_LIBS='-ltermcap' 23 else 24 SHOBJ_LDFLAGS='-shared' 25 26 @@ -146,30 +147,28 @@ 34 @@ -146,32 +146,30 @@ 27 35 ;; 28 36 29 37 # FreeBSD-4.x and later have only ELF … … 36 44 - 37 45 - SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' 38 46 +freebsdelf*|dragonfly*) 39 + 40 + 41 + 42 + 47 + SHOBJ_CFLAGS=-fPIC 48 + SHOBJ_LD='${CC}' 49 + SHOBJ_LDFLAGS='-shared -Wl,-soname,$@' 50 + SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)' 43 51 + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' 44 52 ;; 45 53 … … 62 70 + SHOBJ_LDFLAGS='-dynamiclib -dynamic -undefined dynamic_lookup' 63 71 + SHLIB_XLDFLAGS='-dynamiclib -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' 64 72 65 SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1 73 - SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1 74 + SHLIB_LIBS='-ltinfo -lncurses' # see if -lcurses works on MacOS X 10.1 66 75 ;; 67 @@ -186,11 +185,11 @@ 76 77 darwin*|macosx*) 78 @@ -186,15 +184,15 @@ 68 79 SHLIB_LIBSUFF='dylib' 69 80 70 81 case "${host_os}" in … … 79 90 ;; 80 91 esac 81 92 93 - SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1 94 + SHLIB_LIBS='-ltinfo -lncurses' # see if -lcurses works on MacOS X 10.1 95 ;; 96 97 openbsd*|netbsd*) -
spkg-install
diff -r c751f87f0077 -r 459e3c61c4b7 spkg-install
a b 25 25 CFLAGS="-g -O2 $CFLAGS" 26 26 fi 27 27 28 # NOTE: Do *not* add -L$SAGE_LOCAL/lib to LDFLAGS,29 # nor -I$SAGE_LOCAL/include to CPPFLAGS or CFLAGS.30 # Sage ships and builds a libtermcap, but only a static one,31 # and we actually *want* readline to use the system's32 # libtermcap (or libncurses, or libtinfo).33 # Readline does not need any [other] headers or libraries34 # shipped / installed by Sage, so this is pretty ok.35 36 37 28 echo "The following environment variables will be exported:" 38 29 echo "Using CC=$CC" 39 30 echo "Using CFLAGS=$CFLAGS" 40 31 echo "Using CPPFLAGS=$CPPFLAGS" 41 32 echo "Using LDFLAGS=$LDFLAGS" 42 33 echo "Configure scripts and/or makefiles might override these later." 43 echo44 34 35 export CC 45 36 export CFLAGS 46 37 export CPPFLAGS 47 38 export LDFLAGS 48 39 49 # End of pretty generic spkg-install file.50 # Now do the specific things needed for this package (Readline).51 52 # OVERWRITE_READLINE=false; export OVERWRITE_READLINE53 54 # First we check for OpenSUSE 11.x, since there bash is linked dynamically with55 # a potentially more recent readline such that bash crashes when we build Sage's56 # readline (or more precisely Sage's version is found along LD_LIBRARY_PATH), so57 # we work around this for now by not building Sage's version and instead using58 # the system's one.59 #60 # Since Sage's readline version (6.2) is meanwhile (or at the moment) current,61 # there are no problems building it on OpenSuSE (and Arch Linux) as well, so62 # we can bypass the work-arounds. This might change once these operating63 # systems are again ahead of Sage w.r.t. their readline version.64 65 if [[ -f /etc/SuSE-release ]]; then66 echo "OpenSuSE or SuSE Linux detected."67 # #11882: Bypass this work-around for OpenSuSE.68 #69 # Note that "-q" doesn't work with Solaris' non-POSIX grep70 # in the default path, but we're certainly on Linux here:71 if false && grep -q 11\\. /etc/SuSE-release 2>/dev/null; then72 echo "OpenSuSE 11 detected."73 if [[ -d /usr/include/readline/ ]]; then74 echo "The development version of libreadline is installed => copying..."75 # Note that "cp -a" isn't POSIX, but again: We're on Linux.76 # ("uname -p" gives "unknown" on at least some Linuces, so we77 # better use the more portable "-m".)78 if [[ "`uname -m`" = x86_64 ]]; then79 cp -af /lib64/libreadline.so.6* "$SAGE_LOCAL"/lib80 else81 cp -af /lib/libreadline.so.6* "$SAGE_LOCAL"/lib82 fi83 if [[ $? -ne 0 ]]; then84 echo >&2 "Error copying the system's libreadline."85 exit 186 fi87 ln -snf libreadline.so.6 "$SAGE_LOCAL"/lib/libreadline.so88 if [[ $? -ne 0 ]]; then89 echo >&2 "Error creating symbolic link to libreadline.so.6."90 exit 191 fi92 cp -rf /usr/include/readline "$SAGE_LOCAL"/include93 if [[ $? -ne 0 ]]; then94 echo >&2 "Error copying the system's readline header files."95 exit 196 fi97 # Copying succeeded, nothing else to be done.98 exit 099 else100 echo >&2 "Error: No readline headers found. Please install OpenSuSE's development"101 echo >&2 "version of libreadline 6.x since building the version currently shipped"102 echo >&2 "with Sage would break your shell (bash). Sorry."103 exit 1104 # # This variable is only set to "true" on openSUSE 11.1.105 # OVERWRITE_READLINE="true"; export OVERWRITE_READLINE106 fi107 else108 if false; then109 echo "... but not OpenSuSE 11 => building Sage's version of libreadline."110 else111 echo "Building Sage's version of readline 6.2 anyway, since it is assumed"112 echo "to be current and to not break your dynamically linked bash..."113 echo "(Please report if this is no longer the case.)"114 fi115 fi116 fi117 118 # #11882: Bypass this test / work-around for Arch Linux since it apparently119 # is no longer needed, at least at the moment (October 2011).120 #121 # We also check for Arch Linux, since it crashes with "undefined symbol: PC".122 # If anyone knows a better way to fix this, please do.123 # [This is likely to be fixed by putting libtermcap or libncurses into124 # the NEEDED tags of our shared libreadline. -leif (October 2011)]125 if [[ -f /etc/arch-release ]]; then126 echo "Arch Linux detected."127 fi128 if false && [[ -f /etc/arch-release ]]; then129 if [[ -f "/lib/libreadline.so.6" ]]; then130 echo "Copying over system's libreadline (version 6.x)..."131 cp -af /lib/libreadline.so.6* "$SAGE_LOCAL"/lib132 if [[ $? -ne 0 ]]; then133 echo >&2 "Error copying the system's libreadline."134 exit 1135 fi136 ln -snf libreadline.so.6 "$SAGE_LOCAL"/lib/libreadline.so137 if [[ $? -ne 0 ]]; then138 echo >&2 "Error creating symbolic link to libreadline.so.6."139 exit 1140 fi141 # We shouldn't have to copy the headers...142 # (On Arch Linux, these are installed by default.)143 exit 0144 elif [[ -f "/lib/libreadline.so.5" ]]; then145 # We might have only an older version of libreadline.146 echo "Couldn't find a system copy of libreadline 6.x, only 5.x."147 echo "Building Sage's more recent version of libreadline..."148 else149 echo >&2 "Error: Could not find a system copy of libreadline 5.x or 6.x."150 echo >&2 "This is abnormal, so we better stop here..."151 exit 1152 fi153 fi154 155 156 40 cd src/ 157 41 158 42 echo "Applying patches to upstream source..."