2
1

python-2.7-104-optional-tk.patch 1.9 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: Python-2.7.2/Makefile.pre.in
  9. ===================================================================
  10. --- Python-2.7.2.orig/Makefile.pre.in
  11. +++ Python-2.7.2/Makefile.pre.in
  12. @@ -856,7 +856,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 site-packages \
  17. +LIBSUBDIRS= site-packages \
  18. encodings compiler hotshot \
  19. email email/mime \
  20. json \
  21. @@ -870,8 +870,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/cjkencodings test/decimaltestdata test/xmltestdata test/subprocessdata \
  28. test/tracedmodules email/test email/test/data \
  29. json/tests sqlite3/test bsddb/test \
  30. @@ -899,6 +898,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) $(srcdir)/Modules/xxmodule.c
  42. @for i in $(SCRIPTDIR) $(LIBDEST); \
  43. do \
  44. Index: Python-2.7.2/configure.in
  45. ===================================================================
  46. --- Python-2.7.2.orig/configure.in
  47. +++ Python-2.7.2/configure.in
  48. @@ -2416,6 +2416,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,