python3-104-optional-tk.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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: cpython/Makefile.pre.in
  9. ===================================================================
  10. --- cpython.orig/Makefile.pre.in
  11. +++ cpython/Makefile.pre.in
  12. @@ -980,7 +980,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. collections concurrent concurrent/futures encodings \
  20. email email/mime \
  21. @@ -996,8 +996,7 @@
  22. curses $(MACHDEPS)
  23. ifeq (@TEST_MODULES@,yes)
  24. -LIBSUBDIRS += tkinter/test tkinter/test/test_tkinter \
  25. - tkinter/test/test_ttk test \
  26. +LIBSUBDIRS += test \
  27. test/capath test/data \
  28. test/cjkencodings test/decimaltestdata test/xmltestdata \
  29. test/subprocessdata test/sndhdrdata \
  30. @@ -1053,6 +1052,15 @@
  31. endif
  32. endif
  33. +ifeq (@TK@,yes)
  34. +LIBSUBDIRS += tkinter
  35. +ifeq (@TEST_MODULES@,yes)
  36. +LIBSUBDIRS += \
  37. + tkinter/test tkinter/test/test_tkinter \
  38. + tkinter/test/test_ttk
  39. +endif
  40. +endif
  41. +
  42. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  43. @for i in $(SCRIPTDIR) $(LIBDEST); \
  44. do \
  45. Index: cpython/configure.ac
  46. ===================================================================
  47. --- cpython.orig/configure.ac
  48. +++ cpython/configure.ac
  49. @@ -2457,6 +2457,15 @@
  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,