1 From d0cf9ebed6d34d820cf594578cf513797fb52772 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Tue, 7 Mar 2017 22:27:49 +0100
4 Subject: [PATCH] Add an option to disable lib2to3
6 lib2to3 is a library to convert Python 2.x code to Python 3.x. As
7 such, it is probably not very useful on embedded system targets.
9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
12 Makefile.pre.in | 11 ++++++++---
13 configure.ac | 6 ++++++
15 3 files changed, 17 insertions(+), 5 deletions(-)
17 diff --git a/Makefile.pre.in b/Makefile.pre.in
18 index 84d5fc6..b2a0490 100644
21 @@ -1045,7 +1045,6 @@ LIBSUBDIRS= lib-tk site-packages \
24 logging bsddb csv importlib wsgiref \
25 - lib2to3 lib2to3/fixes lib2to3/pgen2 \
26 ctypes ctypes/macholib \
27 idlelib idlelib/Icons \
28 distutils distutils/command $(XMLLIBSUBDIRS) \
29 @@ -1064,8 +1063,6 @@ TESTSUBDIRS = lib-tk/test lib-tk/test/test_tkinter \
34 - lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
38 @@ -1079,6 +1076,14 @@ ifeq (@PYDOC@,yes)
39 LIBSUBDIRS += pydoc_data
43 +LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2
44 +TESTSUBDIRS += lib2to3/tests \
45 + lib2to3/tests/data \
46 + lib2to3/tests/data/fixers \
47 + lib2to3/tests/data/fixers/myfixes
50 libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
51 @for i in $(SCRIPTDIR) $(LIBDEST); \
53 diff --git a/configure.ac b/configure.ac
54 index 8bab160..270f337 100644
57 @@ -2817,6 +2817,12 @@ AC_ARG_ENABLE(test-modules,
58 AS_HELP_STRING([--disable-test-modules], [disable test modules]),
59 [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
63 +AC_ARG_ENABLE(lib2to3,
64 + AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]),
65 + [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
67 # Check for enable-ipv6
68 AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
69 AC_MSG_CHECKING([if --enable-ipv6 is specified])
70 diff --git a/setup.py b/setup.py
71 index 69771e2..f51ef8c 100644
74 @@ -2234,10 +2234,11 @@ def main():
76 warnings.filterwarnings("ignore",category=DeprecationWarning)
78 - scripts = ['Tools/scripts/idle', 'Tools/scripts/2to3',
80 + scripts = ['Tools/scripts/idle', 'Lib/smtpd.py']
81 if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
82 scripts += [ 'Tools/scripts/pydoc' ]
83 + if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"):
84 + scripts += [ 'Tools/scripts/2to3' ]
86 setup(# PyPI Metadata (PEP 301)