summaryrefslogtreecommitdiffstats
path: root/package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2017-03-23 08:21:12 -0700
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-03-25 15:18:49 +0100
commitd2afa01f76ce2c7610286103340048d953b27e45 (patch)
tree5fffb2d070841068df535c03449c11a15e43318e /package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch
parentf48f1a89a0c598ebefd2643af3ad6aff981e291c (diff)
downloadbuildroot-d2afa01f76ce2c7610286103340048d953b27e45.tar.gz
buildroot-d2afa01f76ce2c7610286103340048d953b27e45.zip
python3: Bump version to 3.6.1
Update all appropriate version numbers as well as SHAs and MD5s as well as repbasing BR's patches on top of 3.6.1 codebase (new github repo tree, v3.6.1 tag was used). Note that patch: [PATCH] Change the install location of _sysconfigdata.py was dropped due to the fact taht build system now adds platform specific suffix to sysconfigdata's name, so each platform's file should have a unique name and distutils now allows to specify which sysconfigdata is used via _PYTHON_SYSCONFIGDATA_NAME see: https://github.com/python/cpython/commit/c4b53afce491142b80b228a21a05de5dcfd8d36f https://github.com/python/cpython/commit/92dec548ff1494b86f08bd3753ca91a9330b4ea9 and patches: [PATCH] distutils/sysconfig: use sysconfigdata [PATCH] setup.py: do not add invalid header locations [PATCH] Do not harcode invalid path to ncursesw headers was dropped since it looks like it made it's way upstream, see: https://github.com/python/cpython/commit/409482251b06fe75c4ee56e85ffbb4b23d934159 https://github.com/python/cpython/commit/1351c31aa9651b278d7ef8ec79af3b646a520235 https://github.com/python/cpython/commit/e13c3201fb66c4c211b4ebb7604d1435bedc1015 respectively. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch')
-rw-r--r--package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch109
1 files changed, 109 insertions, 0 deletions
diff --git a/package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch b/package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch
new file mode 100644
index 0000000000..bf8cd925bc
--- /dev/null
+++ b/package/python3/0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch
@@ -0,0 +1,109 @@
+From 300143451b42717eb05fc8b876f25ff4b202d8c4 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Wed, 22 Feb 2017 16:33:22 -0800
+Subject: [PATCH] Add infrastructure to disable the build of certain extensions
+
+Some of the extensions part of the Python core have dependencies on
+external libraries (sqlite, tk, etc.) or are relatively big and not
+necessarly always useful (CJK codecs for example). By extensions, we
+mean part of Python modules that are written in C and therefore
+compiled to binary code.
+
+Therefore, we introduce a small infrastructure that allows to disable
+some of those extensions. This can be done inside the configure.ac by
+adding values to the DISABLED_EXTENSIONS variable (which is a
+word-separated list of extensions).
+
+The implementation works as follow :
+
+ * configure.ac defines a DISABLED_EXTENSIONS variable, which is
+ substituted (so that when Makefile.pre is generated from
+ Makefile.pre.in, the value of the variable is substituted). For
+ now, this DISABLED_EXTENSIONS variable is empty, later patches will
+ use it.
+
+ * Makefile.pre.in passes the DISABLED_EXTENSIONS value down to the
+ variables passed in the environment when calling the setup.py
+ script that actually builds and installs those extensions.
+
+ * setup.py is modified so that the existing "disabled_module_list" is
+ filled with those pre-disabled extensions listed in
+ DISABLED_EXTENSIONS.
+
+Patch ported to python2.7 by Maxime Ripard <ripard@archos.com>, and
+then extended by Thomas Petazzoni
+<thomas.petazzoni@free-electrons.com>.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+[ Andrey Smirnov: ported to Python 3.6 ]
+Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
+---
+ Makefile.pre.in | 6 +++++-
+ configure.ac | 2 ++
+ setup.py | 6 +++++-
+ 3 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index b78a765..0e06ddb 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -188,6 +188,8 @@ FILEMODE= 644
+ # configure script arguments
+ CONFIG_ARGS= @CONFIG_ARGS@
+
++# disabled extensions
++DISABLED_EXTENSIONS= @DISABLED_EXTENSIONS@
+
+ # Subdirectories with code
+ SRCDIRS= @SRCDIRS@
+@@ -606,6 +608,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
+ esac; \
+ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
++ DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \
+ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+
+
+@@ -1433,7 +1436,8 @@ libainstall: all python-config
+ # Install the dynamically loadable modules
+ # This goes into $(exec_prefix)
+ sharedinstall: sharedmods
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
++ $(RUNSHARED) DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \
++ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
+ --prefix=$(prefix) \
+ --install-scripts=$(BINDIR) \
+ --install-platlib=$(DESTSHARED) \
+diff --git a/configure.ac b/configure.ac
+index 250b23b..fc4e71a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2779,6 +2779,8 @@ LIBS="$withval $LIBS"
+
+ PKG_PROG_PKG_CONFIG
+
++AC_SUBST(DISABLED_EXTENSIONS)
++
+ # Check for use of the system expat library
+ AC_MSG_CHECKING(for --with-system-expat)
+ AC_ARG_WITH(system_expat,
+diff --git a/setup.py b/setup.py
+index f04bf22..c5bce21 100644
+--- a/setup.py
++++ b/setup.py
+@@ -43,7 +43,11 @@ 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.
+-disabled_module_list = []
++try:
++ disabled_module_list = sysconfig.get_config_var("DISABLED_EXTENSIONS").split(" ")
++except KeyError:
++ disabled_module_list = list()
++
+
+ def add_dir_to_list(dirlist, dir):
+ """Add the directory 'dir' to the list 'dirlist' (after any relative
+--
+2.9.3
+
OpenPOWER on IntegriCloud