python-2.7-104-optional-tk.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.2/Makefile.pre.in
  8. ===================================================================
  9. --- Python-2.7.2.orig/Makefile.pre.in
  10. +++ Python-2.7.2/Makefile.pre.in
  11. @@ -856,7 +856,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 site-packages \
  16. +LIBSUBDIRS= site-packages \
  17. encodings compiler hotshot \
  18. email email/mime \
  19. json \
  20. @@ -870,8 +870,7 @@
  21. curses $(MACHDEPS)
  22. ifeq (@TEST_MODULES@,yes)
  23. -LIBSUBDIRS += lib-tk/test lib-tk/test/test_tkinter \
  24. - lib-tk/test/test_ttk test test/data \
  25. +LIBSUBDIRS += test test/data \
  26. test/cjkencodings test/decimaltestdata test/xmltestdata test/subprocessdata \
  27. test/tracedmodules email/test email/test/data \
  28. json/tests sqlite3/test bsddb/test \
  29. @@ -899,6 +898,14 @@
  30. endif
  31. endif
  32. +ifeq (@TK@,yes)
  33. +LIBSUBDIRS += lib-tk
  34. +ifeq (@TEST_MODULES@,yes)
  35. +LIBSUBDIRS += lib-tk/test lib-tk/test/test_tkinter \
  36. + lib-tk/test/test_ttk
  37. +endif
  38. +endif
  39. +
  40. libinstall: build_all $(srcdir)/Lib/$(PLATDIR)
  41. @for i in $(SCRIPTDIR) $(LIBDEST); \
  42. do \
  43. Index: Python-2.7.2/configure.in
  44. ===================================================================
  45. --- Python-2.7.2.orig/configure.in
  46. +++ Python-2.7.2/configure.in
  47. @@ -2416,6 +2416,15 @@
  48. DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
  49. fi
  50. +AC_SUBST(TK)
  51. +AC_ARG_ENABLE(tk,
  52. + AS_HELP_STRING([--disable-tk], [disable tk]),
  53. + [ TK="${enableval}" ], [ TK=yes ])
  54. +
  55. +if test "$TK" = "no"; then
  56. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter"
  57. +fi
  58. +
  59. AC_SUBST(PYDOC)
  60. AC_ARG_ENABLE(pydoc,