]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/python3/0013-Add-an-option-to-disable-installation-of-test-module.patch
Revert "python3: bump to 2.6.4"
[coffee/buildroot.git] / package / python3 / 0013-Add-an-option-to-disable-installation-of-test-module.patch
1 From bba0896a05e6406076893dd2f4c3b330e41082a6 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 22 Feb 2017 17:01:18 -0800
4 Subject: [PATCH] Add an option to disable installation of test modules
5
6 The Python standard distribution comes with many test modules, that
7 are not necessarly useful on embedded targets.
8
9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
11 [ Andrey Smirnov: ported to Python 3.6 ]
12 Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
13 ---
14  Makefile.pre.in | 55 ++++++++++++++++++++++++++++++++++++-------------------
15  configure.ac    |  5 +++++
16  2 files changed, 41 insertions(+), 19 deletions(-)
17
18 diff --git a/Makefile.pre.in b/Makefile.pre.in
19 index 4ce917ab8d..4110fff4ac 100644
20 --- a/Makefile.pre.in
21 +++ b/Makefile.pre.in
22 @@ -1194,8 +1194,28 @@ maninstall:      altmaninstall
23  
24  # Install the library
25  XMLLIBSUBDIRS=  xml xml/dom xml/etree xml/parsers xml/sax
26 -LIBSUBDIRS=    tkinter tkinter/test tkinter/test/test_tkinter \
27 -               tkinter/test/test_ttk site-packages test \
28 +
29 +LIBSUBDIRS=    tkinter site-packages \
30 +               asyncio \
31 +               collections concurrent concurrent/futures encodings \
32 +               email email/mime \
33 +               ensurepip ensurepip/_bundled \
34 +               html json http dbm xmlrpc \
35 +               sqlite3 \
36 +               logging csv wsgiref urllib \
37 +               lib2to3 lib2to3/fixes lib2to3/pgen2 \
38 +               ctypes ctypes/macholib \
39 +               idlelib idlelib/Icons \
40 +               distutils distutils/command $(XMLLIBSUBDIRS) \
41 +               importlib \
42 +               turtledemo \
43 +               multiprocessing multiprocessing/dummy \
44 +               unittest \
45 +               venv venv/scripts venv/scripts/common venv/scripts/posix \
46 +               curses pydoc_data
47 +
48 +TESTSUBDIRS=   tkinter/test tkinter/test/test_tkinter \
49 +               tkinter/test/test_ttk test \
50                 test/audiodata \
51                 test/capath test/data \
52                 test/cjkencodings test/decimaltestdata test/xmltestdata \
53 @@ -1229,29 +1249,26 @@ LIBSUBDIRS=     tkinter tkinter/test tkinter/test/test_tkinter \
54                 test/test_importlib/namespace_pkgs/project3/parent/child \
55                  test/test_importlib/namespace_pkgs/module_and_namespace_package \
56                  test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \
57 -               asyncio \
58                 test/test_asyncio \
59 -               collections concurrent concurrent/futures encodings \
60 -               email email/mime test/test_email test/test_email/data \
61 -               ensurepip ensurepip/_bundled \
62 -               html json test/test_json http dbm xmlrpc \
63 -               sqlite3 sqlite3/test \
64 -               logging csv wsgiref urllib \
65 -               lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
66 +               test/test_email test/test_email/data \
67 +               test/test_json \
68 +               sqlite3/test \
69 +               lib2to3/tests \
70                 lib2to3/tests/data lib2to3/tests/data/fixers \
71                 lib2to3/tests/data/fixers/myfixes \
72 -               ctypes ctypes/test ctypes/macholib \
73 -               idlelib idlelib/Icons idlelib/idle_test \
74 -               distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
75 -               importlib test/test_importlib test/test_importlib/builtin \
76 +               ctypes/test \
77 +               idlelib/idle_test \
78 +               distutils/tests \
79 +               test/test_importlib test/test_importlib/builtin \
80                 test/test_importlib/extension test/test_importlib/frozen \
81                 test/test_importlib/import_ test/test_importlib/source \
82                 test/test_tools test/test_warnings test/test_warnings/data \
83 -               turtledemo \
84 -               multiprocessing multiprocessing/dummy \
85 -               unittest unittest/test unittest/test/testmock \
86 -               venv venv/scripts venv/scripts/common venv/scripts/posix \
87 -               curses pydoc_data
88 +               unittest/test unittest/test/testmock
89 +
90 +ifeq (@TEST_MODULES@,yes)
91 +LIBSUBDIRS += $(TESTSUBDIRS)
92 +endif
93 +
94  libinstall:    build_all $(srcdir)/Modules/xxmodule.c
95         @for i in $(SCRIPTDIR) $(LIBDEST); \
96         do \
97 diff --git a/configure.ac b/configure.ac
98 index d5ee2aedfb..f924937fe1 100644
99 --- a/configure.ac
100 +++ b/configure.ac
101 @@ -3112,6 +3112,11 @@ if test "$posix_threads" = "yes"; then
102        AC_CHECK_FUNCS(pthread_atfork)
103  fi
104  
105 +AC_SUBST(TEST_MODULES)
106 +
107 +AC_ARG_ENABLE(test-modules,
108 +       AS_HELP_STRING([--disable-test-modules], [disable test modules]),
109 +       [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
110  
111  # Check for enable-ipv6
112  AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
113 -- 
114 2.13.5
115