0014-Add-an-option-to-disable-the-tk-module.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. From ad6b66b34f71ff6b60b3be5f6fd3e781cdeecd59 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Wed, 22 Feb 2017 17:23:42 -0800
  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. [ Andrey Smirnov: ported to Python 3.6 ]
  8. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
  9. [ Adam Duskett: ported to Python 3.10.0 ]
  10. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  11. ---
  12. Makefile.pre.in | 10 +++++++---
  13. configure.ac | 9 +++++++++
  14. 2 files changed, 16 insertions(+), 3 deletions(-)
  15. diff --git a/Makefile.pre.in b/Makefile.pre.in
  16. index 5628860..c968113 100644
  17. --- a/Makefile.pre.in
  18. +++ b/Makefile.pre.in
  19. @@ -1446,7 +1446,6 @@ LIBSUBDIRS= asyncio \
  20. logging \
  21. multiprocessing multiprocessing/dummy \
  22. site-packages \
  23. - tkinter \
  24. turtledemo \
  25. unittest \
  26. urllib \
  27. @@ -1522,8 +1521,6 @@ TESTSUBDIRS= ctypes/test \
  28. test/tracedmodules \
  29. test/xmltestdata test/xmltestdata/c14n-20 \
  30. test/ziptestdata \
  31. - tkinter/test tkinter/test/test_tkinter \
  32. - tkinter/test/test_ttk \
  33. unittest/test unittest/test/testmock
  34. ifeq (@PYDOC@,yes)
  35. @@ -1543,6 +1540,13 @@ LIBSUBDIRS += sqlite3
  36. TESTSUBDIRS += sqlite3/test
  37. endif
  38. +ifeq (@TK@,yes)
  39. +LIBSUBDIRS += tkinter
  40. +TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \
  41. + tkinter/test/test_ttk
  42. +endif
  43. +
  44. +
  45. TEST_MODULES=@TEST_MODULES@
  46. libinstall: build_all $(srcdir)/Modules/xxmodule.c
  47. @for i in $(SCRIPTDIR) $(LIBDEST); \
  48. diff --git a/configure.ac b/configure.ac
  49. index dfee472..dc76dff 100644
  50. --- a/configure.ac
  51. +++ b/configure.ac
  52. @@ -3382,6 +3382,15 @@ if test "$SQLITE3" = "no" ; then
  53. DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
  54. fi
  55. +AC_SUBST(TK)
  56. +AC_ARG_ENABLE(tk,
  57. + AS_HELP_STRING([--disable-tk], [disable tk]),
  58. + [ TK="${enableval}" ], [ TK=yes ])
  59. +
  60. +if test "$TK" = "no"; then
  61. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter"
  62. +fi
  63. +
  64. AC_SUBST(PYDOC)
  65. AC_ARG_ENABLE(pydoc,
  66. --
  67. 2.30.2