python3: upgrade to version 3.6.0 3737/head
authorAlexandru Ardelean <ardeleanalex@gmail.com>
Sat, 31 Dec 2016 23:53:14 +0000 (01:53 +0200)
committerAlexandru Ardelean <ardeleanalex@gmail.com>
Mon, 2 Jan 2017 19:46:03 +0000 (21:46 +0200)
Python 3.6 comes with some new cross-compilation logic that
generates filenames/paths with arch, abiflags and mach
included (in filename & path).

Problem is that the generated paths/filenames are not
consistent across archs (noticed on x86_64 & ar71xx),
so patch `016-adjust-config-paths.patch` was added
to mitigate this (by removing extra stuff in paths).

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
lang/python3/Makefile
lang/python3/files/python3-version.mk
lang/python3/patches/016-adjust-config-paths.patch [new file with mode: 0644]

index 6394211e2659abfbb6a51c86997c80d49c637c6c..7304affe73d5bc68817ffb90d2474b533b59afbf 100644 (file)
@@ -19,7 +19,8 @@ PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
 
 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
-PKG_MD5SUM:=8906efbacfcdc7c3c9198aeefafd159e
+PKG_MD5SUM:=82b143ebbf4514d7e05876bed7a6b1f5
+PKG_HASH:=b0c5f904f685e32d9232f7bdcbece9819a892929063b6e385414ad2dd6a23622
 
 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
@@ -122,14 +123,22 @@ ifeq ($(CONFIG_IPV6),y)
        ENABLE_IPV6 += --enable-ipv6
 endif
 
+PYTHON_FOR_BUILD:= \
+       _PYTHON_PROJECT_BASE=$(PKG_BUILD_DIR) \
+       _PYTHON_HOST_PLATFORM=linux2 \
+       PYTHONPATH="$(PKG_BUILD_DIR)/Lib:$(PKG_BUILD_DIR)/build/lib.linux2-$(PYTHON_VERSION)" \
+       _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata \
+       $(HOST_PYTHON3_BIN)
+
 CONFIGURE_ARGS+= \
        --sysconfdir=/etc \
        --enable-shared \
        --without-cxx-main \
        --with-threads \
-       --with-system-ffi="$(STAGING_DIR)/usr" \
+       --with-system-ffi \
        --without-pymalloc \
        --with-ensurepip=no \
+       PYTHON_FOR_BUILD="$(PYTHON_FOR_BUILD)" \
        $(ENABLE_IPV6) \
        CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
        OPT="$(TARGET_CFLAGS)"
@@ -220,7 +229,7 @@ HOST_CONFIGURE_ARGS+= \
        --prefix=$(HOST_PYTHON3_DIR) \
        --exec-prefix=$(HOST_PYTHON3_DIR) \
        --with-system-expat=$(STAGING_DIR_HOSTPKG) \
-       --with-system-ffi=$(STAGING_DIR_HOSTPKG) \
+       --with-system-ffi \
        --with-ensurepip=no \
        CONFIG_SITE= \
        CFLAGS="$(HOST_CFLAGS)"
index ce3b6b70bbf94cfacfbf94165f58987723ef6cff..08a130f12aa478077c993f25ef345339bb3ca3bd 100644 (file)
@@ -6,8 +6,8 @@
 #
 
 PYTHON3_VERSION_MAJOR:=3
-PYTHON3_VERSION_MINOR:=5
-PYTHON3_VERSION_MICRO:=2
+PYTHON3_VERSION_MINOR:=6
+PYTHON3_VERSION_MICRO:=0
 
 PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
 
diff --git a/lang/python3/patches/016-adjust-config-paths.patch b/lang/python3/patches/016-adjust-config-paths.patch
new file mode 100644 (file)
index 0000000..fb709b7
--- /dev/null
@@ -0,0 +1,72 @@
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 8bf1a70..c2708c3 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -424,6 +424,7 @@ def _init_posix():
+         platform=sys.platform,
+         multiarch=getattr(sys.implementation, '_multiarch', ''),
+     ))
++    name = '_sysconfigdata'
+     _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
+     build_time_vars = _temp.build_time_vars
+     global _config_vars
+diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
+index 9314e71..4861261 100644
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -343,6 +343,7 @@ def get_makefile_filename():
+ def _get_sysconfigdata_name():
++    return '_sysconfigdata'
+     return os.environ.get('_PYTHON_SYSCONFIGDATA_NAME',
+         '_sysconfigdata_{abi}_{platform}_{multiarch}'.format(
+         abi=sys.abiflags,
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index cd7d33d..ad6572f 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1301,7 +1301,7 @@ libinstall:      build_all $(srcdir)/Modules/xxmodule.c
+                       esac; \
+               done; \
+       done
+-      $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
++      $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata*.py \
+               $(DESTDIR)$(LIBDEST); \
+       $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
+       if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
+@@ -1436,7 +1436,7 @@ sharedinstall: sharedmods
+               --install-scripts=$(BINDIR) \
+               --install-platlib=$(DESTSHARED) \
+               --root=$(DESTDIR)/
+-      -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
++      -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata*.py
+       -rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
+ # Here are a couple of targets for MacOSX again, to install a full
+diff --git a/configure b/configure
+index cf95b27..8203fbb 100755
+--- a/configure
++++ b/configure
+@@ -14895,7 +14895,7 @@ LDVERSION='$(VERSION)$(ABIFLAGS)'
+ $as_echo "$LDVERSION" >&6; }
+-if test x$PLATFORM_TRIPLET = x; then
++if true ; then
+   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
+ else
+   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
+diff --git a/configure.ac b/configure.ac
+index 1d63813..25f25ed 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4600,7 +4600,7 @@ AC_MSG_RESULT($LDVERSION)
+ dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
+ AC_SUBST(PY_ENABLE_SHARED)
+-if test x$PLATFORM_TRIPLET = x; then
++if true ; then
+   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
+ else
+   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"