The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / python / 102-optional-2to3.patch
1 Add an option to disable lib2to3
2
3 lib2to3 is a library to convert Python 2.x code to Python 3.x. As
4 such, it is probably not very useful on embedded system targets.
5
6 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
8
9 ---
10  Makefile.pre.in |   24 +++++++++++++++++-------
11  configure.in    |    6 ++++++
12  setup.py        |    5 +++--
13  3 files changed, 26 insertions(+), 9 deletions(-)
14
15 Index: b/Makefile.pre.in
16 ===================================================================
17 --- a/Makefile.pre.in
18 +++ b/Makefile.pre.in
19 @@ -967,7 +967,6 @@
20                 json \
21                 sqlite3  \
22                 logging bsddb csv importlib wsgiref \
23 -               lib2to3 lib2to3/fixes lib2to3/pgen2 \
24                 ctypes ctypes/macholib \
25                 idlelib idlelib/Icons \
26                 distutils distutils/command $(XMLLIBSUBDIRS) \
27 @@ -986,8 +985,6 @@
28         json/tests \
29         sqlite3/test \
30         bsddb/test \
31 -       lib2to3/tests \
32 -       lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
33         ctypes/test \
34         idlelib/idle_test \
35         distutils/tests \
36 @@ -1001,6 +998,14 @@
37  LIBSUBDIRS += pydoc_data
38  endif
39  
40 +ifeq (@LIB2TO3@,yes)
41 +LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2
42 +TESTSUBDIRS +=         lib2to3/tests                           \
43 +               lib2to3/tests/data                      \
44 +               lib2to3/tests/data/fixers               \
45 +               lib2to3/tests/data/fixers/myfixes
46 +endif
47 +
48  libinstall:    build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
49         @for i in $(SCRIPTDIR) $(LIBDEST); \
50         do \
51 Index: b/configure.ac
52 ===================================================================
53 --- a/configure.ac
54 +++ b/configure.ac
55 @@ -2639,6 +2639,12 @@
56         AS_HELP_STRING([--disable-test-modules], [disable test modules]),
57         [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
58  
59 +AC_SUBST(LIB2TO3)
60 +
61 +AC_ARG_ENABLE(lib2to3,
62 +       AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]),
63 +       [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
64 +
65  # Check for enable-ipv6
66  AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
67  AC_MSG_CHECKING([if --enable-ipv6 is specified])
68 Index: b/setup.py
69 ===================================================================
70 --- a/setup.py
71 +++ b/setup.py
72 @@ -2223,10 +2223,11 @@
73      import warnings
74      warnings.filterwarnings("ignore",category=DeprecationWarning)
75  
76 -    scripts = ['Tools/scripts/idle', 'Tools/scripts/2to3',
77 -               'Lib/smtpd.py']
78 +    scripts = ['Tools/scripts/idle', 'Lib/smtpd.py']
79      if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
80          scripts += [ 'Tools/scripts/pydoc' ]
81 +    if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"):
82 +        scripts += [ 'Tools/scripts/2to3' ]
83  
84      setup(# PyPI Metadata (PEP 301)
85            name = "Python",