f402e420fa2569e405b32cacd5ac2f353df8a86a
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / python / 104-optional-tk.patch
1 Add an option to disable the tk module
2
3 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
4 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
5
6 ---
7  Makefile.pre.in |   14 ++++++++++----
8  configure.in    |    9 +++++++++
9  2 files changed, 19 insertions(+), 4 deletions(-)
10
11 Index: b/Makefile.pre.in
12 ===================================================================
13 --- a/Makefile.pre.in
14 +++ b/Makefile.pre.in
15 @@ -960,7 +960,7 @@
16         plat-mac/lib-scriptpackages/SystemEvents \
17         plat-mac/lib-scriptpackages/Terminal
18  PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
19 -LIBSUBDIRS=    lib-tk site-packages \
20 +LIBSUBDIRS=    site-packages \
21                 encodings compiler hotshot \
22                 email email/mime \
23                 ensurepip ensurepip/_bundled \
24 @@ -974,8 +974,7 @@
25                 lib-old \
26                 curses $(MACHDEPS)
27  
28 -TESTSUBDIRS = lib-tk/test lib-tk/test/test_tkinter \
29 -       lib-tk/test/test_ttk test test/audiodata test/capath test/data \
30 +TESTSUBDIRS = test test/audiodata test/capath test/data \
31         test/cjkencodings test/decimaltestdata test/xmltestdata \
32         test/imghdrdata \
33         test/subprocessdata \
34 @@ -1009,6 +1008,12 @@
35  TESTSUBDIRS += sqlite3/test
36  endif
37  
38 +ifeq (@TK@,yes)
39 +LIBSUBDIRS += lib-tk
40 +TESTSUBDIRS += lib-tk/test lib-tk/test/test_tkinter    \
41 +             lib-tk/test/test_ttk
42 +endif
43 +
44  libinstall:    build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
45         @for i in $(SCRIPTDIR) $(LIBDEST); \
46         do \
47 Index: b/configure.ac
48 ===================================================================
49 --- a/configure.ac
50 +++ b/configure.ac
51 @@ -2636,6 +2636,15 @@
52     DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
53  fi
54  
55 +AC_SUBST(TK)
56 +AC_ARG_ENABLE(tk,
57 +       AS_HELP_STRING([--disable-tk], [disable tk]),
58 +       [ TK="${enableval}" ], [ TK=yes ])
59 +
60 +if test "$TK" = "no"; then
61 +   DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter"
62 +fi
63 +
64  AC_SUBST(PYDOC)
65  
66  AC_ARG_ENABLE(pydoc,