python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / python / 0017-Add-an-option-to-disable-pydoc.patch
blob18582f189ea954684287bba7a8605ed843a0ec20
1 From 52463745b6c46a46a6f2e2bc17983bb3f7bdac6e Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Tue, 7 Mar 2017 22:27:34 +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 | 6 +++++-
13 configure.ac | 5 +++++
14 setup.py | 10 +++++++---
15 3 files changed, 17 insertions(+), 4 deletions(-)
17 diff --git a/Makefile.pre.in b/Makefile.pre.in
18 index 280cc4e..84d5fc6 100644
19 --- a/Makefile.pre.in
20 +++ b/Makefile.pre.in
21 @@ -1052,7 +1052,7 @@ LIBSUBDIRS= lib-tk site-packages \
22 multiprocessing multiprocessing/dummy \
23 unittest \
24 lib-old \
25 - curses pydoc_data $(MACHDEPS)
26 + curses $(MACHDEPS)
28 TESTSUBDIRS = lib-tk/test lib-tk/test/test_tkinter \
29 lib-tk/test/test_ttk test test/audiodata test/capath test/data \
30 @@ -1075,6 +1075,10 @@ ifeq (@TEST_MODULES@,yes)
31 LIBSUBDIRS += $(TESTSUBDIRS)
32 endif
34 +ifeq (@PYDOC@,yes)
35 +LIBSUBDIRS += pydoc_data
36 +endif
38 libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
39 @for i in $(SCRIPTDIR) $(LIBDEST); \
40 do \
41 diff --git a/configure.ac b/configure.ac
42 index a1a35f6..8bab160 100644
43 --- a/configure.ac
44 +++ b/configure.ac
45 @@ -2805,6 +2805,11 @@ if test "$posix_threads" = "yes"; then
46 AC_CHECK_FUNCS(pthread_atfork)
49 +AC_SUBST(PYDOC)
51 +AC_ARG_ENABLE(pydoc,
52 + AS_HELP_STRING([--disable-pydoc], [disable pydoc]),
53 + [ PYDOC="${enableval}" ], [ PYDOC=yes ])
55 AC_SUBST(TEST_MODULES)
57 diff --git a/setup.py b/setup.py
58 index 9a5c2b8..69771e2 100644
59 --- a/setup.py
60 +++ b/setup.py
61 @@ -2233,6 +2233,12 @@ def main():
62 # turn off warnings when deprecated modules are imported
63 import warnings
64 warnings.filterwarnings("ignore",category=DeprecationWarning)
66 + scripts = ['Tools/scripts/idle', 'Tools/scripts/2to3',
67 + 'Lib/smtpd.py']
68 + if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
69 + scripts += [ 'Tools/scripts/pydoc' ]
71 setup(# PyPI Metadata (PEP 301)
72 name = "Python",
73 version = sys.version.split()[0],
74 @@ -2253,9 +2259,7 @@ def main():
75 ext_modules=[Extension('_struct', ['_struct.c'])],
77 # Scripts to install
78 - scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
79 - 'Tools/scripts/2to3',
80 - 'Lib/smtpd.py']
81 + scripts = scripts,
84 # --install-platlib
85 --
86 2.7.4