104-optional-tk.patch 1.7 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.ac | 9 +++++++++
  7. 2 files changed, 20 insertions(+), 3 deletions(-)
  8. Index: b/Makefile.pre.in
  9. ===================================================================
  10. --- a/Makefile.pre.in
  11. +++ b/Makefile.pre.in
  12. @@ -1140,7 +1140,7 @@
  13. EXTRAPLATDIR= @EXTRAPLATDIR@
  14. MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR)
  15. XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
  16. -LIBSUBDIRS= tkinter \
  17. +LIBSUBDIRS= \
  18. site-packages \
  19. asyncio \
  20. collections concurrent concurrent/futures encodings \
  21. @@ -1158,8 +1158,7 @@
  22. venv venv/scripts venv/scripts/posix \
  23. curses $(MACHDEPS)
  24. -TESTSUBDIRS = tkinter/test tkinter/test/test_tkinter tkinter/test/test_ttk \
  25. - test test/test_asyncio \
  26. +TESTSUBDIRS = test test/test_asyncio \
  27. test/test_email test/test_email/data \
  28. test/test_json \
  29. test/audiodata \
  30. @@ -1213,6 +1212,12 @@
  31. TESTSUBDIRS += sqlite3/test
  32. endif
  33. +ifeq (@TK@,yes)
  34. +LIBSUBDIRS += tkinter
  35. +TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \
  36. + tkinter/test/test_ttk
  37. +endif
  38. +
  39. ifeq (@TEST_MODULES@,yes)
  40. LIBSUBDIRS += $(TESTSUBDIRS)
  41. endif
  42. Index: b/configure.ac
  43. ===================================================================
  44. --- a/configure.ac
  45. +++ b/configure.ac
  46. @@ -2684,6 +2684,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,