janus-gateway: make echo test plugin optional
[buildroot-gz.git] / package / python3 / 0018-Add-an-option-to-disable-pydoc.patch
blob670ad40c5e7a5e66e014bb166683cbf26597054d
1 From a83b79b964700604de386800f86e5a55f53a0e17 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 23 Dec 2015 11:47:11 +0100
4 Subject: [PATCH] Add an option to disable pydoc
6 It removes 0.5 MB of data from the target plus the pydoc script
7 itself.
9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
11 ---
12 Makefile.pre.in | 8 +++++++-
13 configure.ac | 5 +++++
14 setup.py | 9 +++++++--
15 3 files changed, 19 insertions(+), 3 deletions(-)
17 diff --git a/Makefile.pre.in b/Makefile.pre.in
18 index d4c771a..a98ad65 100644
19 --- a/Makefile.pre.in
20 +++ b/Makefile.pre.in
21 @@ -1134,7 +1134,9 @@ bininstall: altbininstall
22 -rm -f $(DESTDIR)$(BINDIR)/idle3
23 (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
24 -rm -f $(DESTDIR)$(BINDIR)/pydoc3
25 +ifeq (@PYDOC@,yes)
26 (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
27 +endif
28 -rm -f $(DESTDIR)$(BINDIR)/2to3
29 (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3)
30 -rm -f $(DESTDIR)$(BINDIR)/pyvenv
31 @@ -1184,7 +1186,7 @@ LIBSUBDIRS= tkinter \
32 multiprocessing multiprocessing/dummy \
33 unittest \
34 venv venv/scripts venv/scripts/posix \
35 - curses pydoc_data $(MACHDEPS)
36 + curses $(MACHDEPS)
38 TESTSUBDIRS = tkinter/test tkinter/test/test_tkinter tkinter/test/test_ttk \
39 test test/test_asyncio \
40 @@ -1233,6 +1235,10 @@ TESTSUBDIRS = tkinter/test tkinter/test/test_tkinter tkinter/test/test_ttk \
41 test/test_importlib/import_ test/test_importlib/source \
42 unittest/test unittest/test/testmock
44 +ifeq (@PYDOC@,yes)
45 +LIBSUBDIRS += pydoc_data
46 +endif
48 ifeq (@TEST_MODULES@,yes)
49 LIBSUBDIRS += $(TESTSUBDIRS)
50 endif
51 diff --git a/configure.ac b/configure.ac
52 index 9f3d226..e9b6d6f 100644
53 --- a/configure.ac
54 +++ b/configure.ac
55 @@ -2894,6 +2894,11 @@ if test "$posix_threads" = "yes"; then
56 AC_CHECK_FUNCS(pthread_atfork)
59 +AC_SUBST(PYDOC)
61 +AC_ARG_ENABLE(pydoc,
62 + AS_HELP_STRING([--disable-pydoc], [disable pydoc]),
63 + [ PYDOC="${enableval}" ], [ PYDOC=yes ])
65 AC_SUBST(TEST_MODULES)
67 diff --git a/setup.py b/setup.py
68 index 3feca04..137911d 100644
69 --- a/setup.py
70 +++ b/setup.py
71 @@ -2220,6 +2220,12 @@ def main():
72 # turn off warnings when deprecated modules are imported
73 import warnings
74 warnings.filterwarnings("ignore",category=DeprecationWarning)
76 + scripts = ['Tools/scripts/idle3', 'Tools/scripts/2to3',
77 + 'Lib/smtpd.py']
78 + if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
79 + scripts += [ 'Tools/scripts/pydoc3' ]
81 setup(# PyPI Metadata (PEP 301)
82 name = "Python",
83 version = sys.version.split()[0],
84 @@ -2244,8 +2250,7 @@ def main():
85 # If you change the scripts installed here, you also need to
86 # check the PyBuildScripts command above, and change the links
87 # created by the bininstall target in Makefile.pre.in
88 - scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
89 - "Tools/scripts/2to3", "Tools/scripts/pyvenv"]
90 + scripts = scripts,
93 # --install-platlib
94 --
95 2.6.4