0008-Add-an-option-to-disable-the-tk-module.patch 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. From 7ce7f1c5bc94e7609fe1a7317f8094892cf3c43e 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. [ Bernd Kuhls: ported to Python 3.11.4]
  12. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  13. [ Adam Duskett: ported to Python 3.12.1 ]
  14. Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
  15. [ Marcus Hoffmann: ported to Python 3.12.10 ]
  16. Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu>
  17. ---
  18. Makefile.pre.in | 8 +++++---
  19. configure.ac | 7 +++++++
  20. 2 files changed, 12 insertions(+), 3 deletions(-)
  21. diff --git a/Makefile.pre.in b/Makefile.pre.in
  22. index 42f665e12b3..01e62203cd5 100644
  23. --- a/Makefile.pre.in
  24. +++ b/Makefile.pre.in
  25. @@ -2108,7 +2108,6 @@ LIBSUBDIRS= asyncio \
  26. multiprocessing multiprocessing/dummy \
  27. re \
  28. site-packages \
  29. - tkinter \
  30. tomllib \
  31. turtledemo \
  32. unittest \
  33. @@ -2214,7 +2213,6 @@ TESTSUBDIRS= idlelib/idle_test \
  34. test/test_peg_generator \
  35. test/test_pydoc \
  36. test/test_sqlite3 \
  37. - test/test_tkinter \
  38. test/test_tomllib \
  39. test/test_tomllib/data \
  40. test/test_tomllib/data/invalid \
  41. @@ -2236,7 +2234,6 @@ TESTSUBDIRS= idlelib/idle_test \
  42. test/test_tools \
  43. test/test_tools/i18n_data \
  44. test/test_tools/msgfmt_data \
  45. - test/test_ttk \
  46. test/test_unittest \
  47. test/test_unittest/testmock \
  48. test/test_warnings \
  49. @@ -2261,6 +2258,11 @@ TESTSUBDIRS= idlelib/idle_test \
  50. test/test_multiprocessing_forkserver \
  51. test/test_multiprocessing_spawn
  52. +ifeq (@TK@,yes)
  53. +LIBSUBDIRS += tkinter
  54. +TESTSUBDIRS += test/test_tkinter test/test_ttk
  55. +endif
  56. +
  57. COMPILEALL_OPTS=-j0
  58. ifeq (@PYDOC@,yes)
  59. diff --git a/configure.ac b/configure.ac
  60. index b2a60b7865f..23db7446cdc 100644
  61. --- a/configure.ac
  62. +++ b/configure.ac
  63. @@ -4553,6 +4553,13 @@ AC_ARG_ENABLE(pydoc,
  64. AS_HELP_STRING([--disable-pydoc], [disable pydoc]),
  65. [ PYDOC="${enableval}" ], [ PYDOC=yes ])
  66. +AC_SUBST(TK)
  67. +AC_ARG_ENABLE(tk,
  68. + AS_HELP_STRING([--disable-tk], [disable tk]),
  69. + [ TK="${enableval}" ], [ TK=yes ])
  70. +AS_IF([test "$TK" = "no"],
  71. + [PY_STDLIB_MOD_SET_NA([_tkinter])])
  72. +
  73. # Check for enable-ipv6
  74. AH_TEMPLATE([ENABLE_IPV6], [Define if --enable-ipv6 is specified])
  75. AC_MSG_CHECKING([if --enable-ipv6 is specified])
  76. --
  77. 2.43.0