Przeglądaj źródła

Merge pull request #1782 from commodo/python-upgrade-3.5.0

python3: upgrade to version 3.5.0
Steven Barth 9 lat temu
rodzic
commit
615874ce2d

+ 7
- 10
lang/python3/Makefile Wyświetl plik

@@ -14,12 +14,12 @@ PYTHON_VERSION:=$(PYTHON3_VERSION)
14 14
 PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
15 15
 
16 16
 PKG_NAME:=python3
17
-PKG_RELEASE:=3
17
+PKG_RELEASE:=1
18 18
 PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
19 19
 
20 20
 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
21 21
 PKG_SOURCE_URL:=http://www.python.org/ftp/python/$(PKG_VERSION)
22
-PKG_MD5SUM:=7d092d1bba6e17f0d9bd21b49e441dd5
22
+PKG_MD5SUM:=d149d2812f10cbe04c042232e7964171
23 23
 
24 24
 PKG_LICENSE:=PSF
25 25
 PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
@@ -31,7 +31,7 @@ HOST_BUILD_PARALLEL:=1
31 31
 PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
32 32
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
33 33
 
34
-PKG_BUILD_DEPENDS:=python3/host
34
+PKG_BUILD_DEPENDS:=libbz2/host expat/host python3/host
35 35
 
36 36
 include $(INCLUDE_DIR)/host-build.mk
37 37
 include $(INCLUDE_DIR)/package.mk
@@ -77,15 +77,9 @@ define Package/python3-light/description
77 77
   into separate packages.
78 78
 endef
79 79
 
80
-# Define newline here, since it's not defined in OpenWRT
81
-define newline
82
-
83
-
84
-endef
85
-
86 80
 PYTHON3_LIB_FILES_DEL:=
87 81
 PYTHON3_PACKAGES:=
88
-PYTHON3_SO_SUFFIX:=cpython-34.so
82
+PYTHON3_SO_SUFFIX:=cpython-$(PYTHON3_VERSION_MAJOR)$(PYTHON3_VERSION_MINOR).so
89 83
 define Py3BasePackage
90 84
   PYTHON3_PACKAGES+=$(1)
91 85
   PYTHON3_LIB_FILES_DEL+=$(2)
@@ -109,6 +103,7 @@ endef
109 103
 MAKE_FLAGS+=\
110 104
 	CROSS_COMPILE=yes \
111 105
 	LD="$(TARGET_CC)" \
106
+	FREEZE_IMPORTLIB=_freeze_importlib \
112 107
 	PGEN=pgen3
113 108
 
114 109
 ifeq ($(ARCH),i386)
@@ -224,6 +219,7 @@ HOST_CONFIGURE_ARGS+= \
224 219
 	--without-pymalloc \
225 220
 	--with-threads \
226 221
 	--prefix=$(STAGING_DIR_HOST) \
222
+	--with-system-expat=$(STAGING_DIR_HOST) \
227 223
 	--with-ensurepip=upgrade \
228 224
 	CONFIG_SITE= \
229 225
 	CFLAGS="$(HOST_CFLAGS)"
@@ -237,6 +233,7 @@ define Host/Install
237 233
 	$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
238 234
 	$(MAKE) -C $(HOST_BUILD_DIR) install
