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 / 101-optional-pydoc.patch
1 Add an option to disable pydoc
2
3 It removes 0.5 MB of data from the target plus the pydoc script
4 itself.
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 |    6 +++++-
11  configure.in    |    5 +++++
12  setup.py        |   10 +++++++---
13  3 files changed, 17 insertions(+), 4 deletions(-)
14
15 Index: b/Makefile.pre.in
16 ===================================================================
17 --- a/Makefile.pre.in
18 +++ b/Makefile.pre.in
19 @@ -974,7 +974,7 @@
20                 multiprocessing multiprocessing/dummy \
21                 unittest \
22                 lib-old \
23 -               curses pydoc_data $(MACHDEPS)
24 +               curses $(MACHDEPS)
25  
26  TESTSUBDIRS = lib-tk/test lib-tk/test/test_tkinter \
27         lib-tk/test/test_ttk test test/audiodata test/capath test/data \
28 @@ -997,6 +997,10 @@
29  LIBSUBDIRS += $(TESTSUBDIRS)
30  endif
31  
32 +ifeq (@PYDOC@,yes)
33 +LIBSUBDIRS += pydoc_data
34 +endif
35 +
36  libinstall:    build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
37         @for i in $(SCRIPTDIR) $(LIBDEST); \
38         do \
39 Index: b/configure.ac
40 ===================================================================
41 --- a/configure.ac
42 +++ b/configure.ac
43 @@ -2627,6 +2627,11 @@
44        AC_CHECK_FUNCS(pthread_atfork)
45  fi
46  
47 +AC_SUBST(PYDOC)
48 +
49 +AC_ARG_ENABLE(pydoc,
50 +       AS_HELP_STRING([--disable-pydoc], [disable pydoc]),
51 +       [ PYDOC="${enableval}" ], [ PYDOC=yes ])
52  
53  AC_SUBST(TEST_MODULES)
54  
55 Index: b/setup.py
56 ===================================================================
57 --- a/setup.py
58 +++ b/setup.py
59 @@ -2222,6 +2222,12 @@
60      # turn off warnings when deprecated modules are imported
61      import warnings
62      warnings.filterwarnings("ignore",category=DeprecationWarning)
63 +
64 +    scripts = ['Tools/scripts/idle', 'Tools/scripts/2to3',
65 +               'Lib/smtpd.py']
66 +    if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
67 +        scripts += [ 'Tools/scripts/pydoc' ]
68 +
69      setup(# PyPI Metadata (PEP 301)
70            name = "Python",
71            version = sys.version.split()[0],
72 @@ -2242,9 +2248,7 @@
73            ext_modules=[Extension('_struct', ['_struct.c'])],
74  
75            # Scripts to install
76 -          scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
77 -                     'Tools/scripts/2to3',
78 -                     'Lib/smtpd.py']
79 +          scripts = scripts,
80          )
81  
82  # --install-platlib