gst1-plugins-base: bump to version 1.10.4
[buildroot-gz.git] / package / python / 102-optional-2to3.patch
blob100c417a21856299988c342f340df9a9d5863dc3
1 Add an option to disable lib2to3
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.
6 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
9 ---
10 Makefile.pre.in | 24 +++++++++++++++++-------
11 configure.in | 6 ++++++
12 setup.py | 5 +++--
13 3 files changed, 26 insertions(+), 9 deletions(-)
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
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
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 @@ -2645,6 +2645,12 @@
56 AS_HELP_STRING([--disable-test-modules], [disable test modules]),
57 [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
59 +AC_SUBST(LIB2TO3)
61 +AC_ARG_ENABLE(lib2to3,
62 + AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]),
63 + [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
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 @@ -2212,10 +2212,11 @@
73 import warnings
74 warnings.filterwarnings("ignore",category=DeprecationWarning)
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' ]
84 setup(# PyPI Metadata (PEP 301)
85 name = "Python",