d30eb02c321364d1901be5a88eeca7e2ccd4b987
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / python3 / 110-optional-idle.patch
1 Add an option to disable IDLE
2
3 IDLE is an IDE embedded into python, written using Tk, so it doesn't make
4 much sense to have it into our build.
5
6 Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7
8 ---
9  Makefile.pre.in |    8 +++++++-
10  configure.ac    |    6 ++++++
11  setup.py        |    4 +++-
12  3 files changed, 16 insertions(+), 2 deletions(-)
13
14 Index: b/Makefile.pre.in
15 ===================================================================
16 --- a/Makefile.pre.in
17 +++ b/Makefile.pre.in
18 @@ -1101,7 +1101,9 @@
19         -rm -f $(DESTDIR)$(LIBPC)/python3.pc
20         (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
21         -rm -f $(DESTDIR)$(BINDIR)/idle3
22 +ifeq (@IDLE@,yes)
23         (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
24 +endif
25         -rm -f $(DESTDIR)$(BINDIR)/pydoc3
26  ifeq (@PYDOC@,yes)
27         (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
28 @@ -1149,7 +1151,6 @@
29                 html json http dbm xmlrpc \
30                 logging csv wsgiref urllib \
31                 ctypes ctypes/macholib \
32 -               idlelib idlelib/Icons \
33                 distutils distutils/command \
34                 importlib \
35                 turtledemo \
36 @@ -1226,6 +1227,10 @@
37  LIBSUBDIRS += $(XMLLIBSUBDIRS)
38  endif
39  
40 +ifeq (@IDLE@,yes)
41 +LIBSUBDIRS += idlelib idlelib/Icons
42 +endif
43 +
44  ifeq (@TEST_MODULES@,yes)
45  LIBSUBDIRS += $(TESTSUBDIRS)
46  endif
47 Index: b/configure.ac
48 ===================================================================
49 --- a/configure.ac
50 +++ b/configure.ac
51 @@ -2746,6 +2746,12 @@
52         AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]),
53         [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
54  
55 +AC_SUBST(IDLE)
56 +
57 +AC_ARG_ENABLE(idle3,
58 +       AS_HELP_STRING([--disable-idle3], [disable idle3 IDE]),
59 +       [ IDLE="${enableval}" ], [ IDLE=yes ])
60 +
61  # Check for enable-ipv6
62  AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
63  AC_MSG_CHECKING([if --enable-ipv6 is specified])
64 Index: b/setup.py
65 ===================================================================
66 --- a/setup.py
67 +++ b/setup.py
68 @@ -2201,11 +2201,13 @@
69      import warnings
70      warnings.filterwarnings("ignore",category=DeprecationWarning)
71  
72 -    scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py']
73 +    scripts = ['Lib/smtpd.py']
74      if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
75          scripts += [ 'Tools/scripts/pydoc3' ]
76      if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"):
77          scripts += [ 'Tools/scripts/2to3' ]
78 +    if not '--disable-idle3' in sysconfig.get_config_var("CONFIG_ARGS"):
79 +        scripts += [ 'Tools/scripts/idle3' ]
80  
81      setup(# PyPI Metadata (PEP 301)
82            name = "Python",