0020-Add-an-option-to-disable-the-tk-module.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From f0dc1198360c6875ed846a961e85dc41e239aa29 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Tue, 7 Mar 2017 22:28:57 +0100
  4. Subject: [PATCH] Add an option to disable the tk module
  5. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  6. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  7. [Peter: update for 2.7.16]
  8. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  9. ---
  10. Makefile.pre.in | 11 ++++++++---
  11. configure.ac | 9 +++++++++
  12. 2 files changed, 17 insertions(+), 3 deletions(-)
  13. diff --git a/Makefile.pre.in b/Makefile.pre.in
  14. index a2e5ac6d41..37ed70ab1d 100644
  15. --- a/Makefile.pre.in
  16. +++ b/Makefile.pre.in
  17. @@ -1048,7 +1048,7 @@ PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
  18. plat-mac/lib-scriptpackages/SystemEvents \
  19. plat-mac/lib-scriptpackages/Terminal
  20. PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
  21. -LIBSUBDIRS= lib-tk site-packages \
  22. +LIBSUBDIRS= site-packages \
  23. encodings compiler hotshot \
  24. email email/mime \
  25. ensurepip ensurepip/_bundled \
  26. @@ -1062,8 +1062,7 @@ LIBSUBDIRS= lib-tk site-packages \
  27. lib-old \
  28. curses $(MACHDEPS)
  29. -TESTSUBDIRS = lib-tk/test lib-tk/test/test_tkinter \
  30. - lib-tk/test/test_ttk test test/audiodata test/capath test/data \
  31. +TESTSUBDIRS = test test/audiodata test/capath test/data \
  32. test/cjkencodings test/decimaltestdata test/xmltestdata \
  33. test/imghdrdata \
  34. test/subprocessdata \
  35. @@ -1098,6 +1097,12 @@ LIBSUBDIRS += sqlite3
  36. TESTSUBDIRS += sqlite3/test
  37. endif
  38. +ifeq (@TK@,yes)
  39. +LIBSUBDIRS += lib-tk
  40. +TESTSUBDIRS += lib-tk/test lib-tk/test/test_tkinter \
  41. + lib-tk/test/test_ttk
  42. +endif
  43. +
  44. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  45. @for i in $(SCRIPTDIR) $(LIBDEST); \
  46. do \
  47. diff --git a/configure.ac b/configure.ac
  48. index 4ee3c60501..2c20f826c5 100644
  49. --- a/configure.ac
  50. +++ b/configure.ac
  51. @@ -2843,6 +2843,15 @@ if test "$SQLITE3" = "no" ; then
  52. DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
  53. fi
  54. +AC_SUBST(TK)
  55. +AC_ARG_ENABLE(tk,
  56. + AS_HELP_STRING([--disable-tk], [disable tk]),
  57. + [ TK="${enableval}" ], [ TK=yes ])
  58. +
  59. +if test "$TK" = "no"; then
  60. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter"
  61. +fi
  62. +
  63. AC_SUBST(PYDOC)
  64. AC_ARG_ENABLE(pydoc,
  65. --
  66. 2.11.0