summaryrefslogtreecommitdiffstats
path: root/package/python3/0005-Add-infrastructure-to-disable-the-build-of-certain-e.patch
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-05-01 22:15:12 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-05-17 22:46:17 +0200
commit476f5fc8f6eba6ee44ce2e0812a1492609331f7d (patch)
treefb2bfb551a10f628f8ecfc20cb6f0f6297a891c0 /package/python3/0005-Add-infrastructure-to-disable-the-build-of-certain-e.patch
parent61c8854cef2a41be3175bbf7f0992c31560a1dd7 (diff)
downloadbuildroot-476f5fc8f6eba6ee44ce2e0812a1492609331f7d.tar.gz
buildroot-476f5fc8f6eba6ee44ce2e0812a1492609331f7d.zip
python3: bump to 3.5.1
The major changes in terms of Buildroot packaging are: - Due to PEP488, Python no longer generates .pyc (unoptimized) and .pyo (optimized) byte-code files. Instead, it generates <foo>.pyc, <foo>.opt-1.pyc and <foo>.opt-2.pyc. Therefore, we removed the --disable-pyo-build option and kept only the --disable-pyc-build option, which completely disables building all .pyc files. In addition, since the optimized .opt-X.pyc files don't work if the corresponding un-optimized .pyc file is not present, we are for the moment unconditionally removing the optimized ones (keeping both the unoptimized and optimized ones doubles the required filesystem size!). So basically we preserve the behavior we had before this commit: BR2_PACKAGE_PYTHON3_PY_ONLY -> only *.py BR2_PACKAGE_PYTHON3_PYC_ONLY -> only non-optimized *.pyc BR2_PACKAGE_PYTHON3_PY_PYC -> both the *.py and non-optimized *.pyc To achieve this, the TARGET_FINALIZE_HOOKS are reworked: PYTHON3_REMOVE_PY_FILES is responsible for removing *.py files in the BR2_PACKAGE_PYTHON3_PYC_ONLY case. PYTHON3_REMOVE_PYC_FILES is responsible for removing *.pyc files in the BR2_PACKAGE_PYTHON3_PY_ONLY case. PYTHON3_REMOVE_OPTIMIZED_PYC_FILES is responsible for removing the optimized *.opt-1.pyc and *.opt-2.pyc files, which is done unconditionally. - The PEP3147 disabling patch had to be significantly reworked due to the code having changed heavily. The code was moved into a _bootstrap_external.py, which is a "frozen" Python module, i.e a module generated into a .h file at compile time using the _freeze_importlib program. - Due to the above, we now need to regenerate importlib.h at build time. Unfortunately, for the target Python _freeze_importlib is built for the target, so we can't run it on the build machine. To fix this, we copy the _freeze_importlib program from the host-python in $(HOST_DIR), and then patch the target python to use it. Since the same solution can be used for 'pgen', we do it, and avoid having to touch the graminit.{c,h} files. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/python3/0005-Add-infrastructure-to-disable-the-build-of-certain-e.patch')
-rw-r--r--package/python3/0005-Add-infrastructure-to-disable-the-build-of-certain-e.patch18
1 files changed, 9 insertions, 9 deletions
diff --git a/package/python3/0005-Add-infrastructure-to-disable-the-build-of-certain-e.patch b/package/python3/0005-Add-infrastructure-to-disable-the-build-of-certain-e.patch
index 4a32bb191b..76a553b505 100644
--- a/package/python3/0005-Add-infrastructure-to-disable-the-build-of-certain-e.patch
+++ b/package/python3/0005-Add-infrastructure-to-disable-the-build-of-certain-e.patch
@@ -1,4 +1,4 @@
-From 9eb1076b61e83647028a2f6b665b6f9afcb793b0 Mon Sep 17 00:00:00 2001
+From 3a9f4aa255909ed152883eee787313efd20dbc58 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Wed, 23 Dec 2015 11:31:08 +0100
Subject: [PATCH] Add infrastructure to disable the build of certain extensions
@@ -42,10 +42,10 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/Makefile.pre.in b/Makefile.pre.in
-index f1bdd99..e0f9e0f 100644
+index 272f312..9420860 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -177,6 +177,8 @@ FILEMODE= 644
+@@ -182,6 +182,8 @@ FILEMODE= 644
# configure script arguments
CONFIG_ARGS= @CONFIG_ARGS@
@@ -54,7 +54,7 @@ index f1bdd99..e0f9e0f 100644
# Subdirectories with code
SRCDIRS= @SRCDIRS@
-@@ -574,6 +576,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt
+@@ -600,6 +602,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt
esac; \
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
@@ -62,7 +62,7 @@ index f1bdd99..e0f9e0f 100644
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
# Build static library
-@@ -1384,7 +1387,8 @@ libainstall: all python-config
+@@ -1425,7 +1428,8 @@ libainstall: all python-config
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall: sharedmods
@@ -73,10 +73,10 @@ index f1bdd99..e0f9e0f 100644
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
diff --git a/configure.ac b/configure.ac
-index 6342b81..a3026b8 100644
+index c492594..bfb599e 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -2352,6 +2352,8 @@ LIBS="$withval $LIBS"
+@@ -2588,6 +2588,8 @@ LIBS="$withval $LIBS"
PKG_PROG_PKG_CONFIG
@@ -86,10 +86,10 @@ index 6342b81..a3026b8 100644
AC_MSG_CHECKING(for --with-system-expat)
AC_ARG_WITH(system_expat,
diff --git a/setup.py b/setup.py
-index d3bf8e5..2a504d2 100644
+index dbd2a3c..1ebfa50 100644
--- a/setup.py
+++ b/setup.py
-@@ -39,7 +39,10 @@ host_platform = get_platform()
+@@ -44,7 +44,10 @@ host_platform = get_platform()
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
# This global variable is used to hold the list of modules to be disabled.
OpenPOWER on IntegriCloud