Ticket #31216: python-libedit.diff
File python-libedit.diff, 38.5 KB (added by jmroot (Joshua Root), 13 years ago) |
---|
-
python25/files/patch-libedit.diff
1 --- configure.orig 2011-10-31 13:23:35.000000000 +1100 2 +++ configure 2011-10-31 13:28:19.000000000 +1100 3 @@ -20985,9 +20985,9 @@ 4 echo $ECHO_N "checking how to link readline libs... $ECHO_C" >&6; } 5 for py_libtermcap in "" ncursesw ncurses curses termcap; do 6 if test -z "$py_libtermcap"; then 7 - READLINE_LIBS="-lreadline" 8 + READLINE_LIBS="-ledit" 9 else 10 - READLINE_LIBS="-lreadline -l$py_libtermcap" 11 + READLINE_LIBS="-ledit -l$py_libtermcap" 12 fi 13 LIBS="$READLINE_LIBS $LIBS_no_readline" 14 cat >conftest.$ac_ext <<_ACEOF 15 @@ -21060,13 +21060,13 @@ 16 fi 17 18 # check for readline 2.1 19 -{ echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 20 -echo $ECHO_N "checking for rl_callback_handler_install in -lreadline... $ECHO_C" >&6; } 21 +{ echo "$as_me:$LINENO: checking for rl_callback_handler_install in -ledit" >&5 22 +echo $ECHO_N "checking for rl_callback_handler_install in -ledit... $ECHO_C" >&6; } 23 if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then 24 echo $ECHO_N "(cached) $ECHO_C" >&6 25 else 26 ac_check_lib_save_LIBS=$LIBS 27 -LIBS="-lreadline $READLINE_LIBS $LIBS" 28 +LIBS="-ledit $READLINE_LIBS $LIBS" 29 cat >conftest.$ac_ext <<_ACEOF 30 /* confdefs.h. */ 31 _ACEOF 32 @@ -21137,7 +21137,7 @@ 33 cat confdefs.h >>conftest.$ac_ext 34 cat >>conftest.$ac_ext <<_ACEOF 35 /* end confdefs.h. */ 36 -#include <readline/readline.h> 37 +#include <editline/readline.h> 38 _ACEOF 39 if { (ac_try="$ac_cpp conftest.$ac_ext" 40 case "(($ac_try" in 41 @@ -21172,7 +21172,7 @@ 42 cat confdefs.h >>conftest.$ac_ext 43 cat >>conftest.$ac_ext <<_ACEOF 44 /* end confdefs.h. */ 45 -#include <readline/readline.h> 46 +#include <editline/readline.h> 47 48 _ACEOF 49 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 50 @@ -21188,13 +21188,13 @@ 51 fi 52 53 # check for readline 4.0 54 -{ echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5 55 -echo $ECHO_N "checking for rl_pre_input_hook in -lreadline... $ECHO_C" >&6; } 56 +{ echo "$as_me:$LINENO: checking for rl_pre_input_hook in -ledit" >&5 57 +echo $ECHO_N "checking for rl_pre_input_hook in -ledit... $ECHO_C" >&6; } 58 if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then 59 echo $ECHO_N "(cached) $ECHO_C" >&6 60 else 61 ac_check_lib_save_LIBS=$LIBS 62 -LIBS="-lreadline $READLINE_LIBS $LIBS" 63 +LIBS="-ledit $READLINE_LIBS $LIBS" 64 cat >conftest.$ac_ext <<_ACEOF 65 /* confdefs.h. */ 66 _ACEOF 67 @@ -21259,13 +21259,13 @@ 68 69 70 # check for readline 4.2 71 -{ echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5 72 -echo $ECHO_N "checking for rl_completion_matches in -lreadline... $ECHO_C" >&6; } 73 +{ echo "$as_me:$LINENO: checking for rl_completion_matches in -ledit" >&5 74 +echo $ECHO_N "checking for rl_completion_matches in -ledit... $ECHO_C" >&6; } 75 if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then 76 echo $ECHO_N "(cached) $ECHO_C" >&6 77 else 78 ac_check_lib_save_LIBS=$LIBS 79 -LIBS="-lreadline $READLINE_LIBS $LIBS" 80 +LIBS="-ledit $READLINE_LIBS $LIBS" 81 cat >conftest.$ac_ext <<_ACEOF 82 /* confdefs.h. */ 83 _ACEOF 84 @@ -21336,7 +21336,7 @@ 85 cat confdefs.h >>conftest.$ac_ext 86 cat >>conftest.$ac_ext <<_ACEOF 87 /* end confdefs.h. */ 88 -#include <readline/readline.h> 89 +#include <editline/readline.h> 90 _ACEOF 91 if { (ac_try="$ac_cpp conftest.$ac_ext" 92 case "(($ac_try" in 93 @@ -21371,7 +21371,7 @@ 94 cat confdefs.h >>conftest.$ac_ext 95 cat >>conftest.$ac_ext <<_ACEOF 96 /* end confdefs.h. */ 97 -#include <readline/readline.h> 98 +#include <editline/readline.h> 99 100 _ACEOF 101 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 102 --- setup.py.orig 2011-10-31 13:23:35.000000000 +1100 103 +++ setup.py 2011-10-31 13:32:40.000000000 +1100 104 @@ -488,7 +488,7 @@ 105 else: 106 readline_extra_link_args = () 107 108 - readline_libs = ['readline'] 109 + readline_libs = ['edit'] 110 if self.compiler.find_library_file(lib_dirs, 111 'ncursesw'): 112 readline_libs.append('ncursesw') 113 --- Modules/readline.c.orig 2007-01-23 03:10:27.000000000 +1100 114 +++ Modules/readline.c 2011-10-31 14:00:36.000000000 +1100 115 @@ -28,8 +28,7 @@ 116 117 /* GNU readline definitions */ 118 #undef HAVE_CONFIG_H /* Else readline/chardefs.h includes strings.h */ 119 -#include <readline/readline.h> 120 -#include <readline/history.h> 121 +#include <editline/readline.h> 122 123 #ifdef HAVE_RL_COMPLETION_MATCHES 124 #define completion_matches(x, y) \ 125 @@ -794,7 +793,6 @@ readline_until_enter_or_signal(char *pro 126 PyEval_SaveThread(); 127 #endif 128 if (s < 0) { 129 - rl_free_line_state(); 130 rl_cleanup_after_signal(); 131 rl_callback_handler_remove(); 132 *signal = 1; -
python25/Portfile
6 6 7 7 name python25 8 8 version 2.5.6 9 revision 19 revision 2 10 10 11 11 set branch [join [lrange [split ${version} .] 0 1] .] 12 12 categories lang … … 37 37 patch-configure.diff \ 38 38 patch-64bit.diff \ 39 39 patch-setup_no_tkinter.py.diff \ 40 patch-mac_ver.diff 40 patch-mac_ver.diff \ 41 patch-libedit.diff 41 42 42 43 depends_lib port:gettext port:zlib port:openssl \ 43 44 port:sqlite3 port:db46 port:bzip2 \ 44 port:gdbm port: readlineport:ncurses45 port:gdbm port:libedit port:ncurses 45 46 depends_run port:python_select 46 47 47 48 configure.args --enable-shared \ -
python26/files/patch-libedit.diff
1 --- configure.orig 2010-05-25 12:27:03.000000000 +1000 2 +++ configure 2011-10-31 14:15:56.000000000 +1100 3 @@ -11947,9 +11947,9 @@ 4 $as_echo_n "checking how to link readline libs... " >&6; } 5 for py_libtermcap in "" ncursesw ncurses curses termcap; do 6 if test -z "$py_libtermcap"; then 7 - READLINE_LIBS="-lreadline" 8 + READLINE_LIBS="-ledit" 9 else 10 - READLINE_LIBS="-lreadline -l$py_libtermcap" 11 + READLINE_LIBS="-ledit -l$py_libtermcap" 12 fi 13 LIBS="$READLINE_LIBS $LIBS_no_readline" 14 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 15 @@ -11993,13 +11993,13 @@ 16 fi 17 18 # check for readline 2.1 19 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install in -lreadline" >&5 20 -$as_echo_n "checking for rl_callback_handler_install in -lreadline... " >&6; } 21 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install in -ledit" >&5 22 +$as_echo_n "checking for rl_callback_handler_install in -ledit... " >&6; } 23 if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then : 24 $as_echo_n "(cached) " >&6 25 else 26 ac_check_lib_save_LIBS=$LIBS 27 -LIBS="-lreadline $READLINE_LIBS $LIBS" 28 +LIBS="-ledit $READLINE_LIBS $LIBS" 29 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 30 /* end confdefs.h. */ 31 32 @@ -12039,7 +12039,7 @@ 33 # check for readline 2.2 34 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 35 /* end confdefs.h. */ 36 -#include <readline/readline.h> 37 +#include <editline/readline.h> 38 _ACEOF 39 if ac_fn_c_try_cpp "$LINENO"; then : 40 have_readline=yes 41 @@ -12051,7 +12051,7 @@ 42 then 43 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 44 /* end confdefs.h. */ 45 -#include <readline/readline.h> 46 +#include <editline/readline.h> 47 48 _ACEOF 49 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 50 @@ -12064,7 +12064,7 @@ 51 52 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 53 /* end confdefs.h. */ 54 -#include <readline/readline.h> 55 +#include <editline/readline.h> 56 57 _ACEOF 58 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 59 @@ -12078,13 +12078,13 @@ 60 fi 61 62 # check for readline 4.0 63 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -lreadline" >&5 64 -$as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; } 65 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -ledit" >&5 66 +$as_echo_n "checking for rl_pre_input_hook in -ledit... " >&6; } 67 if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then : 68 $as_echo_n "(cached) " >&6 69 else 70 ac_check_lib_save_LIBS=$LIBS 71 -LIBS="-lreadline $READLINE_LIBS $LIBS" 72 +LIBS="-ledit $READLINE_LIBS $LIBS" 73 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 74 /* end confdefs.h. */ 75 76 @@ -12122,13 +12122,13 @@ 77 78 79 # also in 4.0 80 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -lreadline" >&5 81 -$as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... " >&6; } 82 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -ledit" >&5 83 +$as_echo_n "checking for rl_completion_display_matches_hook in -ledit... " >&6; } 84 if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set; then : 85 $as_echo_n "(cached) " >&6 86 else 87 ac_check_lib_save_LIBS=$LIBS 88 -LIBS="-lreadline $READLINE_LIBS $LIBS" 89 +LIBS="-ledit $READLINE_LIBS $LIBS" 90 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 91 /* end confdefs.h. */ 92 93 @@ -12166,13 +12166,13 @@ 94 95 96 # check for readline 4.2 97 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -lreadline" >&5 98 -$as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; } 99 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -ledit" >&5 100 +$as_echo_n "checking for rl_completion_matches in -ledit... " >&6; } 101 if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then : 102 $as_echo_n "(cached) " >&6 103 else 104 ac_check_lib_save_LIBS=$LIBS 105 -LIBS="-lreadline $READLINE_LIBS $LIBS" 106 +LIBS="-ledit $READLINE_LIBS $LIBS" 107 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 108 /* end confdefs.h. */ 109 110 @@ -12212,7 +12212,7 @@ 111 # also in readline 4.2 112 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 113 /* end confdefs.h. */ 114 -#include <readline/readline.h> 115 +#include <editline/readline.h> 116 _ACEOF 117 if ac_fn_c_try_cpp "$LINENO"; then : 118 have_readline=yes 119 @@ -12224,7 +12224,7 @@ 120 then 121 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 122 /* end confdefs.h. */ 123 -#include <readline/readline.h> 124 +#include <editline/readline.h> 125 126 _ACEOF 127 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 128 --- setup.py.orig 2011-10-31 14:13:22.000000000 +1100 129 +++ setup.py 2011-10-31 14:18:07.000000000 +1100 130 @@ -601,7 +601,7 @@ 131 missing.extend(['imageop']) 132 133 # readline 134 - do_readline = self.compiler.find_library_file(lib_dirs, 'readline') 135 + do_readline = self.compiler.find_library_file(lib_dirs, 'edit') 136 readline_termcap_library = "" 137 curses_library = "" 138 # Determine if readline is already linked against curses or tinfo. 139 @@ -656,7 +656,7 @@ 140 else: 141 readline_extra_link_args = () 142 143 - readline_libs = ['readline'] 144 + readline_libs = ['edit'] 145 if readline_termcap_library: 146 pass # Issue 7384: Already linked against curses or tinfo. 147 elif curses_library: 148 --- Modules/readline.c.orig 2010-05-10 01:15:40.000000000 +1000 149 +++ Modules/readline.c 2011-10-31 14:43:16.000000000 +1100 150 @@ -28,8 +28,7 @@ 151 152 /* GNU readline definitions */ 153 #undef HAVE_CONFIG_H /* Else readline/chardefs.h includes strings.h */ 154 -#include <readline/readline.h> 155 -#include <readline/history.h> 156 +#include <editline/readline.h> 157 158 #ifdef HAVE_RL_COMPLETION_MATCHES 159 #define completion_matches(x, y) \ 160 @@ -510,14 +509,12 @@ get_history_item(PyObject *self, PyObjec 161 HISTORY_STATE *hist_st; 162 hist_st = history_get_history_state(); 163 164 - idx --; 165 - 166 /* 167 * Apple's readline emulation crashes when 168 * the index is out of range, therefore 169 * test for that and fail gracefully. 170 */ 171 - if (idx < 0 || idx >= hist_st->length) { 172 + if (idx < 1 || idx > hist_st->length) { 173 Py_RETURN_NONE; 174 } 175 } 176 @@ -926,7 +923,6 @@ readline_until_enter_or_signal(char *pro 177 PyEval_SaveThread(); 178 #endif 179 if (s < 0) { 180 - rl_free_line_state(); 181 rl_cleanup_after_signal(); 182 rl_callback_handler_remove(); 183 *signal = 1; 184 @@ -1025,15 +1021,6 @@ call_readline(FILE *sys_stdin, FILE *sys 185 char *line; 186 HISTORY_STATE *state = history_get_history_state(); 187 if (state->length > 0) 188 -#ifdef __APPLE__ 189 - if (using_libedit_emulation) { 190 - /* 191 - * Libedit's emulation uses 0-based indexes, 192 - * the real readline uses 1-based indexes. 193 - */ 194 - line = history_get(state->length - 1)->line; 195 - } else 196 -#endif /* __APPLE__ */ 197 line = history_get(state->length)->line; 198 else 199 line = ""; -
python26/Portfile
7 7 name python26 8 8 # Remember to keep py26-tkinter's version sync'd with this 9 9 version 2.6.7 10 revision 110 revision 2 11 11 set major [lindex [split $version .] 0] 12 12 set branch [join [lrange [split ${version} .] 0 1] .] 13 13 categories lang … … 44 44 patch-Mac-Tools-Doc-setup.py.diff \ 45 45 patch-setup.py-db46.diff \ 46 46 patch-Lib-ctypes-macholib-dyld.py.diff \ 47 patch-setup_no_tkinter.py.diff 47 patch-setup_no_tkinter.py.diff \ 48 patch-libedit.diff 48 49 49 50 depends_lib port:gettext port:zlib port:openssl \ 50 51 port:sqlite3 port:db46 port:ncurses port:gdbm \ 51 port:bzip2 port: readline52 port:bzip2 port:libedit 52 53 depends_run port:python_select 53 54 54 55 configure.args --enable-framework=${frameworks_dir} \ -
python27/files/patch-libedit.diff
1 --- configure.orig 2011-10-31 14:58:43.000000000 +1100 2 +++ configure 2011-10-31 15:01:31.000000000 +1100 3 @@ -12855,9 +12855,9 @@ 4 $as_echo_n "checking how to link readline libs... " >&6; } 5 for py_libtermcap in "" ncursesw ncurses curses termcap; do 6 if test -z "$py_libtermcap"; then 7 - READLINE_LIBS="-lreadline" 8 + READLINE_LIBS="-ledit" 9 else 10 - READLINE_LIBS="-lreadline -l$py_libtermcap" 11 + READLINE_LIBS="-ledit -l$py_libtermcap" 12 fi 13 LIBS="$READLINE_LIBS $LIBS_no_readline" 14 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 15 @@ -12901,13 +12901,13 @@ 16 fi 17 18 # check for readline 2.1 19 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install in -lreadline" >&5 20 -$as_echo_n "checking for rl_callback_handler_install in -lreadline... " >&6; } 21 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install in -ledit" >&5 22 +$as_echo_n "checking for rl_callback_handler_install in -ledit... " >&6; } 23 if ${ac_cv_lib_readline_rl_callback_handler_install+:} false; then : 24 $as_echo_n "(cached) " >&6 25 else 26 ac_check_lib_save_LIBS=$LIBS 27 -LIBS="-lreadline $READLINE_LIBS $LIBS" 28 +LIBS="-ledit $READLINE_LIBS $LIBS" 29 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 30 /* end confdefs.h. */ 31 32 @@ -12947,7 +12947,7 @@ 33 # check for readline 2.2 34 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 35 /* end confdefs.h. */ 36 -#include <readline/readline.h> 37 +#include <editline/readline.h> 38 _ACEOF 39 if ac_fn_c_try_cpp "$LINENO"; then : 40 have_readline=yes 41 @@ -12960,7 +12960,7 @@ 42 then 43 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 44 /* end confdefs.h. */ 45 -#include <readline/readline.h> 46 +#include <editline/readline.h> 47 48 _ACEOF 49 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 50 @@ -12973,7 +12973,7 @@ 51 52 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 53 /* end confdefs.h. */ 54 -#include <readline/readline.h> 55 +#include <editline/readline.h> 56 57 _ACEOF 58 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 59 @@ -12987,13 +12987,13 @@ 60 fi 61 62 # check for readline 4.0 63 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -lreadline" >&5 64 -$as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; } 65 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -ledit" >&5 66 +$as_echo_n "checking for rl_pre_input_hook in -ledit... " >&6; } 67 if ${ac_cv_lib_readline_rl_pre_input_hook+:} false; then : 68 $as_echo_n "(cached) " >&6 69 else 70 ac_check_lib_save_LIBS=$LIBS 71 -LIBS="-lreadline $READLINE_LIBS $LIBS" 72 +LIBS="-ledit $READLINE_LIBS $LIBS" 73 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 74 /* end confdefs.h. */ 75 76 @@ -13031,13 +13031,13 @@ 77 78 79 # also in 4.0 80 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -lreadline" >&5 81 -$as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... " >&6; } 82 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -ledit" >&5 83 +$as_echo_n "checking for rl_completion_display_matches_hook in -ledit... " >&6; } 84 if ${ac_cv_lib_readline_rl_completion_display_matches_hook+:} false; then : 85 $as_echo_n "(cached) " >&6 86 else 87 ac_check_lib_save_LIBS=$LIBS 88 -LIBS="-lreadline $READLINE_LIBS $LIBS" 89 +LIBS="-ledit $READLINE_LIBS $LIBS" 90 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 91 /* end confdefs.h. */ 92 93 @@ -13075,13 +13075,13 @@ 94 95 96 # check for readline 4.2 97 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -lreadline" >&5 98 -$as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; } 99 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -ledit" >&5 100 +$as_echo_n "checking for rl_completion_matches in -ledit... " >&6; } 101 if ${ac_cv_lib_readline_rl_completion_matches+:} false; then : 102 $as_echo_n "(cached) " >&6 103 else 104 ac_check_lib_save_LIBS=$LIBS 105 -LIBS="-lreadline $READLINE_LIBS $LIBS" 106 +LIBS="-ledit $READLINE_LIBS $LIBS" 107 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 108 /* end confdefs.h. */ 109 110 @@ -13121,7 +13121,7 @@ 111 # also in readline 4.2 112 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 113 /* end confdefs.h. */ 114 -#include <readline/readline.h> 115 +#include <editline/readline.h> 116 _ACEOF 117 if ac_fn_c_try_cpp "$LINENO"; then : 118 have_readline=yes 119 @@ -13134,7 +13134,7 @@ 120 then 121 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 122 /* end confdefs.h. */ 123 -#include <readline/readline.h> 124 +#include <editline/readline.h> 125 126 _ACEOF 127 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 128 --- setup.py.orig 2011-10-31 14:58:43.000000000 +1100 129 +++ setup.py 2011-10-31 15:03:30.000000000 +1100 130 @@ -620,7 +620,7 @@ 131 missing.extend(['imageop']) 132 133 # readline 134 - do_readline = self.compiler.find_library_file(lib_dirs, 'readline') 135 + do_readline = self.compiler.find_library_file(lib_dirs, 'edit') 136 readline_termcap_library = "" 137 curses_library = "" 138 # Determine if readline is already linked against curses or tinfo. 139 @@ -671,7 +671,7 @@ 140 else: 141 readline_extra_link_args = () 142 143 - readline_libs = ['readline'] 144 + readline_libs = ['edit'] 145 if readline_termcap_library: 146 pass # Issue 7384: Already linked against curses or tinfo. 147 elif curses_library: 148 --- Modules/readline.c.orig 2011-06-12 01:46:27.000000000 +1000 149 +++ Modules/readline.c 2011-10-31 15:07:35.000000000 +1100 150 @@ -28,8 +28,7 @@ 151 152 /* GNU readline definitions */ 153 #undef HAVE_CONFIG_H /* Else readline/chardefs.h includes strings.h */ 154 -#include <readline/readline.h> 155 -#include <readline/history.h> 156 +#include <editline/readline.h> 157 158 #ifdef HAVE_RL_COMPLETION_MATCHES 159 #define completion_matches(x, y) \ 160 @@ -550,14 +549,13 @@ get_history_item(PyObject *self, PyObjec 161 * difference. 162 */ 163 int length = _py_get_history_length(); 164 - idx --; 165 166 /* 167 * Apple's readline emulation crashes when 168 * the index is out of range, therefore 169 * test for that and fail gracefully. 170 */ 171 - if (idx < 0 || idx >= length) { 172 + if (idx < 1 || idx > length) { 173 Py_RETURN_NONE; 174 } 175 } 176 @@ -976,7 +974,6 @@ readline_until_enter_or_signal(char *pro 177 PyEval_SaveThread(); 178 #endif 179 if (s < 0) { 180 - rl_free_line_state(); 181 rl_cleanup_after_signal(); 182 rl_callback_handler_remove(); 183 *signal = 1; 184 @@ -1075,15 +1072,6 @@ call_readline(FILE *sys_stdin, FILE *sys 185 const char *line; 186 int length = _py_get_history_length(); 187 if (length > 0) 188 -#ifdef __APPLE__ 189 - if (using_libedit_emulation) { 190 - /* 191 - * Libedit's emulation uses 0-based indexes, 192 - * the real readline uses 1-based indexes. 193 - */ 194 - line = history_get(length - 1)->line; 195 - } else 196 -#endif /* __APPLE__ */ 197 line = history_get(length)->line; 198 else 199 line = ""; -
python27/Portfile
8 8 epoch 2 9 9 # Remember to keep py27-tkinter's version sync'd with this 10 10 version 2.7.2 11 revision 111 revision 2 12 12 13 13 set major [lindex [split $version .] 0] 14 14 set branch [join [lrange [split ${version} .] 0 1] .] … … 40 40 patch-setup_no_tkinter.py.diff \ 41 41 patch-Lib-cgi.py.diff \ 42 42 patch-Lib-ctypes-macholib-dyld.py.diff \ 43 patch-configure.diff 43 patch-configure.diff \ 44 patch-libedit.diff 44 45 # patch-readlinefix.diff 45 46 46 47 depends_lib port:gettext \ … … 51 52 port:ncurses \ 52 53 port:gdbm \ 53 54 port:bzip2 \ 54 port: readline55 port:libedit 55 56 depends_run port:python_select 56 57 57 58 configure.args --enable-framework=${frameworks_dir} \ -
python31/files/patch-libedit.diff
1 --- configure.orig 2011-06-12 01:48:52.000000000 +1000 2 +++ configure 2011-10-31 15:28:14.000000000 +1100 3 @@ -12494,9 +12494,9 @@ 4 $as_echo_n "checking how to link readline libs... " >&6; } 5 for py_libtermcap in "" ncursesw ncurses curses termcap; do 6 if test -z "$py_libtermcap"; then 7 - READLINE_LIBS="-lreadline" 8 + READLINE_LIBS="-ledit" 9 else 10 - READLINE_LIBS="-lreadline -l$py_libtermcap" 11 + READLINE_LIBS="-ledit -l$py_libtermcap" 12 fi 13 LIBS="$READLINE_LIBS $LIBS_no_readline" 14 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 15 @@ -12540,13 +12540,13 @@ 16 fi 17 18 # check for readline 2.1 19 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install in -lreadline" >&5 20 -$as_echo_n "checking for rl_callback_handler_install in -lreadline... " >&6; } 21 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install in -ledit" >&5 22 +$as_echo_n "checking for rl_callback_handler_install in -ledit... " >&6; } 23 if ${ac_cv_lib_readline_rl_callback_handler_install+:} false; then : 24 $as_echo_n "(cached) " >&6 25 else 26 ac_check_lib_save_LIBS=$LIBS 27 -LIBS="-lreadline $READLINE_LIBS $LIBS" 28 +LIBS="-ledit $READLINE_LIBS $LIBS" 29 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 30 /* end confdefs.h. */ 31 32 @@ -12586,7 +12586,7 @@ 33 # check for readline 2.2 34 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 35 /* end confdefs.h. */ 36 -#include <readline/readline.h> 37 +#include <editline/readline.h> 38 _ACEOF 39 if ac_fn_c_try_cpp "$LINENO"; then : 40 have_readline=yes 41 @@ -12598,7 +12598,7 @@ 42 then 43 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 44 /* end confdefs.h. */ 45 -#include <readline/readline.h> 46 +#include <editline/readline.h> 47 48 _ACEOF 49 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 50 @@ -12611,7 +12611,7 @@ 51 52 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 53 /* end confdefs.h. */ 54 -#include <readline/readline.h> 55 +#include <editline/readline.h> 56 57 _ACEOF 58 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 59 @@ -12625,13 +12625,13 @@ 60 fi 61 62 # check for readline 4.0 63 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -lreadline" >&5 64 -$as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; } 65 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -ledit" >&5 66 +$as_echo_n "checking for rl_pre_input_hook in -ledit... " >&6; } 67 if ${ac_cv_lib_readline_rl_pre_input_hook+:} false; then : 68 $as_echo_n "(cached) " >&6 69 else 70 ac_check_lib_save_LIBS=$LIBS 71 -LIBS="-lreadline $READLINE_LIBS $LIBS" 72 +LIBS="-ledit $READLINE_LIBS $LIBS" 73 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 74 /* end confdefs.h. */ 75 76 @@ -12669,13 +12669,13 @@ 77 78 79 # also in 4.0 80 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -lreadline" >&5 81 -$as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... " >&6; } 82 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -ledit" >&5 83 +$as_echo_n "checking for rl_completion_display_matches_hook in -ledit... " >&6; } 84 if ${ac_cv_lib_readline_rl_completion_display_matches_hook+:} false; then : 85 $as_echo_n "(cached) " >&6 86 else 87 ac_check_lib_save_LIBS=$LIBS 88 -LIBS="-lreadline $READLINE_LIBS $LIBS" 89 +LIBS="-ledit $READLINE_LIBS $LIBS" 90 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 91 /* end confdefs.h. */ 92 93 @@ -12713,13 +12713,13 @@ 94 95 96 # check for readline 4.2 97 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -lreadline" >&5 98 -$as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; } 99 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -ledit" >&5 100 +$as_echo_n "checking for rl_completion_matches in -ledit... " >&6; } 101 if ${ac_cv_lib_readline_rl_completion_matches+:} false; then : 102 $as_echo_n "(cached) " >&6 103 else 104 ac_check_lib_save_LIBS=$LIBS 105 -LIBS="-lreadline $READLINE_LIBS $LIBS" 106 +LIBS="-ledit $READLINE_LIBS $LIBS" 107 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 108 /* end confdefs.h. */ 109 110 @@ -12759,7 +12759,7 @@ 111 # also in readline 4.2 112 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 113 /* end confdefs.h. */ 114 -#include <readline/readline.h> 115 +#include <editline/readline.h> 116 _ACEOF 117 if ac_fn_c_try_cpp "$LINENO"; then : 118 have_readline=yes 119 @@ -12771,7 +12771,7 @@ 120 then 121 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 122 /* end confdefs.h. */ 123 -#include <readline/readline.h> 124 +#include <editline/readline.h> 125 126 _ACEOF 127 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 128 --- setup.py.orig 2011-10-31 15:26:25.000000000 +1100 129 +++ setup.py 2011-10-31 15:29:39.000000000 +1100 130 @@ -570,7 +570,7 @@ 131 exts.append( Extension('audioop', ['audioop.c']) ) 132 133 # readline 134 - do_readline = self.compiler.find_library_file(lib_dirs, 'readline') 135 + do_readline = self.compiler.find_library_file(lib_dirs, 'edit') 136 readline_termcap_library = "" 137 curses_library = "" 138 # Determine if readline is already linked against curses or tinfo. 139 @@ -627,7 +627,7 @@ 140 else: 141 readline_extra_link_args = () 142 143 - readline_libs = ['readline'] 144 + readline_libs = ['edit'] 145 if readline_termcap_library: 146 pass # Issue 7384: Already linked against curses or tinfo. 147 elif curses_library: 148 --- Modules/readline.c.orig 2011-06-12 01:48:52.000000000 +1000 149 +++ Modules/readline.c 2011-10-31 15:34:23.000000000 +1100 150 @@ -28,8 +28,7 @@ 151 152 /* GNU readline definitions */ 153 #undef HAVE_CONFIG_H /* Else readline/chardefs.h includes strings.h */ 154 -#include <readline/readline.h> 155 -#include <readline/history.h> 156 +#include <editline/readline.h> 157 158 #ifdef HAVE_RL_COMPLETION_MATCHES 159 #define completion_matches(x, y) \ 160 @@ -919,7 +918,6 @@ readline_until_enter_or_signal(char *pro 161 PyEval_SaveThread(); 162 #endif 163 if (s < 0) { 164 - rl_free_line_state(); 165 rl_cleanup_after_signal(); 166 rl_callback_handler_remove(); 167 *signal = 1; -
python31/Portfile
8 8 epoch 1 9 9 # Remember to keep py31-tkinter's version sync'd with this 10 10 version 3.1.4 11 revision 111 revision 2 12 12 set major [lindex [split $version .] 0] 13 13 set branch [join [lrange [split ${version} .] 0 1] .] 14 14 categories lang … … 33 33 patchfiles patch-setup.py.diff \ 34 34 patch-Lib-cgi.py.diff \ 35 35 patch-Lib-distutils-dist.py.diff \ 36 patch-setup_no_tkinter.py.diff 36 patch-setup_no_tkinter.py.diff \ 37 patch-libedit.diff 37 38 38 39 depends_lib port:zlib port:openssl \ 39 40 port:sqlite3 port:ncurses port:gdbm \ 40 port:bzip2 port: readlineport:gettext41 port:bzip2 port:libedit port:gettext 41 42 depends_run port:python_select 42 43 43 44 configure.args --enable-framework=${frameworks_dir} \ -
python32/files/patch-libedit.diff
1 --- configure.orig 2011-06-12 01:48:52.000000000 +1000 2 +++ configure 2011-10-31 15:28:14.000000000 +1100 3 @@ -12807,9 +12807,9 @@ 4 $as_echo_n "checking how to link readline libs... " >&6; } 5 for py_libtermcap in "" ncursesw ncurses curses termcap; do 6 if test -z "$py_libtermcap"; then 7 - READLINE_LIBS="-lreadline" 8 + READLINE_LIBS="-ledit" 9 else 10 - READLINE_LIBS="-lreadline -l$py_libtermcap" 11 + READLINE_LIBS="-ledit -l$py_libtermcap" 12 fi 13 LIBS="$READLINE_LIBS $LIBS_no_readline" 14 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 15 @@ -12853,13 +12853,13 @@ 16 fi 17 18 # check for readline 2.1 19 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install in -lreadline" >&5 20 -$as_echo_n "checking for rl_callback_handler_install in -lreadline... " >&6; } 21 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install in -ledit" >&5 22 +$as_echo_n "checking for rl_callback_handler_install in -ledit... " >&6; } 23 if ${ac_cv_lib_readline_rl_callback_handler_install+:} false; then : 24 $as_echo_n "(cached) " >&6 25 else 26 ac_check_lib_save_LIBS=$LIBS 27 -LIBS="-lreadline $READLINE_LIBS $LIBS" 28 +LIBS="-ledit $READLINE_LIBS $LIBS" 29 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 30 /* end confdefs.h. */ 31 32 @@ -12899,7 +12899,7 @@ 33 # check for readline 2.2 34 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 35 /* end confdefs.h. */ 36 -#include <readline/readline.h> 37 +#include <editline/readline.h> 38 _ACEOF 39 if ac_fn_c_try_cpp "$LINENO"; then : 40 have_readline=yes 41 @@ -12912,7 +12912,7 @@ 42 then 43 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 44 /* end confdefs.h. */ 45 -#include <readline/readline.h> 46 +#include <editline/readline.h> 47 48 _ACEOF 49 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 50 @@ -12925,7 +12925,7 @@ 51 52 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 53 /* end confdefs.h. */ 54 -#include <readline/readline.h> 55 +#include <editline/readline.h> 56 57 _ACEOF 58 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 59 @@ -12939,13 +12939,13 @@ 60 fi 61 62 # check for readline 4.0 63 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -lreadline" >&5 64 -$as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; } 65 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -ledit" >&5 66 +$as_echo_n "checking for rl_pre_input_hook in -ledit... " >&6; } 67 if ${ac_cv_lib_readline_rl_pre_input_hook+:} false; then : 68 $as_echo_n "(cached) " >&6 69 else 70 ac_check_lib_save_LIBS=$LIBS 71 -LIBS="-lreadline $READLINE_LIBS $LIBS" 72 +LIBS="-ledit $READLINE_LIBS $LIBS" 73 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 74 /* end confdefs.h. */ 75 76 @@ -12983,13 +12983,13 @@ 77 78 79 # also in 4.0 80 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -lreadline" >&5 81 -$as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... " >&6; } 82 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -ledit" >&5 83 +$as_echo_n "checking for rl_completion_display_matches_hook in -ledit... " >&6; } 84 if ${ac_cv_lib_readline_rl_completion_display_matches_hook+:} false; then : 85 $as_echo_n "(cached) " >&6 86 else 87 ac_check_lib_save_LIBS=$LIBS 88 -LIBS="-lreadline $READLINE_LIBS $LIBS" 89 +LIBS="-ledit $READLINE_LIBS $LIBS" 90 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 91 /* end confdefs.h. */ 92 93 @@ -13027,13 +13027,13 @@ 94 95 96 # check for readline 4.2 97 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -lreadline" >&5 98 -$as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; } 99 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -ledit" >&5 100 +$as_echo_n "checking for rl_completion_matches in -ledit... " >&6; } 101 if ${ac_cv_lib_readline_rl_completion_matches+:} false; then : 102 $as_echo_n "(cached) " >&6 103 else 104 ac_check_lib_save_LIBS=$LIBS 105 -LIBS="-lreadline $READLINE_LIBS $LIBS" 106 +LIBS="-ledit $READLINE_LIBS $LIBS" 107 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 108 /* end confdefs.h. */ 109 110 @@ -13073,7 +13073,7 @@ 111 # also in readline 4.2 112 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 113 /* end confdefs.h. */ 114 -#include <readline/readline.h> 115 +#include <editline/readline.h> 116 _ACEOF 117 if ac_fn_c_try_cpp "$LINENO"; then : 118 have_readline=yes 119 @@ -13086,7 +13086,7 @@ 120 then 121 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 122 /* end confdefs.h. */ 123 -#include <readline/readline.h> 124 +#include <editline/readline.h> 125 126 _ACEOF 127 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 128 --- setup.py.orig 2011-10-31 15:26:25.000000000 +1100 129 +++ setup.py 2011-10-31 15:29:39.000000000 +1100 130 @@ -581,7 +581,7 @@ 131 exts.append( Extension('audioop', ['audioop.c']) ) 132 133 # readline 134 - do_readline = self.compiler.find_library_file(lib_dirs, 'readline') 135 + do_readline = self.compiler.find_library_file(lib_dirs, 'edit') 136 readline_termcap_library = "" 137 curses_library = "" 138 # Determine if readline is already linked against curses or tinfo. 139 @@ -637,7 +637,7 @@ 140 else: 141 readline_extra_link_args = () 142 143 - readline_libs = ['readline'] 144 + readline_libs = ['edit'] 145 if readline_termcap_library: 146 pass # Issue 7384: Already linked against curses or tinfo. 147 elif curses_library: 148 --- Modules/readline.c.orig 2011-09-04 02:16:46.000000000 +1000 149 +++ Modules/readline.c 2011-10-31 16:02:33.000000000 +1100 150 @@ -28,8 +28,7 @@ 151 152 /* GNU readline definitions */ 153 #undef HAVE_CONFIG_H /* Else readline/chardefs.h includes strings.h */ 154 -#include <readline/readline.h> 155 -#include <readline/history.h> 156 +#include <editline/readline.h> 157 158 #ifdef HAVE_RL_COMPLETION_MATCHES 159 #define completion_matches(x, y) \ 160 @@ -573,14 +572,13 @@ get_history_item(PyObject *self, PyObjec 161 * difference. 162 */ 163 int length = _py_get_history_length(); 164 - idx --; 165 166 /* 167 * Apple's readline emulation crashes when 168 * the index is out of range, therefore 169 * test for that and fail gracefully. 170 */ 171 - if (idx < 0 || idx >= length) { 172 + if (idx < 1 || idx > length) { 173 Py_RETURN_NONE; 174 } 175 } 176 @@ -1000,7 +998,6 @@ readline_until_enter_or_signal(char *pro 177 PyEval_SaveThread(); 178 #endif 179 if (s < 0) { 180 - rl_free_line_state(); 181 rl_cleanup_after_signal(); 182 rl_callback_handler_remove(); 183 *signal = 1; 184 @@ -1099,15 +1096,6 @@ call_readline(FILE *sys_stdin, FILE *sys 185 const char *line; 186 int length = _py_get_history_length(); 187 if (length > 0) 188 -#ifdef __APPLE__ 189 - if (using_libedit_emulation) { 190 - /* 191 - * Libedit's emulation uses 0-based indexes, 192 - * the real readline uses 1-based indexes. 193 - */ 194 - line = (const char *)history_get(length - 1)->line; 195 - } else 196 -#endif /* __APPLE__ */ 197 line = (const char *)history_get(length)->line; 198 else 199 line = ""; -
python32/Portfile
8 8 epoch 20110904 9 9 # Remember to keep py32-tkinter's version sync'd with this 10 10 version 3.2.2 11 revision 1 11 12 12 13 set major [lindex [split $version .] 0] 13 14 set branch [join [lrange [split ${version} .] 0 1] .] … … 35 36 patch-Lib-cgi.py.diff \ 36 37 patch-Lib-distutils-dist.py.diff \ 37 38 patch-configure.diff \ 38 patch-setup_no_tkinter.py.diff 39 patch-setup_no_tkinter.py.diff \ 40 patch-libedit.diff 39 41 40 42 depends_lib port:zlib port:openssl \ 41 43 port:sqlite3 port:ncurses port:gdbm \ 42 port:bzip2 port: readlineport:gettext44 port:bzip2 port:libedit port:gettext 43 45 depends_run port:python_select 44 46 45 47 configure.args --enable-framework=${frameworks_dir} \