Ticket #46937: python35-port.diff
File python35-port.diff, 21.2 KB (added by Themanwithoutaplan, 10 years ago) |
---|
-
dports/lang/python35/Portfile
1 # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 2 # $Id$ 3 4 PortSystem 1.0 5 PortGroup select 1.0 6 7 name python35 8 9 # Remember to keep py35-tkinter and py35-gdbm's versions sync'd with this 10 version 3.5.0a1 11 revision 0 12 13 epoch 20141008 14 15 set major [lindex [split $version .] 0] 16 set branch [join [lrange [split $version .] 0 1] .] 17 set minor [string index [lindex [split $version .] 2] 0] 18 categories lang 19 license PSF 20 platforms darwin 21 maintainers jwa openmaintainer 22 23 description An interpreted, object-oriented programming language 24 long_description Python is an interpreted, interactive, object-oriented \ 25 programming language. 26 27 homepage http://www.python.org/ 28 master_sites ${homepage}ftp/python/${major}\.{branch}\.{minor}/ 29 30 distname Python-${version} 31 32 use_xz yes 33 34 checksums rmd160 29495a3100621030996dd10053a6d4d3ee839af8 \ 35 sha256 3639cce7e4f01926a2463fe0b6cce00690f899bee16a78aa222c5202d48538b5 36 37 patchfiles patch-setup.py.diff \ 38 patch-Lib-cgi.py.diff \ 39 patch-configure.diff \ 40 patch-setup.py-disabled_modules.diff \ 41 patch-libedit.diff \ 42 omit-local-site-packages.patch 43 44 depends_lib port:zlib port:openssl \ 45 port:sqlite3 port:ncurses \ 46 port:bzip2 port:libedit port:gettext \ 47 port:xz 48 depends_run port:python_select 49 50 # blacklist llvm-gcc-4.2 compiler known to produce bad code 51 compiler.blacklist *llvm-gcc-4.2 52 53 # ensurepip arg may be removed later, now conflicts with pip and setuptools 54 # packages 55 configure.args --enable-framework=${frameworks_dir} \ 56 --enable-ipv6 \ 57 --with-computed-gotos \ 58 --with-ensurepip=no 59 60 configure.ccache no 61 62 use_parallel_build yes 63 64 post-patch { 65 reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/Lib/cgi.py 66 67 reinplace "s|/setup.py|/setup.py --no-user-cfg|" ${worksrcpath}/Makefile.pre.in 68 69 # replace /Applications with ${applications_dir} 70 reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" \ 71 ${worksrcpath}/configure 72 73 # See http://trac.macports.org/changeset/37861 74 reinplace "s|xargs -0 rm -r|/usr/bin/xargs -0 /bin/rm -r|g" \ 75 ${worksrcpath}/Mac/PythonLauncher/Makefile.in 76 } 77 78 build.target all 79 80 # test_cmd_line fails 81 # see http://bugs.python.org/issue4388 and 82 # http://bugs.python.org/issue4474 83 test.run yes 84 test.target test 85 86 destroot.target frameworkinstall maninstall 87 88 # ensure that correct compiler is used 89 build.args-append MAKE="${build.cmd} CC=${configure.cc}" 90 destroot.args-append MAKE="${destroot.cmd} CC=${configure.cc}" 91 92 select.group python 93 select.file ${filespath}/python[string map {. {}} ${branch}] 94 set confdir config-${branch}m 95 96 notes " 97 To make python ${branch} the default (i.e. the version you get when you run\ 98 'python'), please run: 99 100 sudo port select --set ${select.group} [file tail ${select.file}] 101 " 102 103 post-destroot { 104 set framewpath ${frameworks_dir}/Python.framework 105 set framewdir ${framewpath}/Versions/${branch} 106 107 foreach dir { Headers Resources Python Versions/Current } { 108 file delete ${destroot}${framewpath}/${dir} 109 } 110 111 ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/ 112 113 # Without this, LINKFORSHARED is set to 114 # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) 115 # (this becomes Python.framework/Versions/3.2/Python) which doesn't 116 # quite work (see ticket #15099); instead specifically list the 117 # full path to the proper Python framework file (which becomes 118 # ${prefix}/Library/Frameworks/Python.framework/Versions/3.2/Python) 119 reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${framewdir}/lib/python${branch}/$confdir/Makefile 120 121 # remove -arch flags from the config 122 reinplace -E {s|-arch [a-z0-9_]+||g} \ 123 ${destroot}${framewdir}/lib/python${branch}/$confdir/Makefile 124 foreach unversioned {2to3 idle3 pydoc3 python3 python3-config pyvenv} { 125 delete ${destroot}${prefix}/bin/${unversioned} 126 } 127 } 128 129 platform darwin { 130 post-configure { 131 # See http://trac.macports.org/ticket/18376 132 system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.ed" 133 } 134 } 135 136 variant universal { 137 post-patch { 138 set universal_arch_flags {} 139 set arch_run_32bit {} 140 foreach arch ${universal_archs} { 141 lappend universal_arch_flags -arch ${arch} 142 if {${arch} eq "i386" || ${arch} eq "ppc"} { 143 lappend arch_run_32bit -${arch} 144 } 145 } 146 reinplace \ 147 "s|UNIVERSAL_ARCH_FLAGS=\".*\"|UNIVERSAL_ARCH_FLAGS=\"${universal_arch_flags}\"|" \ 148 ${worksrcpath}/configure 149 if { ${arch_run_32bit} != "" } { 150 reinplace \ 151 "s|ARCH_RUN_32BIT=\".*\"|ARCH_RUN_32BIT=\"arch ${arch_run_32bit}\"|" \ 152 ${worksrcpath}/configure 153 } 154 } 155 if {${configure.sdkroot} != ""} { 156 configure.args-append --enable-universalsdk=${configure.sdkroot} 157 } else { 158 configure.args-append --enable-universalsdk=/ 159 } 160 post-configure { 161 system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.h-universal.ed" 162 } 163 } 164 165 livecheck.type regex 166 #livecheck.url ${homepage}download/releases/ 167 livecheck.url ${homepage}downloads/ 168 livecheck.regex Python (${branch}(?:\\.\\d+)*) -
dports/lang/python35/files/omit-local-site-packages.patch
Eigenschaftsänderungen: dports/lang/python35/Portfile ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property
1 Index: Lib/site.py 2 =================================================================== 3 --- Lib/site.py.orig 4 +++ Lib/site.py 5 @@ -311,15 +311,6 @@ def getsitepackages(prefixes=None): 6 else: 7 sitepackages.append(prefix) 8 sitepackages.append(os.path.join(prefix, "lib", "site-packages")) 9 - if sys.platform == "darwin": 10 - # for framework builds *only* we add the standard Apple 11 - # locations. 12 - from sysconfig import get_config_var 13 - framework = get_config_var("PYTHONFRAMEWORK") 14 - if framework: 15 - sitepackages.append( 16 - os.path.join("/Library", framework, 17 - sys.version[:3], "site-packages")) 18 return sitepackages 19 20 def addsitepackages(known_paths, prefixes=None): -
dports/lang/python35/files/patch-Lib-cgi.py.diff
1 --- Lib/cgi.py.orig 2006-08-10 19:41:07.000000000 +0200 2 +++ Lib/cgi.py 2007-08-21 15:36:54.000000000 +0200 3 @@ -1,13 +1,6 @@ 4 -#! /usr/local/bin/python 5 +#! @@PREFIX@@/bin/python3.2 6 7 -# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is 8 -# intentionally NOT "/usr/bin/env python". On many systems 9 -# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI 10 -# scripts, and /usr/local/bin is the default directory where Python is 11 -# installed, so /usr/bin/env would be unable to find python. Granted, 12 -# binary installations by Linux vendors often install Python in 13 -# /usr/bin. So let those vendors patch cgi.py to match their choice 14 -# of installation. 15 +# NOTE: /usr/local/bin/python patched for MacPorts installation 16 17 """Support module for CGI (Common Gateway Interface) scripts. 18 -
dports/lang/python35/files/patch-configure.diff
1 --- configure.orig 2012-08-13 17:08:58.000000000 +0300 2 +++ configure 2012-08-13 17:11:07.000000000 +0300 3 @@ -3145,6 +3145,8 @@ 4 ;; 5 esac 6 7 + FRAMEWORKINSTALLAPPSPREFIX="@@APPLICATIONS_DIR@@" 8 + 9 prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION 10 11 # Add files for Mac specific code to the list of output -
dports/lang/python35/files/patch-libedit.diff
1 --- configure.orig 2013-10-23 21:50:49.000000000 +0300 2 +++ configure 2013-10-23 22:03:14.000000000 +0300 3 @@ -13882,9 +13882,9 @@ 4 $as_echo_n "checking how to link readline libs... " >&6; } 5 for py_libtermcap in "" tinfo 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 @@ -13928,13 +13928,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 @@ -13974,7 +13974,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 @@ -13987,7 +13987,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 @@ -14000,7 +14000,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 @@ -14014,13 +14014,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 @@ -14058,13 +14058,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 @@ -14102,13 +14102,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 @@ -14148,7 +14148,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 @@ -14161,7 +14161,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 2013-10-23 21:50:56.000000000 +0300 129 +++ setup.py 2013-10-23 22:06:11.000000000 +0300 130 @@ -646,7 +646,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 # Cannot use os.popen here in py3k. 139 @@ -710,7 +710,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 2013-10-23 21:51:09.000000000 +0300 149 +++ Modules/readline.c 2013-10-23 22:10:09.000000000 +0300 150 @@ -29,8 +29,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) \ -
dports/lang/python35/files/patch-setup.py-disabled_modules.diff
1 --- setup.py.orig 2011-07-09 16:58:56.000000000 +1000 2 +++ setup.py 2011-07-13 20:50:12.000000000 +1000 3 @@ -21,7 +21,7 @@ 4 COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') 5 6 # This global variable is used to hold the list of modules to be disabled. 7 -disabled_module_list = [] 8 +disabled_module_list = ["_tkinter", "_gdbm"] 9 10 # File which contains the directory for shared mods (for sys.path fixup 11 # when running from the build dir, see Modules/getpath.c) -
dports/lang/python35/files/patch-setup.py.diff
1 --- setup.py.orig 2012-08-13 17:01:43.000000000 +0300 2 +++ setup.py 2012-08-13 17:06:17.000000000 +0300 3 @@ -1576,7 +1576,7 @@ 4 # For 8.4a2, the X11 headers are not included. Rather than include a 5 # complicated search, this is a hard-coded path. It could bail out 6 # if X11 libs are not found... 7 - include_dirs.append('/usr/X11R6/include') 8 + #include_dirs.append('/usr/X11R6/include') 9 frameworks = ['-framework', 'Tcl', '-framework', 'Tk'] 10 11 # All existing framework builds of Tcl/Tk don't support 64-bit 12 @@ -1621,13 +1621,6 @@ 13 def detect_tkinter(self, inc_dirs, lib_dirs): 14 # The _tkinter module. 15 16 - # Rather than complicate the code below, detecting and building 17 - # AquaTk is a separate method. Only one Tkinter will be built on 18 - # Darwin - either AquaTk, if it is found, or X11 based Tk. 19 - if (host_platform == 'darwin' and 20 - self.detect_tkinter_darwin(inc_dirs, lib_dirs)): 21 - return 22 - 23 # Assume we haven't found any of the libraries or include files 24 # The versions with dots are used on Unix, and the versions without 25 # dots on Windows, for detection by cygwin. 26 @@ -1676,17 +1669,17 @@ 27 if host_platform == 'sunos5': 28 include_dirs.append('/usr/openwin/include') 29 added_lib_dirs.append('/usr/openwin/lib') 30 - elif os.path.exists('/usr/X11R6/include'): 31 - include_dirs.append('/usr/X11R6/include') 32 - added_lib_dirs.append('/usr/X11R6/lib64') 33 - added_lib_dirs.append('/usr/X11R6/lib') 34 - elif os.path.exists('/usr/X11R5/include'): 35 - include_dirs.append('/usr/X11R5/include') 36 - added_lib_dirs.append('/usr/X11R5/lib') 37 - else: 38 + #elif os.path.exists('/usr/X11R6/include'): 39 + # include_dirs.append('/usr/X11R6/include') 40 + # added_lib_dirs.append('/usr/X11R6/lib64') 41 + # added_lib_dirs.append('/usr/X11R6/lib') 42 + #elif os.path.exists('/usr/X11R5/include'): 43 + # include_dirs.append('/usr/X11R5/include') 44 + # added_lib_dirs.append('/usr/X11R5/lib') 45 + #else: 46 # Assume default location for X11 47 - include_dirs.append('/usr/X11/include') 48 - added_lib_dirs.append('/usr/X11/lib') 49 + # include_dirs.append('/usr/X11/include') 50 + # added_lib_dirs.append('/usr/X11/lib') 51 52 # If Cygwin, then verify that X is installed before proceeding 53 if host_platform == 'cygwin': -
dports/lang/python35/files/pyconfig.ed
1 g,.*\(HAVE_POLL[_A-Z]*\).*,s,,/* #undef \1 */, 2 w -
dports/lang/python35/files/pyconfig.h-universal.ed
1 /DOUBLE_IS_BIG_ENDIAN_IEEE754/c 2 #ifdef __BIG_ENDIAN__ 3 #define DOUBLE_IS_BIG_ENDIAN_IEEE754 1 4 #else 5 /* #undef DOUBLE_IS_BIG_ENDIAN_IEEE754 */ 6 #endif 7 . 8 /DOUBLE_IS_LITTLE_ENDIAN_IEEE754/c 9 #ifdef __LITTLE_ENDIAN__ 10 #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1 11 #else 12 /* #undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754 */ 13 #endif 14 . 15 /HAVE_LARGEFILE_SUPPORT/c 16 #ifdef __LP64__ 17 /* #undef HAVE_LARGEFILE_SUPPORT */ 18 #else 19 #define HAVE_LARGEFILE_SUPPORT 1 20 #endif 21 . 22 /SIZEOF_LONG/c 23 #ifdef __LP64__ 24 #define SIZEOF_LONG 8 25 #else 26 #define SIZEOF_LONG 4 27 #endif 28 . 29 /SIZEOF_PTHREAD_T/c 30 #ifdef __LP64__ 31 #define SIZEOF_PTHREAD_T 8 32 #else 33 #define SIZEOF_PTHREAD_T 4 34 #endif 35 . 36 /SIZEOF_SIZE_T/c 37 #ifdef __LP64__ 38 #define SIZEOF_SIZE_T 8 39 #else 40 #define SIZEOF_SIZE_T 4 41 #endif 42 . 43 /SIZEOF_TIME_T/c 44 #ifdef __LP64__ 45 #define SIZEOF_TIME_T 8 46 #else 47 #define SIZEOF_TIME_T 4 48 #endif 49 . 50 /SIZEOF_UINTPTR_T/c 51 #ifdef __LP64__ 52 #define SIZEOF_UINTPTR_T 8 53 #else 54 #define SIZEOF_UINTPTR_T 4 55 #endif 56 . 57 /SIZEOF_VOID_P/c 58 #ifdef __LP64__ 59 #define SIZEOF_VOID_P 8 60 #else 61 #define SIZEOF_VOID_P 4 62 #endif 63 . 64 /SIZEOF__BOOL/c 65 #if defined(__LP64__) || !defined(__POWERPC__) 66 #define SIZEOF__BOOL 1 67 #else 68 #define SIZEOF__BOOL 4 69 #endif 70 . 71 /VA_LIST_IS_ARRAY/c 72 #ifdef __LP64__ 73 #define VA_LIST_IS_ARRAY 1 74 #else 75 /* #undef VA_LIST_IS_ARRAY */ 76 #endif 77 . 78 w -
dports/lang/python35/files/python35
1 bin/python3.5 2 - 3 bin/python3.5-config 4 bin/idle3.5 5 bin/pydoc3.5 6 - 7 bin/2to3-3.5 8 share/man/man1/python3.5.0 9 - 10 ${frameworks_dir}/Python.framework/Versions/3.5 11 ${frameworks_dir}/Python.framework/Versions/3.5/Headers 12 ${frameworks_dir}/Python.framework/Versions/3.5/Resources 13 ${frameworks_dir}/Python.framework/Versions/3.5/Python