python-104-optional-tk.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. @@ -934,8 +934,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 \
  17. - site-packages \
  18. +LIBSUBDIRS= site-packages \
  19. encodings compiler hotshot \
  20. email email/mime \
  21. json \
  22. @@ -947,9 +946,7 @@
  23. lib-old \
  24. curses $(MACHDEPS)
  25. -TESTSUBDIRS = lib-tk/test lib-tk/test/test_tkinter \
  26. - lib-tk/test/test_ttk \
  27. - test test/audiodata test/data \
  28. +TESTSUBDIRS = test test/audiodata test/data \
  29. test/cjkencodings test/decimaltestdata test/xmltestdata test/subprocessdata \
  30. test/tracedmodules \
  31. email/test email/test/data \
  32. @@ -980,6 +977,12 @@
  33. TESTSUBDIRS += sqlite3/test
  34. endif
  35. +ifeq (@TK@,yes)
  36. +LIBSUBDIRS += lib-tk
  37. +TESTSUBDIRS += lib-tk/test lib-tk/test/test_tkinter \
  38. + lib-tk/test/test_ttk
  39. +endif
  40. +
  41. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  42. @for i in $(SCRIPTDIR) $(LIBDEST); \
  43. do \
  44. Index: b/configure.ac
  45. ===================================================================
  46. --- a/configure.ac
  47. +++ b/configure.ac
  48. @@ -2622,6 +2622,15 @@
  49. DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
  50. fi
  51. +AC_SUBST(TK)
  52. +AC_ARG_ENABLE(tk,
  53. + AS_HELP_STRING([--disable-tk], [disable tk]),
  54. + [ TK="${enableval}" ], [ TK=yes ])
  55. +
  56. +if test "$TK" = "no"; then
  57. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter"
  58. +fi
  59. +
  60. AC_SUBST(PYDOC)
  61. AC_ARG_ENABLE(pydoc,