python3: upgrade to version 3.5.0 1782/head
authorAlexandru Ardelean <ardeleanalex@gmail.com>
Mon, 14 Sep 2015 19:16:15 +0000 (22:16 +0300)
committerAlexandru Ardelean <ardeleanalex@gmail.com>
Wed, 16 Sep 2015 18:56:40 +0000 (21:56 +0300)
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
lang/python3/Makefile
lang/python3/files/python3-package.mk
lang/python3/patches/003-do-not-run-distutils-tests.patch
lang/python3/patches/004-do-not-write-bytes-codes.patch
lang/python3/patches/013-make-freeze-import-lib-into-an-override-able-var.patch [new file with mode: 0644]
lang/python3/patches/014-remove-platform-so-suffix.patch [new file with mode: 0644]
lang/python3/patches/015-abort-on-failed-modules.patch [new file with mode: 0644]

index e68f415fbf1480c1c932caf843af7753a28ddbcb..fa3d6e62e861b7d891b06098acc4874fca69288d 100644 (file)
@@ -14,12 +14,12 @@ PYTHON_VERSION:=$(PYTHON3_VERSION)
 PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
 
 PKG_NAME:=python3
-PKG_RELEASE:=3
+PKG_RELEASE:=1
 PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
 
 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.python.org/ftp/python/$(PKG_VERSION)
-PKG_MD5SUM:=7d092d1bba6e17f0d9bd21b49e441dd5
+PKG_MD5SUM:=d149d2812f10cbe04c042232e7964171
 
 PKG_LICENSE:=PSF
 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
 PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
 
-PKG_BUILD_DEPENDS:=python3/host
+PKG_BUILD_DEPENDS:=libbz2/host expat/host python3/host
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
@@ -77,15 +77,9 @@ define Package/python3-light/description
   into separate packages.
 endef
 
-# Define newline here, since it's not defined in OpenWRT
-define newline
-
-
-endef
-
 PYTHON3_LIB_FILES_DEL:=
 PYTHON3_PACKAGES:=
-PYTHON3_SO_SUFFIX:=cpython-34.so
+PYTHON3_SO_SUFFIX:=cpython-$(PYTHON3_VERSION_MAJOR)$(PYTHON3_VERSION_MINOR).so
 define Py3BasePackage
   PYTHON3_PACKAGES+=$(1)
   PYTHON3_LIB_FILES_DEL+=$(2)
@@ -109,6 +103,7 @@ endef
 MAKE_FLAGS+=\
        CROSS_COMPILE=yes \
        LD="$(TARGET_CC)" \
+       FREEZE_IMPORTLIB=_freeze_importlib \
        PGEN=pgen3
 
 ifeq ($(ARCH),i386)
@@ -224,6 +219,7 @@ HOST_CONFIGURE_ARGS+= \
        --without-pymalloc \
        --with-threads \
        --prefix=$(STAGING_DIR_HOST) \
+       --with-system-expat=$(STAGING_DIR_HOST) \
        --with-ensurepip=upgrade \
        CONFIG_SITE= \
        CFLAGS="$(HOST_CFLAGS)"
@@ -237,6 +233,7 @@ define Host/Install
        $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
        $(MAKE) -C $(HOST_BUILD_DIR) install
        $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/pgen3
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/Programs/_freeze_importlib $(STAGING_DIR_HOST)/bin/_freeze_importlib
 endef
 
 $(eval $(call HostBuild))
index e76dc0bc81ba3b26d3c4d78ce445db77d365e032..37a023eb00213c599e64f39cce009584caf3db33 100644 (file)
@@ -5,8 +5,11 @@
 # See /LICENSE for more information.
 #
 
-PYTHON3_VERSION:=3.4
-PYTHON3_VERSION_MICRO:=3
+PYTHON3_VERSION_MAJOR:=3
+PYTHON3_VERSION_MINOR:=5
+PYTHON3_VERSION_MICRO:=0
+
+PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
 
 PYTHON3_DIR:=$(STAGING_DIR)/usr
 PYTHON3_BIN_DIR:=$(PYTHON3_DIR)/bin
index 0291eb198c7c0e9b3b94559c423141f9e873f23a..77c089f5f79f8e46557d7303645755b4c67996d0 100644 (file)
@@ -1,8 +1,8 @@
 diff --git a/Makefile.pre.in b/Makefile.pre.in
-index f36c11d..f2b6c71 100644
+index ce2c0aa..b0c8322 100644
 --- a/Makefile.pre.in
 +++ b/Makefile.pre.in
-@@ -1217,32 +1217,6 @@ libinstall:     build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
+@@ -1256,41 +1256,6 @@ libinstall:     build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
                done; \
        done
        $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
