package/dhcp/S80dhcp-server: allow empty INTERFACES
[buildroot-gz.git] / package / python3 / 101-optional-pydoc.patch
bloba1b63d591a44eb5713540ffbee1a12b5196854d1
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 | 8 +++++++-
11 configure.ac | 5 +++++
12 setup.py | 9 +++++++--
13 3 files changed, 19 insertions(+), 3 deletions(-)
15 Index: b/Makefile.pre.in
16 ===================================================================
17 --- a/Makefile.pre.in
18 +++ b/Makefile.pre.in
19 @@ -1103,7 +1103,9 @@
20 -rm -f $(DESTDIR)$(BINDIR)/idle3
21 (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
22 -rm -f $(DESTDIR)$(BINDIR)/pydoc3
23 +ifeq (@PYDOC@,yes)
24 (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
25 +endif
26 -rm -f $(DESTDIR)$(BINDIR)/2to3
27 (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3)
28 -rm -f $(DESTDIR)$(BINDIR)/pyvenv
29 @@ -1154,7 +1156,7 @@
30 multiprocessing multiprocessing/dummy \
31 unittest \
32 venv venv/scripts venv/scripts/posix \
33 - curses pydoc_data $(MACHDEPS)
34 + curses $(MACHDEPS)
36 TESTSUBDIRS = tkinter/test tkinter/test/test_tkinter tkinter/test/test_ttk \
37 test test/test_asyncio \
38 @@ -1198,6 +1200,10 @@
39 test/test_importlib/import_ test/test_importlib/source \
40 unittest/test unittest/test/testmock
42 +ifeq (@PYDOC@,yes)
43 +LIBSUBDIRS += pydoc_data
44 +endif
46 ifeq (@TEST_MODULES@,yes)
47 LIBSUBDIRS += $(TESTSUBDIRS)
48 endif
49 Index: b/configure.ac
50 ===================================================================
51 --- a/configure.ac
52 +++ b/configure.ac
53 @@ -2675,6 +2675,11 @@
54 AC_CHECK_FUNCS(pthread_atfork)
57 +AC_SUBST(PYDOC)
59 +AC_ARG_ENABLE(pydoc,
60 + AS_HELP_STRING([--disable-pydoc], [disable pydoc]),
61 + [ PYDOC="${enableval}" ], [ PYDOC=yes ])
63 AC_SUBST(TEST_MODULES)
65 Index: b/setup.py
66 ===================================================================
67 --- a/setup.py
68 +++ b/setup.py
69 @@ -2200,6 +2200,12 @@
70 # turn off warnings when deprecated modules are imported
71 import warnings
72 warnings.filterwarnings("ignore",category=DeprecationWarning)
74 + scripts = ['Tools/scripts/idle3', 'Tools/scripts/2to3',
75 + 'Lib/smtpd.py']
76 + if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
77 + scripts += [ 'Tools/scripts/pydoc3' ]
79 setup(# PyPI Metadata (PEP 301)
80 name = "Python",
81 version = sys.version.split()[0],
82 @@ -2224,8 +2230,7 @@
83 # If you change the scripts installed here, you also need to
84 # check the PyBuildScripts command above, and change the links
85 # created by the bininstall target in Makefile.pre.in
86 - scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
87 - "Tools/scripts/2to3", "Tools/scripts/pyvenv"]
88 + scripts = scripts,
91 # --install-platlib