open-plc-utils: new package
[buildroot-gz.git] / package / python / 101-optional-pydoc.patch
blobd5dc3d72f913938694fcd96347d7ad81adabec2b
1 Add an option to disable pydoc
3 It removes 0.5 MB of data from the target plus the pydoc script
4 itself.
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 | 6 +++++-
11 configure.in | 5 +++++
12 setup.py | 10 +++++++---
13 3 files changed, 17 insertions(+), 4 deletions(-)
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)
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
32 +ifeq (@PYDOC@,yes)
33 +LIBSUBDIRS += pydoc_data
34 +endif
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)
47 +AC_SUBST(PYDOC)
49 +AC_ARG_ENABLE(pydoc,
50 + AS_HELP_STRING([--disable-pydoc], [disable pydoc]),
51 + [ PYDOC="${enableval}" ], [ PYDOC=yes ])
53 AC_SUBST(TEST_MODULES)
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)
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' ]
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'])],
75 # Scripts to install
76 - scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
77 - 'Tools/scripts/2to3',
78 - 'Lib/smtpd.py']
79 + scripts = scripts,
82 # --install-platlib