@@ -20,7 +20,12 @@ index f36c11d..f2b6c71 100644
 -              -d $(LIBDEST) -f \
 -              -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
 -              $(DESTDIR)$(LIBDEST)
--      -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
+-      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
+-              -d $(LIBDEST) -f \
+-              -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+-              $(DESTDIR)$(LIBDEST)
+-      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
 -              $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
 -              -d $(LIBDEST)/site-packages -f \
 -              -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
@@ -29,6 +34,10 @@ index f36c11d..f2b6c71 100644
 -              -d $(LIBDEST)/site-packages -f \
 -              -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
 -      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
+-              -d $(LIBDEST)/site-packages -f \
+-              -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+-      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
 -              $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
 -      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
 -              $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
index f624d58626f8d21c06f416d2f66c8c4e93bb83b8..1da7b8be862af7534c85da526156f745ff9fa909 100644 (file)
@@ -1,17 +1,17 @@
-diff --git a/Python/pythonrun.c b/Python/pythonrun.c
-index 0327830..df41cda 100644
---- a/Python/pythonrun.c
-+++ b/Python/pythonrun.c
-@@ -124,7 +124,7 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
- int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */
- int Py_NoSiteFlag; /* Suppress 'import site' */
- int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
--int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
-+int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
+diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
+index a17adf7..415b3f6 100644
+--- a/Python/pylifecycle.c
++++ b/Python/pylifecycle.c
+@@ -86,7 +86,7 @@ int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
  int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
  int Py_FrozenFlag; /* Needed by getpath.c */
  int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
-@@ -350,7 +350,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
+-int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
++int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
+ int Py_NoUserSiteDirectory = 0; /* for -s and site.py */
+ int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */
+ int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */
+@@ -309,7 +309,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
      if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
          Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
      if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
diff --git a/lang/python3/patches/013-make-freeze-import-lib-into-an-override-able-var.patch b/lang/python3/patches/013-make-freeze-import-lib-into-an-override-able-var.patch
new file mode 100644 (file)
index 0000000..be17d34
--- /dev/null
@@ -0,0 +1,26 @@
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index ce2c0aa..7df56bf 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -691,17 +691,19 @@ Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
+ ############################################################################
+ # Importlib
++FREEZE_IMPORTLIB ?= ./Programs/_freeze_importlib
++
+ Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile
+ Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN)
+       $(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+ Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib
+-      ./Programs/_freeze_importlib \
++      $(FREEZE_IMPORTLIB) \
+               $(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h
+ Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib
+-      ./Programs/_freeze_importlib \
++      $(FREEZE_IMPORTLIB) \
+               $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h
diff --git a/lang/python3/patches/014-remove-platform-so-suffix.patch b/lang/python3/patches/014-remove-platform-so-suffix.patch
new file mode 100644 (file)
index 0000000..cbc32d5
--- /dev/null
@@ -0,0 +1,26 @@
+diff --git a/configure b/configure
+index e823a08..84c525f 100755
+--- a/configure
++++ b/configure
+@@ -14365,7 +14365,7 @@ $as_echo_n "checking ABIFLAGS... " >&6; }
+ $as_echo "$ABIFLAGS" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
+ $as_echo_n "checking SOABI... " >&6; }
+-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
++SOABI='cpython-'`echo $VERSION | tr -d .`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5
+ $as_echo "$SOABI" >&6; }
+diff --git a/configure.ac b/configure.ac
+index 56a73df..1855af5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4314,7 +4314,7 @@ AC_SUBST(SOABI)
+ AC_MSG_CHECKING(ABIFLAGS)
+ AC_MSG_RESULT($ABIFLAGS)
+ AC_MSG_CHECKING(SOABI)
+-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
++SOABI='cpython-'`echo $VERSION | tr -d .`
+ AC_MSG_RESULT($SOABI)
+ AC_SUBST(EXT_SUFFIX)
diff --git a/lang/python3/patches/015-abort-on-failed-modules.patch b/lang/python3/patches/015-abort-on-failed-modules.patch
new file mode 100644 (file)
index 0000000..eec488f
--- /dev/null
@@ -0,0 +1,12 @@
+diff --git a/setup.py b/setup.py
+index da67731..928e0de 100644
+--- a/setup.py
++++ b/setup.py
+@@ -293,6 +293,7 @@ class PyBuildExt(build_ext):
+             print("Failed to build these modules:")
+             print_three_column(failed)
+             print()
++            if cross_compiling: sys.exit(1)
+         if self.failed_on_import:
+             failed = self.failed_on_import[:]