python-2.7-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. ---
  4. Makefile.pre.in | 14 ++++++++++----
  5. configure.in | 9 +++++++++
  6. 2 files changed, 19 insertions(+), 4 deletions(-)
  7. Index: Python-2.7.1/Makefile.pre.in
  8. ===================================================================
  9. --- Python-2.7.1.orig/Makefile.pre.in
  10. +++ Python-2.7.1/Makefile.pre.in
  11. @@ -851,8 +851,7 @@
  12. plat-mac/lib-scriptpackages/SystemEvents \
  13. plat-mac/lib-scriptpackages/Terminal
  14. PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
  15. -LIBSUBDIRS= lib-tk \
  16. - site-packages \
  17. +LIBSUBDIRS= site-packages \
  18. encodings compiler hotshot \
  19. email email/mime \
  20. json \
  21. @@ -865,8 +864,7 @@
  22. curses $(MACHDEPS)
  23. ifeq (@TEST_MODULES@,yes)
  24. -LIBSUBDIRS += lib-tk/test lib-tk/test/test_tkinter \
  25. - lib-tk/test/test_ttk test test/data \
  26. +LIBSUBDIRS += test test/data \
  27. test/decimaltestdata test/xmltestdata \
  28. test/tracedmodules \
  29. email/test email/test/data \
  30. @@ -896,6 +894,14 @@
  31. endif
  32. endif
  33. +ifeq (@TK@,yes)
  34. +LIBSUBDIRS += lib-tk
  35. +ifeq (@TEST_MODULES@,yes)
  36. +LIBSUBDIRS += lib-tk/test lib-tk/test/test_tkinter \
  37. + lib-tk/test/test_ttk
  38. +endif
  39. +endif
  40. +
  41. libinstall: build_all $(srcdir)/Lib/$(PLATDIR)
  42. @for i in $(SCRIPTDIR) $(LIBDEST); \
  43. do \
  44. Index: Python-2.7.1/configure.in
  45. ===================================================================
  46. --- Python-2.7.1.orig/configure.in
  47. +++ Python-2.7.1/configure.in
  48. @@ -2401,6 +2401,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,