0020-Add-an-option-to-disable-the-tk-module.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. From 05fbe2527b6f87edeef11f288c36bcbaa378ca02 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Tue, 7 Mar 2017 22:28:57 +0100
  4. Subject: [PATCH] Add an option to disable the tk module
  5. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  6. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  7. ---
  8. Makefile.pre.in | 11 ++++++++---
  9. configure.ac | 9 +++++++++
  10. 2 files changed, 17 insertions(+), 3 deletions(-)
  11. diff --git a/Makefile.pre.in b/Makefile.pre.in
  12. index 974a052..f7f025f 100644
  13. --- a/Makefile.pre.in
  14. +++ b/Makefile.pre.in
  15. @@ -1038,7 +1038,7 @@ PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
  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. @@ -1052,8 +1052,7 @@ LIBSUBDIRS= lib-tk site-packages \
  25. lib-old \
  26. curses $(MACHDEPS)
  27. -TESTSUBDIRS = lib-tk/test lib-tk/test/test_tkinter \
  28. - lib-tk/test/test_ttk test test/audiodata test/capath test/data \
  29. +TESTSUBDIRS = test test/audiodata test/capath test/data \
  30. test/cjkencodings test/decimaltestdata test/xmltestdata \
  31. test/imghdrdata \
  32. test/subprocessdata \
  33. @@ -1087,6 +1086,12 @@ LIBSUBDIRS += sqlite3
  34. TESTSUBDIRS += sqlite3/test
  35. endif
  36. +ifeq (@TK@,yes)
  37. +LIBSUBDIRS += lib-tk
  38. +TESTSUBDIRS += lib-tk/test lib-tk/test/test_tkinter \
  39. + lib-tk/test/test_ttk
  40. +endif
  41. +
  42. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  43. @for i in $(SCRIPTDIR) $(LIBDEST); \
  44. do \
  45. diff --git a/configure.ac b/configure.ac
  46. index e9e1897..d0f032c 100644
  47. --- a/configure.ac
  48. +++ b/configure.ac
  49. @@ -2814,6 +2814,15 @@ if test "$SQLITE3" = "no" ; then
  50. DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
  51. fi
  52. +AC_SUBST(TK)
  53. +AC_ARG_ENABLE(tk,
  54. + AS_HELP_STRING([--disable-tk], [disable tk]),
  55. + [ TK="${enableval}" ], [ TK=yes ])
  56. +
  57. +if test "$TK" = "no"; then
  58. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter"
  59. +fi
  60. +
  61. AC_SUBST(PYDOC)
  62. AC_ARG_ENABLE(pydoc,
  63. --
  64. 2.7.4