239 235
 	$(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/pgen3
236
+	$(INSTALL_BIN) $(HOST_BUILD_DIR)/Programs/_freeze_importlib $(STAGING_DIR_HOST)/bin/_freeze_importlib
240 237
 endef
241 238
 
242 239
 $(eval $(call HostBuild))

+ 5
- 2
lang/python3/files/python3-package.mk Wyświetl plik

@@ -5,8 +5,11 @@
5 5
 # See /LICENSE for more information.
6 6
 #
7 7
 
8
-PYTHON3_VERSION:=3.4
9
-PYTHON3_VERSION_MICRO:=3
8
+PYTHON3_VERSION_MAJOR:=3
9
+PYTHON3_VERSION_MINOR:=5
10
+PYTHON3_VERSION_MICRO:=0
11
+
12
+PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
10 13
 
11 14
 PYTHON3_DIR:=$(STAGING_DIR)/usr
12 15
 PYTHON3_BIN_DIR:=$(PYTHON3_DIR)/bin

+ 12
- 3
lang/python3/patches/003-do-not-run-distutils-tests.patch Wyświetl plik

@@ -1,8 +1,8 @@
1 1
 diff --git a/Makefile.pre.in b/Makefile.pre.in
2
-index f36c11d..f2b6c71 100644
2
+index ce2c0aa..b0c8322 100644
3 3
 --- a/Makefile.pre.in
4 4
 +++ b/Makefile.pre.in
5
-@@ -1217,32 +1217,6 @@ libinstall:	build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
5
+@@ -1256,41 +1256,6 @@ libinstall:	build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
6 6
  		done; \
7 7
  	done
8 8
  	$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
@@ -20,7 +20,12 @@ index f36c11d..f2b6c71 100644
20 20
 -		-d $(LIBDEST) -f \
21 21
 -		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
22 22
 -		$(DESTDIR)$(LIBDEST)
23
--	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
23
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
24
+-		$(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
25
+-		-d $(LIBDEST) -f \
26
+-		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
27
+-		$(DESTDIR)$(LIBDEST)
28
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
24 29
 -		$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
25 30
 -		-d $(LIBDEST)/site-packages -f \
26 31
 -		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
@@ -29,6 +34,10 @@ index f36c11d..f2b6c71 100644
29 34
 -		-d $(LIBDEST)/site-packages -f \
30 35
 -		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
31 36
 -	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
37
+-		$(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
38
+-		-d $(LIBDEST)/site-packages -f \
39
+-		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
40
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
32 41
 -		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
33 42
 -	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
34 43
 -		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt

+ 11
- 11
lang/python3/patches/004-do-not-write-bytes-codes.patch Wyświetl plik

@@ -1,17 +1,17 @@
1
-diff --git a/Python/pythonrun.c b/Python/pythonrun.c
2
-index 0327830..df41cda 100644
3
---- a/Python/pythonrun.c
4
-+++ b/Python/pythonrun.c
5
-@@ -124,7 +124,7 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
6
- int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */
7
- int Py_NoSiteFlag; /* Suppress 'import site' */
8
- int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
9
--int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
10
-+int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
1
+diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
2
+index a17adf7..415b3f6 100644
3
+--- a/Python/pylifecycle.c
4
++++ b/Python/pylifecycle.c
5
+@@ -86,7 +86,7 @@ int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
11 6
  int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
12 7
  int Py_FrozenFlag; /* Needed by getpath.c */
13 8
  int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
14
-@@ -350,7 +350,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
9
+-int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
10
++int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
11
+ int Py_NoUserSiteDirectory = 0; /* for -s and site.py */
12
+ int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */
13
+ int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */
14
+@@ -309,7 +309,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
15 15
      if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
16 16
          Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
17 17
      if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')

+ 26
- 0
lang/python3/patches/013-make-freeze-import-lib-into-an-override-able-var.patch Wyświetl plik

@@ -0,0 +1,26 @@
1
+diff --git a/Makefile.pre.in b/Makefile.pre.in
2
+index ce2c0aa..7df56bf 100644
3
+--- a/Makefile.pre.in
4
++++ b/Makefile.pre.in
5
+@@ -691,17 +691,19 @@ Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
6
+ ############################################################################
7
+ # Importlib
8
+ 
9
++FREEZE_IMPORTLIB ?= ./Programs/_freeze_importlib
10
++
11
+ Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile
12
+ 
13
+ Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN)
14
+ 	$(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
15
+ 
16
+ Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib
17
+-	./Programs/_freeze_importlib \
18
++	$(FREEZE_IMPORTLIB) \
19
+ 		$(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h
20
+ 
21
+ Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib
22
+-	./Programs/_freeze_importlib \
23
++	$(FREEZE_IMPORTLIB) \
24
+ 		$(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h
25
+ 
26
+ 

+ 26
- 0
lang/python3/patches/014-remove-platform-so-suffix.patch Wyświetl plik

@@ -0,0 +1,26 @@
1
+diff --git a/configure b/configure
2
+index e823a08..84c525f 100755
3
+--- a/configure
4
++++ b/configure
5
+@@ -14365,7 +14365,7 @@ $as_echo_n "checking ABIFLAGS... " >&6; }
6
+ $as_echo "$ABIFLAGS" >&6; }
7
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
8
+ $as_echo_n "checking SOABI... " >&6; }
9
+-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
10
++SOABI='cpython-'`echo $VERSION | tr -d .`
11
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5
12
+ $as_echo "$SOABI" >&6; }
13
+ 
14
+diff --git a/configure.ac b/configure.ac
15
+index 56a73df..1855af5 100644
16
+--- a/configure.ac
17
++++ b/configure.ac
18
+@@ -4314,7 +4314,7 @@ AC_SUBST(SOABI)
19
+ AC_MSG_CHECKING(ABIFLAGS)
20
+ AC_MSG_RESULT($ABIFLAGS)
21
+ AC_MSG_CHECKING(SOABI)
22
+-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
23
++SOABI='cpython-'`echo $VERSION | tr -d .`
24
+ AC_MSG_RESULT($SOABI)
25
+ 
26
+ AC_SUBST(EXT_SUFFIX)

+ 12
- 0
lang/python3/patches/015-abort-on-failed-modules.patch Wyświetl plik

@@ -0,0 +1,12 @@
1
+diff --git a/setup.py b/setup.py
2
+index da67731..928e0de 100644
3
+--- a/setup.py
4
++++ b/setup.py
5
+@@ -293,6 +293,7 @@ class PyBuildExt(build_ext):
6
+             print("Failed to build these modules:")
7
+             print_three_column(failed)
8
+             print()
9
++            if cross_compiling: sys.exit(1)
10
+ 
11
+         if self.failed_on_import:
12
+             failed = self.failed_on_import[:]