104-optional-tk.patch 1.8 KB

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