Ticket #62023: python39-fixed-changes-from-patch.diff

File python39-fixed-changes-from-patch.diff, 14.1 KB (added by kencu (Ken), 4 years ago)
  • Lib/cgi.py

    diff --git Lib/cgi.py Lib/cgi.py
    index 77ab703..bfe1e7a 100755
     
    1 #! /usr/local/bin/python
    2 
    3 # NOTE: the above "/usr/local/bin/python" is NOT a mistake.  It is
    4 # intentionally NOT "/usr/bin/env python".  On many systems
    5 # (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
    6 # scripts, and /usr/local/bin is the default directory where Python is
    7 # installed, so /usr/bin/env would be unable to find python.  Granted,
    8 # binary installations by Linux vendors often install Python in
    9 # /usr/bin.  So let those vendors patch cgi.py to match their choice
    10 # of installation.
     1#! /opt/local/bin/python3.9
     2
     3# NOTE: /usr/local/bin/python patched for MacPorts installation
    114
    125"""Support module for CGI (Common Gateway Interface) scripts.
    136
  • Lib/ctypes/macholib/dyld.py

    diff --git Lib/ctypes/macholib/dyld.py Lib/ctypes/macholib/dyld.py
    index 1c3f8fd..cac41e6 100644
    DEFAULT_FRAMEWORK_FALLBACK = [ 
    2828
    2929DEFAULT_LIBRARY_FALLBACK = [
    3030    os.path.expanduser("~/lib"),
    31     "/usr/local/lib",
     31    "/opt/local/lib",
    3232    "/lib",
    3333    "/usr/lib",
    3434]
  • Makefile.pre.in

    diff --git Makefile.pre.in Makefile.pre.in
    index f128444..85bde2b 100644
    sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o 
    629629        esac; \
    630630        echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
    631631                _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
    632                 $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \
     632                $(PYTHON_FOR_BUILD) $(srcdir)/setup.py --no-user-cfg $$quiet build"; \
    633633        $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
    634634                _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
    635                 $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
     635                $(PYTHON_FOR_BUILD) $(srcdir)/setup.py --no-user-cfg $$quiet build
    636636
    637637
    638638# Build static library
    libainstall: @DEF_MAKE_RULE@ python-config 
    16731673# Install the dynamically loadable modules
    16741674# This goes into $(exec_prefix)
    16751675sharedinstall: sharedmods
    1676         $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
     1676        $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py --no-user-cfg install \
    16771677                --prefix=$(prefix) \
    16781678                --install-scripts=$(BINDIR) \
    16791679                --install-platlib=$(DESTSHARED) \
  • Modules/readline.c

    diff --git Modules/readline.c Modules/readline.c
    index 12d6cc7..c1932da 100644
     
    2828
    2929/* GNU readline definitions */
    3030#undef HAVE_CONFIG_H /* Else readline/chardefs.h includes strings.h */
    31 #include <readline/readline.h>
    32 #include <readline/history.h>
     31#include <editline/readline.h>
    3332
    3433#ifdef HAVE_RL_COMPLETION_MATCHES
    3534#define completion_matches(x, y) \
  • configure

    diff --git configure configure
    index 2d379fe..d88fe6d 100755
    if test "${enable_framework+set}" = set; then : 
    32223222                        ;;
    32233223                esac
    32243224
     3225                FRAMEWORKINSTALLAPPSPREFIX="/Applications/MacPorts"
     3226
    32253227                prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
    32263228
    32273229                # Add files for Mac specific code to the list of output
    $as_echo "$CC" >&6; } 
    74677469        then
    74687470            case "$UNIVERSAL_ARCHS" in
    74697471            32-bit)
    7470                UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
     7472               UNIVERSAL_ARCH_FLAGS="-arch arm64 -arch x86_64"
    74717473               LIPO_32BIT_FLAGS=""
    74727474               ARCH_RUN_32BIT=""
    74737475               ;;
    74747476            64-bit)
    7475                UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
     7477               UNIVERSAL_ARCH_FLAGS="-arch arm64 -arch x86_64"
    74767478               LIPO_32BIT_FLAGS=""
    74777479               ARCH_RUN_32BIT="true"
    74787480               ;;
    74797481            all)
    7480                UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
    7481                LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
     7482               UNIVERSAL_ARCH_FLAGS="-arch arm64 -arch x86_64"
     7483               LIPO_32BIT_FLAGS=""
    74827484               ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
    74837485               ;;
    74847486            universal2)
    $as_echo "$CC" >&6; } 
    74877489               ARCH_RUN_32BIT="true"
    74887490                ;;
    74897491            intel)
    7490                UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
    7491                LIPO_32BIT_FLAGS="-extract i386"
     7492               UNIVERSAL_ARCH_FLAGS="-arch arm64 -arch x86_64"
     7493               LIPO_32BIT_FLAGS=""
    74927494               ARCH_RUN_32BIT="/usr/bin/arch -i386"
    74937495               ;;
    74947496            intel-32)
    7495                UNIVERSAL_ARCH_FLAGS="-arch i386"
     7497               UNIVERSAL_ARCH_FLAGS="-arch arm64 -arch x86_64"
    74967498               LIPO_32BIT_FLAGS=""
    74977499               ARCH_RUN_32BIT=""
    74987500               ;;
    74997501            intel-64)
    7500                UNIVERSAL_ARCH_FLAGS="-arch x86_64"
     7502               UNIVERSAL_ARCH_FLAGS="-arch arm64 -arch x86_64"
    75017503               LIPO_32BIT_FLAGS=""
    75027504               ARCH_RUN_32BIT="true"
    75037505               ;;
    75047506            3-way)
    7505                UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
    7506                LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
     7507               UNIVERSAL_ARCH_FLAGS="-arch arm64 -arch x86_64"
     7508               LIPO_32BIT_FLAGS=""
    75077509               ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
    75087510               ;;
    75097511            *)
    else 
    1107211074      main() {
    1107311075        pthread_attr_t attr;
    1107411076        pthread_t id;
    11075         if (pthread_attr_init(&attr)) exit(-1);
    11076         if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1);
    11077         if (pthread_create(&id, &attr, foo, NULL)) exit(-1);
    11078         exit(0);
     11077        if (pthread_attr_init(&attr)) return (-1);
     11078        if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) return (-1);
     11079        if (pthread_create(&id, &attr, foo, NULL)) return (-1);
     11080        return (0);
    1107911081      }
    1108011082_ACEOF
    1108111083if ac_fn_c_try_run "$LINENO"; then :
    else 
    1508315085  int main()
    1508415086  {
    1508515087        /* Success: exit code 0 */
    15086         exit((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
     15088        return ((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
    1508715089  }
    1508815090
    1508915091_ACEOF
    else 
    1546415466
    1546515467int main()
    1546615468{
    15467         exit(((-1)>>3 == -1) ? 0 : 1);
     15469        return (((-1)>>3 == -1) ? 0 : 1);
    1546815470}
    1546915471
    1547015472_ACEOF
    py_cv_lib_readline=no 
    1554115543$as_echo_n "checking how to link readline libs... " >&6; }
    1554215544for py_libtermcap in "" tinfo ncursesw ncurses curses termcap; do
    1554315545  if test -z "$py_libtermcap"; then
    15544     READLINE_LIBS="-lreadline"
     15546    READLINE_LIBS="-ledit"
    1554515547  else
    15546     READLINE_LIBS="-lreadline -l$py_libtermcap"
     15548    READLINE_LIBS="-ledit -l$py_libtermcap"
    1554715549  fi
    1554815550  LIBS="$READLINE_LIBS $LIBS_no_readline"
    1554915551  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    fi 
    1558915591# check for readline 2.2
    1559015592cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1559115593/* end confdefs.h.  */
    15592 #include <readline/readline.h>
     15594#include <editline/readline.h>
    1559315595_ACEOF
    1559415596if ac_fn_c_try_cpp "$LINENO"; then :
    1559515597  have_readline=yes
    if test $have_readline = yes 
    1560215604then
    1560315605  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1560415606/* end confdefs.h.  */
    15605 #include <readline/readline.h>
     15607#include <editline/readline.h>
    1560615608
    1560715609_ACEOF
    1560815610if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
    rm -f conftest* 
    1561515617
    1561615618  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1561715619/* end confdefs.h.  */
    15618 #include <readline/readline.h>
     15620#include <editline/readline.h>
    1561915621
    1562015622_ACEOF
    1562115623if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
    rm -f conftest* 
    1562915631fi
    1563015632
    1563115633# check for readline 4.0
    15632 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -lreadline" >&5
    15633 $as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; }
     15634{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -ledit" >&5
     15635$as_echo_n "checking for rl_pre_input_hook in -ledit... " >&6; }
    1563415636if ${ac_cv_lib_readline_rl_pre_input_hook+:} false; then :
    1563515637  $as_echo_n "(cached) " >&6
    1563615638else
    1563715639  ac_check_lib_save_LIBS=$LIBS
    15638 LIBS="-lreadline $READLINE_LIBS $LIBS"
     15640LIBS="-ledit $READLINE_LIBS $LIBS"
    1563915641cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1564015642/* end confdefs.h.  */
    1564115643
    fi 
    1567315675
    1567415676
    1567515677# also in 4.0
    15676 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -lreadline" >&5
    15677 $as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... " >&6; }
     15678{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -ledit" >&5
     15679$as_echo_n "checking for rl_completion_display_matches_hook in -ledit... " >&6; }
    1567815680if ${ac_cv_lib_readline_rl_completion_display_matches_hook+:} false; then :
    1567915681  $as_echo_n "(cached) " >&6
    1568015682else
    1568115683  ac_check_lib_save_LIBS=$LIBS
    15682 LIBS="-lreadline $READLINE_LIBS $LIBS"
     15684LIBS="-ledit $READLINE_LIBS $LIBS"
    1568315685cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1568415686/* end confdefs.h.  */
    1568515687
    fi 
    1571715719
    1571815720
    1571915721# also in 4.0, but not in editline
    15720 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_resize_terminal in -lreadline" >&5
    15721 $as_echo_n "checking for rl_resize_terminal in -lreadline... " >&6; }
     15722{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_resize_terminal in -ledit" >&5
     15723$as_echo_n "checking for rl_resize_terminal in -ledit... " >&6; }
    1572215724if ${ac_cv_lib_readline_rl_resize_terminal+:} false; then :
    1572315725  $as_echo_n "(cached) " >&6
    1572415726else
    1572515727  ac_check_lib_save_LIBS=$LIBS
    15726 LIBS="-lreadline $READLINE_LIBS $LIBS"
     15728LIBS="-ledit $READLINE_LIBS $LIBS"
    1572715729cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1572815730/* end confdefs.h.  */
    1572915731
    fi 
    1576115763
    1576215764
    1576315765# check for readline 4.2
    15764 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -lreadline" >&5
    15765 $as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; }
     15766{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -ledit" >&5
     15767$as_echo_n "checking for rl_completion_matches in -ledit... " >&6; }
    1576615768if ${ac_cv_lib_readline_rl_completion_matches+:} false; then :
    1576715769  $as_echo_n "(cached) " >&6
    1576815770else
    1576915771  ac_check_lib_save_LIBS=$LIBS
    15770 LIBS="-lreadline $READLINE_LIBS $LIBS"
     15772LIBS="-ledit $READLINE_LIBS $LIBS"
    1577115773cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1577215774/* end confdefs.h.  */
    1577315775
    fi 
    1580715809# also in readline 4.2
    1580815810cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1580915811/* end confdefs.h.  */
    15810 #include <readline/readline.h>
     15812#include <editline/readline.h>
    1581115813_ACEOF
    1581215814if ac_fn_c_try_cpp "$LINENO"; then :
    1581315815  have_readline=yes
    if test $have_readline = yes 
    1582015822then
    1582115823  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1582215824/* end confdefs.h.  */
    15823 #include <readline/readline.h>
     15825#include <editline/readline.h>
    1582415826
    1582515827_ACEOF
    1582615828if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
    rm -f conftest* 
    1583315835
    1583415836fi
    1583515837
    15836 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for append_history in -lreadline" >&5
    15837 $as_echo_n "checking for append_history in -lreadline... " >&6; }
     15838{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for append_history in -ledit" >&5
     15839$as_echo_n "checking for append_history in -ledit... " >&6; }
    1583815840if ${ac_cv_lib_readline_append_history+:} false; then :
    1583915841  $as_echo_n "(cached) " >&6
    1584015842else
    1584115843  ac_check_lib_save_LIBS=$LIBS
    15842 LIBS="-lreadline $READLINE_LIBS $LIBS"
     15844LIBS="-ledit $READLINE_LIBS $LIBS"
    1584315845cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1584415846/* end confdefs.h.  */
    1584515847
    else 
    1593415936/* end confdefs.h.  */
    1593515937
    1593615938#include <poll.h>
     15939#include <unistd.h>
    1593715940
    1593815941int main()
    1593915942{
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
    1706317066    volatile int val = 1;
    1706417067    int main() {
    1706517068      __atomic_load_n(&val, __ATOMIC_SEQ_CST);
     17069
     17070      /* https://bugs.python.org/issue24844 */
     17071      #define VERSION_CHECK(cc_major, cc_minor, req_major, req_minor) \
     17072          ((cc_major) > (req_major) || \
     17073          (cc_major) == (req_major) && (cc_minor) >= (req_minor))
     17074      #if defined(__clang__)
     17075          #if defined(__apple_build_version__)
     17076              // either one test or the other should work
     17077              // #if __apple_build_version__ < 5000000
     17078              #if !VERSION_CHECK(__clang_major__, __clang_minor__, 5, 0)
     17079                  #error
     17080              #endif
     17081          // not sure if this is 3.3 or 3.4
     17082          #elif !VERSION_CHECK(__clang_major__, __clang_minor__, 3, 3)
     17083              #error
     17084          #endif
     17085      #endif
     17086
    1706617087      return 0;
    1706717088    }
    1706817089
  • setup.py

    diff --git setup.py setup.py
    index bd5f736..3bee673 100644
    from distutils.spawn import find_executable 
    4444TEST_EXTENSIONS = True
    4545
    4646# This global variable is used to hold the list of modules to be disabled.
    47 DISABLED_MODULE_LIST = []
     47DISABLED_MODULE_LIST = ['_tkinter', '_gdbm']
    4848
    4949
    5050def get_platform():
    class PyBuildExt(build_ext): 
    728728        # Ensure that /usr/local is always used, but the local build
    729729        # directories (i.e. '.' and 'Include') must be first.  See issue
    730730        # 10520.
    731         if not CROSS_COMPILING:
    732             add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
    733             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
    734731        # only change this for cross builds for 3.3, issues on Mageia
    735732        if CROSS_COMPILING:
    736733            self.add_cross_compiling_paths()
    class PyBuildExt(build_ext): 
    963960
    964961    def detect_readline_curses(self):
    965962        # readline
    966         do_readline = self.compiler.find_library_file(self.lib_dirs, 'readline')
     963        do_readline = self.compiler.find_library_file(self.lib_dirs, 'edit')
    967964        readline_termcap_library = ""
    968965        curses_library = ""
    969966        # Cannot use os.popen here in py3k.
    class PyBuildExt(build_ext): 
    10331030            else:
    10341031                readline_extra_link_args = ()
    10351032
    1036             readline_libs = ['readline']
     1033            readline_libs = ['edit']
    10371034            if readline_termcap_library:
    10381035                pass # Issue 7384: Already linked against curses or tinfo.
    10391036            elif curses_library:
    class PyBuildExt(build_ext): 
    19811978        # Rather than complicate the code below, detecting and building
    19821979        # AquaTk is a separate method. Only one Tkinter will be built on
    19831980        # Darwin - either AquaTk, if it is found, or X11 based Tk.
    1984         if (MACOS and self.detect_tkinter_darwin()):
    1985             return True
     1981        self.announce("INFO: Not using Tcl/Tk", 2)
     1982        return False
    19861983
    19871984        # Assume we haven't found any of the libraries or include files
    19881985        # The versions with dots are used on Unix, and the versions without