[packages/python] level up python to version 2.7.3rc2 - thanks to Cybjit (ticket...
[openwrt/svn-archive/archive.git] / lang / python / patch
1 diff --git a/lang/python/Makefile b/lang/python/Makefile
2 index 95e036e..2a541d0 100644
3 --- a/lang/python/Makefile
4 +++ b/lang/python/Makefile
5 @@ -8,12 +8,12 @@
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=python
9 -PKG_VERSION:=2.6.4
10 -PKG_RELEASE:=4
11 +PKG_VERSION:=2.7.3rc2
12 +PKG_RELEASE:=1
13
14 PKG_SOURCE:=Python-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.python.org/ftp/python/$(PKG_VERSION)/
16 -PKG_MD5SUM:=fee5408634a54e721a93531aba37f8c1
17 +PKG_MD5SUM:=67059e1bcaf19e19394d16b80637f75f
18
19 PKG_INSTALL:=1
20 PKG_BUILD_PARALLEL:=1
21 @@ -105,10 +105,11 @@ $(call Package/python/Default)
22 DEPENDS+=+python-mini
23 endef
24
25 +# Needs datetime
26 define Package/python-sqlite3
27 $(call Package/python/Default)
28 TITLE:=Python support for sqlite3
29 - DEPENDS+=+python-mini +libsqlite3
30 + DEPENDS+=+python +libsqlite3
31 endef
32
33 define Package/python-gdbm
34 @@ -117,39 +118,41 @@ $(call Package/python/Default)
35 DEPENDS+=+python-mini +libgdbm
36 endef
37
38 -PY_DISABLED_MODULES:= \
39 - readline _curses _curses_panel _tkinter nis
40 -
41 MAKE_FLAGS:=\
42 $(TARGET_CONFIGURE_OPTS) \
43 - PYTHON_DISABLE_MODULES="$(PY_DISABLED_MODULES)" \
44 - PYTHON_MODULES_INCLUDE="$(STAGING_DIR)/usr/include" \
45 - PYTHON_MODULES_LIB="$(STAGING_DIR)/usr/lib" \
46 DESTDIR="$(PKG_INSTALL_DIR)" \
47 CROSS_COMPILE=yes \
48 - CFLAGS="$(TARGET_CFLAGS) -fno-inline" \
49 + CFLAGS="$(TARGET_CFLAGS) -DNDEBUG -fno-inline" \
50 LDFLAGS="$(TARGET_LDFLAGS)" \
51 LD="$(TARGET_CC)" \
52 HOSTPYTHON=./hostpython \
53 HOSTPGEN=./hostpgen
54
55 +ENABLE_IPV6:=
56 +ifeq ($(CONFIG_IPV6),y)
57 + ENABLE_IPV6 += --enable-ipv6
58 +endif
59 +
60 define Build/Configure
61 -$(MAKE) -C $(PKG_BUILD_DIR) distclean
62 (cd $(PKG_BUILD_DIR); autoreconf --force --install || exit 0)
63 # The python executable needs to stay in the rootdir since its location will
64 # be used to compute the path of the config files.
65 $(CP) $(STAGING_DIR_HOST)/bin/pgen $(PKG_BUILD_DIR)/hostpgen
66 - $(CP) $(STAGING_DIR_HOST)/bin/python $(PKG_BUILD_DIR)/hostpython
67 + $(CP) $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION) $(PKG_BUILD_DIR)/hostpython
68 $(call Build/Configure/Default, \
69 --sysconfdir=/etc \
70 --disable-shared \
71 --without-cxx-main \
72 --with-threads \
73 - --with-system-ffi \
74 + --with-system-ffi="$(STAGING_DIR)/usr" \
75 + $(ENABLE_IPV6) \
76 ac_cv_lib_readline_readline=no \
77 ac_cv_have_chflags=no \
78 ac_cv_have_lchflags=no \
79 ac_cv_py_format_size_t=no \
80 + ac_cv_have_long_long_format=yes \
81 + ac_cv_buggy_getaddrinfo=no \
82 OPT="$(TARGET_CFLAGS)" \
83 )
84 endef
85 @@ -170,7 +173,7 @@ define Build/InstallDev
86 $(1)/usr/lib/python$(PYTHON_VERSION)/
87
88 $(CP) \
89 - $(STAGING_DIR_HOST)/bin/python \
90 + $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION) \
91 $(1)/usr/bin/hostpython
92 (cd $(2)/bin; \
93 ln -sf ../../usr/bin/hostpython python$(PYTHON_VERSION); \
94 @@ -189,7 +192,6 @@ define PyPackage/python/filespec
95 +|/usr/lib/python$(PYTHON_VERSION)
96 -|/usr/lib/python$(PYTHON_VERSION)/bsddb/test
97 -|/usr/lib/python$(PYTHON_VERSION)/config
98 -+|/usr/lib/python$(PYTHON_VERSION)/config/Makefile
99 -|/usr/lib/python$(PYTHON_VERSION)/ctypes/test
100 -|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst-*.exe
101 -|/usr/lib/python$(PYTHON_VERSION)/distutils/tests
102 @@ -206,7 +208,7 @@ define PyPackage/python/filespec
103 -|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sqlite3.so
104 -|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ssl.so
105 -|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/pyexpat.so
106 --|/usr/lib/python$(PYTHON_VERSION)/pydoc_topics.py
107 +-|/usr/lib/python$(PYTHON_VERSION)/pydoc_data
108 -|/usr/lib/python$(PYTHON_VERSION)/pydoc.py
109 -|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ctypes_test.so
110 -|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_testcapi.so
111 @@ -247,7 +249,6 @@ define PyPackage/python/filespec
112 -|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/syslog.so
113 -|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/time.so
114 -|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so
115 --|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_weakref.so
116 -|/usr/lib/python$(PYTHON_VERSION)/linecache.py
117 -|/usr/lib/python$(PYTHON_VERSION)/md5.py
118 -|/usr/lib/python$(PYTHON_VERSION)/new.py
119 @@ -285,6 +286,17 @@ define PyPackage/python/filespec
120 -|/usr/lib/python$(PYTHON_VERSION)/UserDict.py
121 -|/usr/lib/python$(PYTHON_VERSION)/warnings.py
122 -|/usr/lib/python$(PYTHON_VERSION)/weakref.py
123 +-|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py
124 +-|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py
125 +-|/usr/lib/python$(PYTHON_VERSION)/functools.py
126 +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_functools.so
127 +-|/usr/lib/python$(PYTHON_VERSION)/collections.py
128 +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_collections.so
129 +-|/usr/lib/python$(PYTHON_VERSION)/keyword.py
130 +-|/usr/lib/python$(PYTHON_VERSION)/heapq.py
131 +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_heapq.so
132 +-|/usr/lib/python$(PYTHON_VERSION)/bisect.py
133 +-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bisect.so
134 endef
135
136 define PyPackage/python-mini/filespec
137 @@ -325,7 +337,6 @@ define PyPackage/python-mini/filespec
138 +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/syslog.so
139 +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/time.so
140 +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so
141 -+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_weakref.so
142 +|/usr/lib/python$(PYTHON_VERSION)/linecache.py
143 +|/usr/lib/python$(PYTHON_VERSION)/md5.py
144 +|/usr/lib/python$(PYTHON_VERSION)/new.py
145 @@ -363,6 +374,18 @@ define PyPackage/python-mini/filespec
146 +|/usr/lib/python$(PYTHON_VERSION)/UserDict.py
147 +|/usr/lib/python$(PYTHON_VERSION)/warnings.py
148 +|/usr/lib/python$(PYTHON_VERSION)/weakref.py
149 ++|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py
150 ++|/usr/lib/python$(PYTHON_VERSION)/config/Makefile
151 ++|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py
152 ++|/usr/lib/python$(PYTHON_VERSION)/functools.py
153 ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_functools.so
154 ++|/usr/lib/python$(PYTHON_VERSION)/collections.py
155 ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_collections.so
156 ++|/usr/lib/python$(PYTHON_VERSION)/keyword.py
157 ++|/usr/lib/python$(PYTHON_VERSION)/heapq.py
158 ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_heapq.so
159 ++|/usr/lib/python$(PYTHON_VERSION)/bisect.py
160 ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bisect.so
161 +|/usr/include/python$(PYTHON_VERSION)/pyconfig.h
162 endef
163
164 @@ -371,7 +394,7 @@ define PyPackage/python-mini/install
165 endef
166
167 define PyPackage/python-doc/filespec
168 -+|/usr/lib/python$(PYTHON_VERSION)/pydoc_topics.py
169 ++|/usr/lib/python$(PYTHON_VERSION)/pydoc_data
170 +|/usr/lib/python$(PYTHON_VERSION)/pydoc.py
171 endef
172
173 diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk
174 index 995e411..70e6300 100644
175 --- a/lang/python/files/python-package.mk
176 +++ b/lang/python/files/python-package.mk
177 @@ -5,7 +5,7 @@
178 # See /LICENSE for more information.
179 #
180
181 -PYTHON_VERSION=2.6
182 +PYTHON_VERSION=2.7
183
184 PYTHON_DIR:=$(STAGING_DIR)/usr
185 PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin
186 diff --git a/lang/python/patches/000-cross-compile.patch b/lang/python/patches/000-cross-compile.patch
187 index efbe070..a6f208e 100644
188 --- a/lang/python/patches/000-cross-compile.patch
189 +++ b/lang/python/patches/000-cross-compile.patch
190 @@ -4,7 +4,7 @@
191
192 --- a/Makefile.pre.in
193 +++ b/Makefile.pre.in
194 -@@ -175,6 +175,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
195 +@@ -182,6 +182,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
196
197 PYTHON= python$(EXE)
198 BUILDPYTHON= python$(BUILDEXE)
199 @@ -12,16 +12,15 @@
200
201 # The task to run while instrument when building the profile-opt target
202 PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
203 -@@ -205,7 +206,7 @@ GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
204 +@@ -214,6 +215,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
205 ##########################################################################
206 # Parser
207 PGEN= Parser/pgen$(EXE)
208 --
209 +HOSTPGEN= $(PGEN)$(EXE)
210 +
211 POBJS= \
212 Parser/acceler.o \
213 - Parser/grammar1.o \
214 -@@ -370,7 +371,7 @@ build_all_generate_profile:
215 +@@ -384,7 +386,7 @@ build_all_generate_profile:
216 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
217
218 run_profile_task:
219 @@ -30,12 +29,12 @@
220
221 build_all_use_profile:
222 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
223 -@@ -388,14 +389,14 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA
224 +@@ -402,14 +404,14 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA
225 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
226
227 platform: $(BUILDPYTHON)
228 -- $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
229 -+ $(RUNSHARED) $(HOSTPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
230 +- $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
231 ++ $(RUNSHARED) $(HOSTPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
232
233
234 # Build the shared modules
235 @@ -48,34 +47,34 @@
236 esac
237
238 # Build static library
239 -@@ -517,7 +518,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
240 -
241 - $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
242 +@@ -543,7 +545,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
243 + $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
244 + Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
245 -@$(INSTALL) -d Include
246 -- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
247 -+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
248 +- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
249 ++ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
250 + -touch Parser/pgen.stamp
251
252 $(PGEN): $(PGENOBJS)
253 - $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
254 -@@ -676,7 +677,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
255 +@@ -708,7 +710,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
256
257 TESTOPTS= -l $(EXTRATESTOPTS)
258 TESTPROG= $(srcdir)/Lib/test/regrtest.py
259 --TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
260 -+TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) -E -tt
261 +-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
262 ++TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
263 test: all platform
264 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
265 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
266 -@@ -1001,7 +1002,7 @@ libainstall: all
267 +@@ -1062,7 +1064,7 @@ libainstall: all python-config
268 # Install the dynamically loadable modules
269 # This goes into $(exec_prefix)
270 - sharedinstall:
271 + sharedinstall: sharedmods
272 - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
273 + $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
274 --prefix=$(prefix) \
275 --install-scripts=$(BINDIR) \
276 --install-platlib=$(DESTSHARED) \
277 -@@ -1039,7 +1040,7 @@ frameworkinstallstructure: $(LDLIBRARY)
278 +@@ -1100,7 +1102,7 @@ frameworkinstallstructure: $(LDLIBRARY)
279 fi; \
280 done
281 $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
282 @@ -84,7 +83,7 @@
283 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
284 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
285 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
286 -@@ -1081,7 +1082,7 @@ frameworkinstallextras:
287 +@@ -1135,7 +1137,7 @@ frameworkinstallextras:
288 # This installs a few of the useful scripts in Tools/scripts
289 scriptsinstall:
290 SRCDIR=$(srcdir) $(RUNSHARED) \
291 @@ -92,8 +91,8 @@
292 + $(HOSTPYTHON) $(srcdir)/Tools/scripts/setup.py install \
293 --prefix=$(prefix) \
294 --install-scripts=$(BINDIR) \
295 - --root=/$(DESTDIR)
296 -@@ -1103,7 +1104,7 @@ config.status: $(srcdir)/configure
297 + --root=$(DESTDIR)/
298 +@@ -1157,7 +1159,7 @@ config.status: $(srcdir)/configure
299
300 # Run reindent on the library
301 reindent:
302 @@ -102,7 +101,7 @@
303
304 # Rerun configure with the same options as it was run last time,
305 # provided the config.status script exists
306 -@@ -1200,7 +1201,7 @@ funny:
307 +@@ -1260,7 +1262,7 @@ funny:
308
309 # Perform some verification checks on any modified files.
310 patchcheck:
311 diff --git a/lang/python/patches/010-cannot-run-test-programm.patch b/lang/python/patches/010-cannot-run-test-programm.patch
312 deleted file mode 100644
313 index c981b46..0000000
314 --- a/lang/python/patches/010-cannot-run-test-programm.patch
315 +++ /dev/null
316 @@ -1,89 +0,0 @@
317 ----
318 - configure.in | 46 ++++++++++++++++++++++++++++++++++------------
319 - 1 file changed, 34 insertions(+), 12 deletions(-)
320 -
321 ---- a/configure.in
322 -+++ b/configure.in
323 -@@ -2653,6 +2653,7 @@ AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_
324 - # On Tru64, chflags seems to be present, but calling it will
325 - # exit Python
326 - AC_MSG_CHECKING(for chflags)
327 -+AC_CACHE_VAL(ac_cv_have_chflags, [
328 - AC_TRY_RUN([
329 - #include <sys/stat.h>
330 - #include <unistd.h>
331 -@@ -2662,12 +2663,19 @@ int main(int argc, char*argv[])
332 - return 1;
333 - return 0;
334 - }
335 --],AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
336 -- AC_MSG_RESULT(yes),
337 -- AC_MSG_RESULT(no)
338 --)
339 -+],
340 -+ac_cv_have_chflags=yes,
341 -+ac_cv_have_chflags=no,
342 -+ac_cv_have_chflags=no)])
343 -+AC_MSG_RESULT($ac_cv_have_chflags)
344 -+if test "$ac_cv_have_chflags" = yes
345 -+then
346 -+ AC_DEFINE(HAVE_CHFLAGS, 1,
347 -+ [Define to 1 if you have the `chflags' function.])
348 -+fi
349 -
350 - AC_MSG_CHECKING(for lchflags)
351 -+AC_CACHE_VAL(ac_cv_have_lchflags, [
352 - AC_TRY_RUN([
353 - #include <sys/stat.h>
354 - #include <unistd.h>
355 -@@ -2677,10 +2685,16 @@ int main(int argc, char*argv[])
356 - return 1;
357 - return 0;
358 - }
359 --],AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
360 -- AC_MSG_RESULT(yes),
361 -- AC_MSG_RESULT(no)
362 --)
363 -+],
364 -+ac_cv_have_lchflags=yes,
365 -+ac_cv_have_lchflags=no,
366 -+ac_cv_have_lchflags=no)])
367 -+AC_MSG_RESULT($ac_cv_have_lchflags)
368 -+if test "$ac_cv_have_lchflags" = yes
369 -+then
370 -+ AC_DEFINE(HAVE_CHFLAGS, 1,
371 -+ [Define to 1 if you have the `lchflags' function.])
372 -+fi
373 -
374 - dnl Check if system zlib has *Copy() functions
375 - dnl
376 -@@ -3781,6 +3795,7 @@ else
377 - fi
378 -
379 - AC_MSG_CHECKING(for %zd printf() format support)
380 -+AC_CACHE_VAL(ac_cv_py_format_size_t, [
381 - AC_TRY_RUN([#include <stdio.h>
382 - #include <stddef.h>
383 - #include <string.h>
384 -@@ -3814,10 +3829,17 @@ int main()
385 - return 1;
386 -
387 - return 0;
388 --}],
389 --[AC_MSG_RESULT(yes)
390 -- AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
391 -- AC_MSG_RESULT(no))
392 -+}
393 -+],
394 -+ac_cv_py_format_size_t=yes,
395 -+ac_cv_py_format_size_t=no,
396 -+ac_cv_py_format_size_t=no)])
397 -+AC_MSG_RESULT($ac_cv_py_format_size_t)
398 -+if test "$ac_cv_pyt_format_t" = yes
399 -+then
400 -+ AC_DEFINE(PY_FORMAT_SIZE_T, "z",
401 -+ [Define to printf format modifier for Py_ssize_t])
402 -+fi
403 -
404 - AC_CHECK_TYPE(socklen_t,,
405 - AC_DEFINE(socklen_t,int,
406 diff --git a/lang/python/patches/011-linux-3.x-compat.patch b/lang/python/patches/011-linux-3.x-compat.patch
407 deleted file mode 100644
408 index 088618d..0000000
409 --- a/lang/python/patches/011-linux-3.x-compat.patch
410 +++ /dev/null
411 @@ -1,20 +0,0 @@
412 ---- a/configure
413 -+++ b/configure
414 -@@ -2070,6 +2070,7 @@ then
415 - MACHDEP="$ac_md_system$ac_md_release"
416 -
417 - case $MACHDEP in
418 -+ linux3) MACHDEP="linux2";;
419 - cygwin*) MACHDEP="cygwin";;
420 - darwin*) MACHDEP="darwin";;
421 - atheos*) MACHDEP="atheos";;
422 ---- a/configure.in
423 -+++ b/configure.in
424 -@@ -240,6 +240,7 @@ then
425 - MACHDEP="$ac_md_system$ac_md_release"
426 -
427 - case $MACHDEP in
428 -+ linux3) MACHDEP="linux2";;
429 - cygwin*) MACHDEP="cygwin";;
430 - darwin*) MACHDEP="darwin";;
431 - atheos*) MACHDEP="atheos";;
432 diff --git a/lang/python/patches/020-dont-compile-python-files.patch b/lang/python/patches/020-dont-compile-python-files.patch
433 index d9c092b..57bd51d 100644
434 --- a/lang/python/patches/020-dont-compile-python-files.patch
435 +++ b/lang/python/patches/020-dont-compile-python-files.patch
436 @@ -4,18 +4,20 @@
437
438 --- a/Makefile.pre.in
439 +++ b/Makefile.pre.in
440 -@@ -887,22 +887,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL
441 - done; \
442 - done
443 - $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
444 +@@ -940,26 +940,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL
445 + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
446 + $(DESTDIR)$(LIBDEST)/distutils/tests ; \
447 + fi
448 - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
449 - ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
450 - -d $(LIBDEST) -f \
451 -- -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
452 +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
453 +- $(DESTDIR)$(LIBDEST)
454 - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
455 - ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
456 - -d $(LIBDEST) -f \
457 -- -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
458 +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
459 +- $(DESTDIR)$(LIBDEST)
460 - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
461 - ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
462 - -d $(LIBDEST)/site-packages -f \
463 @@ -24,6 +26,8 @@
464 - ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
465 - -d $(LIBDEST)/site-packages -f \
466 - -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
467 - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
468 - ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
469 +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
470 +- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
471
472 + # Create the PLATDIR source directory, if one wasn't distributed..
473 + $(srcdir)/Lib/$(PLATDIR):
474 diff --git a/lang/python/patches/030-fixup-include-dirs.patch b/lang/python/patches/030-fixup-include-dirs.patch
475 index 409b3e6..6cc6bba 100644
476 --- a/lang/python/patches/030-fixup-include-dirs.patch
477 +++ b/lang/python/patches/030-fixup-include-dirs.patch
478 @@ -4,29 +4,37 @@
479
480 --- a/setup.py
481 +++ b/setup.py
482 -@@ -309,9 +309,6 @@ class PyBuildExt(build_ext):
483 - return sys.platform
484 +@@ -368,11 +368,6 @@ class PyBuildExt(build_ext):
485 + os.unlink(tmpfile)
486
487 def detect_modules(self):
488 - # Ensure that /usr/local is always used
489 - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
490 - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
491 -
492 +- self.add_multiarch_paths()
493 +-
494 # Add paths specified in the environment variables LDFLAGS and
495 # CPPFLAGS for header and library files.
496 -@@ -347,11 +344,6 @@ class PyBuildExt(build_ext):
497 + # We must get the values from the Makefile and not the environment
498 +@@ -407,17 +402,6 @@ class PyBuildExt(build_ext):
499 for directory in reversed(options.dirs):
500 add_dir_to_list(dir_list, directory)
501
502 -- if os.path.normpath(sys.prefix) != '/usr':
503 +- if os.path.normpath(sys.prefix) != '/usr' \
504 +- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
505 +- # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
506 +- # (PYTHONFRAMEWORK is set) to avoid # linking problems when
507 +- # building a framework with different architectures than
508 +- # the one that is currently installed (issue #7473)
509 - add_dir_to_list(self.compiler.library_dirs,
510 - sysconfig.get_config_var("LIBDIR"))
511 - add_dir_to_list(self.compiler.include_dirs,
512 - sysconfig.get_config_var("INCLUDEDIR"))
513 -
514 +-
515 try:
516 have_unicode = unicode
517 -@@ -361,11 +353,8 @@ class PyBuildExt(build_ext):
518 + except NameError:
519 +@@ -426,11 +410,8 @@ class PyBuildExt(build_ext):
520 # lib_dirs and inc_dirs are used to search for files;
521 # if a file is found in one of those directories, it can
522 # be assumed that no additional -I,-L directives are needed.
523 diff --git a/lang/python/patches/040-dont-import-cross-compiled-modules.patch b/lang/python/patches/040-dont-import-cross-compiled-modules.patch
524 index 5c99598..1793569 100644
525 --- a/lang/python/patches/040-dont-import-cross-compiled-modules.patch
526 +++ b/lang/python/patches/040-dont-import-cross-compiled-modules.patch
527 @@ -4,7 +4,7 @@
528
529 --- a/setup.py
530 +++ b/setup.py
531 -@@ -270,36 +270,6 @@ class PyBuildExt(build_ext):
532 +@@ -307,36 +307,6 @@ class PyBuildExt(build_ext):
533 ext_filename = os.path.join(
534 self.build_lib,
535 self.get_ext_filename(self.get_ext_fullname(ext.name)))
536 diff --git a/lang/python/patches/070-dont-clean-ipkg-install.patch b/lang/python/patches/070-dont-clean-ipkg-install.patch
537 index 593bcff..0796c19 100644
538 --- a/lang/python/patches/070-dont-clean-ipkg-install.patch
539 +++ b/lang/python/patches/070-dont-clean-ipkg-install.patch
540 @@ -4,7 +4,7 @@
541
542 --- a/Makefile.pre.in
543 +++ b/Makefile.pre.in
544 -@@ -1118,11 +1118,11 @@ TAGS::
545 +@@ -1169,12 +1169,12 @@ TAGS::
546 # Sanitation targets -- clean leaves libraries, executables and tags
547 # files, which clobber removes as well
548 pycremoval:
549 @@ -12,10 +12,12 @@
550 + find $(srcdir) ! -path './ipkg-install/*' -name '*.py[co]' -exec rm -f {} ';'
551
552 clean: pycremoval
553 -- find . -name '*.o' -exec rm -f {} ';'
554 +- find . -name '*.[oa]' -exec rm -f {} ';'
555 - find . -name '*.s[ol]' -exec rm -f {} ';'
556 -+ find . ! -path './ipkg-install/*' -name '*.o' -exec rm -f {} ';'
557 +- find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
558 ++ find . ! -path './ipkg-install/*' -name '*.[oa]' -exec rm -f {} ';'
559 + find . ! -path './ipkg-install/*' -name '*.s[ol]' -exec rm -f {} ';'
560 - find $(srcdir)/build -name 'fficonfig.h' -exec rm -f {} ';' || true
561 - find $(srcdir)/build -name 'fficonfig.py' -exec rm -f {} ';' || true
562 ++ find . ! -path './ipkg-install/*' -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
563 + find build -name 'fficonfig.h' -exec rm -f {} ';' || true
564 + find build -name 'fficonfig.py' -exec rm -f {} ';' || true
565 -rm -f Lib/lib2to3/*Grammar*.pickle
566 diff --git a/lang/python/patches/080-distutils-dont_adjust_files.patch b/lang/python/patches/080-distutils-dont_adjust_files.patch
567 index a32e034..97d62fb 100644
568 --- a/lang/python/patches/080-distutils-dont_adjust_files.patch
569 +++ b/lang/python/patches/080-distutils-dont_adjust_files.patch
570 @@ -4,7 +4,7 @@
571
572 --- a/Lib/distutils/command/build_scripts.py
573 +++ b/Lib/distutils/command/build_scripts.py
574 -@@ -54,10 +54,7 @@ class build_scripts (Command):
575 +@@ -51,10 +51,7 @@ class build_scripts (Command):
576
577
578 def copy_scripts (self):
579 @@ -14,9 +14,9 @@
580 - line to refer to the current Python interpreter as we copy.
581 + """Copy each script listed in 'self.scripts'
582 """
583 + _sysconfig = __import__('sysconfig')
584 self.mkpath(self.build_dir)
585 - outfiles = []
586 -@@ -80,41 +77,9 @@ class build_scripts (Command):
587 +@@ -78,41 +75,9 @@ class build_scripts (Command):
588 if not self.dry_run:
589 raise
590 f = None
591 @@ -36,16 +36,16 @@
592 - self.build_dir)
593 - if not self.dry_run:
594 - outf = open(outfile, "w")
595 -- if not sysconfig.python_build:
596 +- if not _sysconfig.is_python_build():
597 - outf.write("#!%s%s\n" %
598 - (self.executable,
599 - post_interp))
600 - else:
601 - outf.write("#!%s%s\n" %
602 - (os.path.join(
603 -- sysconfig.get_config_var("BINDIR"),
604 -- "python%s%s" % (sysconfig.get_config_var("VERSION"),
605 -- sysconfig.get_config_var("EXE"))),
606 +- _sysconfig.get_config_var("BINDIR"),
607 +- "python%s%s" % (_sysconfig.get_config_var("VERSION"),
608 +- _sysconfig.get_config_var("EXE"))),
609 - post_interp))
610 - outf.writelines(f.readlines())
611 - outf.close()
612 diff --git a/lang/python/patches/090-fix-ctypes.patch b/lang/python/patches/090-fix-ctypes.patch
613 deleted file mode 100644
614 index 6e93182..0000000
615 --- a/lang/python/patches/090-fix-ctypes.patch
616 +++ /dev/null
617 @@ -1,16 +0,0 @@
618 ----
619 - Lib/ctypes/__init__.py | 6 ------
620 - 1 file changed, 6 deletions(-)
621 -
622 ---- a/Lib/ctypes/__init__.py
623 -+++ b/Lib/ctypes/__init__.py
624 -@@ -538,9 +538,3 @@ for kind in [c_ushort, c_uint, c_ulong,
625 - elif sizeof(kind) == 4: c_uint32 = kind
626 - elif sizeof(kind) == 8: c_uint64 = kind
627 - del(kind)
628 --
629 --# XXX for whatever reasons, creating the first instance of a callback
630 --# function is needed for the unittests on Win64 to succeed. This MAY
631 --# be a compiler bug, since the problem occurs only when _ctypes is
632 --# compiled with the MS SDK compiler. Or an uninitialized variable?
633 --CFUNCTYPE(c_int)(lambda: None)
634 diff --git a/lang/python/patches/120-force-internal-modules-for-hashlib.patch b/lang/python/patches/120-force-internal-modules-for-hashlib.patch
635 index ca29aa6..ad10a44 100644
636 --- a/lang/python/patches/120-force-internal-modules-for-hashlib.patch
637 +++ b/lang/python/patches/120-force-internal-modules-for-hashlib.patch
638 @@ -4,26 +4,21 @@
639
640 --- a/setup.py
641 +++ b/setup.py
642 -@@ -622,9 +622,10 @@ class PyBuildExt(build_ext):
643 +@@ -704,8 +704,7 @@ class PyBuildExt(build_ext):
644
645 - #print 'openssl_ver = 0x%08x' % openssl_ver
646 + min_openssl_ver = 0x00907000
647 + have_any_openssl = ssl_incs is not None and ssl_libs is not None
648 +- have_usable_openssl = (have_any_openssl and
649 +- openssl_ver >= min_openssl_ver)
650 ++ have_usable_openssl = False
651
652 -- if (ssl_incs is not None and
653 -- ssl_libs is not None and
654 -- openssl_ver >= 0x00907000):
655 -+# if (ssl_incs is not None and
656 -+# ssl_libs is not None and
657 -+# openssl_ver >= 0x00907000):
658 -+ if False:
659 - # The _hashlib module wraps optimized implementations
660 - # of hash functions from the OpenSSL library.
661 - exts.append( Extension('_hashlib', ['_hashopenssl.c'],
662 -@@ -644,7 +645,8 @@ class PyBuildExt(build_ext):
663 + if have_any_openssl:
664 + if have_usable_openssl:
665 +@@ -730,7 +729,7 @@ class PyBuildExt(build_ext):
666 depends = ['md5.h']) )
667 - missing.append('_hashlib')
668
669 -- if (openssl_ver < 0x00908000):
670 -+# if (openssl_ver < 0x00908000):
671 + min_sha2_openssl_ver = 0x00908000
672 +- if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver:
673 + if True:
674 # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
675 exts.append( Extension('_sha256', ['sha256module.c']) )