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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. From c1ec9fa46cd7679fd009f66a3ebed8de95d84f10 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. ---
  16. Makefile.pre.in | 8 +++++---
  17. configure.ac | 7 +++++++
  18. 2 files changed, 12 insertions(+), 3 deletions(-)
  19. diff --git a/Makefile.pre.in b/Makefile.pre.in
  20. index 7b6c9811a6..6d9527ddd0 100644
  21. --- a/Makefile.pre.in
  22. +++ b/Makefile.pre.in
  23. @@ -2108,7 +2108,6 @@ LIBSUBDIRS= asyncio \
  24. multiprocessing multiprocessing/dummy \
  25. re \
  26. site-packages \
  27. - tkinter \
  28. tomllib \
  29. turtledemo \
  30. unittest \
  31. @@ -2212,7 +2211,6 @@ TESTSUBDIRS= idlelib/idle_test \
  32. test/test_peg_generator \
  33. test/test_pydoc \
  34. test/test_sqlite3 \
  35. - test/test_tkinter \
  36. test/test_tomllib \
  37. test/test_tomllib/data \
  38. test/test_tomllib/data/invalid \
  39. @@ -2232,7 +2230,6 @@ TESTSUBDIRS= idlelib/idle_test \
  40. test/test_tomllib/data/valid/dates-and-times \
  41. test/test_tomllib/data/valid/multiline-basic-str \
  42. test/test_tools \
  43. - test/test_ttk \
  44. test/test_unittest \
  45. test/test_unittest/testmock \
  46. test/test_warnings \
  47. @@ -2253,6 +2250,11 @@ TESTSUBDIRS= idlelib/idle_test \
  48. test/test_multiprocessing_forkserver \
  49. test/test_multiprocessing_spawn
  50. +ifeq (@TK@,yes)
  51. +LIBSUBDIRS += tkinter
  52. +TESTSUBDIRS += test/test_tkinter test/test_ttk
  53. +endif
  54. +
  55. COMPILEALL_OPTS=-j0
  56. ifeq (@PYDOC@,yes)
  57. diff --git a/configure.ac b/configure.ac
  58. index d1c54bd67c..4c5cbe4153 100644
  59. --- a/configure.ac
  60. +++ b/configure.ac
  61. @@ -4529,6 +4529,13 @@ AC_ARG_ENABLE(pydoc,
  62. AS_HELP_STRING([--disable-pydoc], [disable pydoc]),
  63. [ PYDOC="${enableval}" ], [ PYDOC=yes ])
  64. +AC_SUBST(TK)
  65. +AC_ARG_ENABLE(tk,
  66. + AS_HELP_STRING([--disable-tk], [disable tk]),
  67. + [ TK="${enableval}" ], [ TK=yes ])
  68. +AS_IF([test "$TK" = "no"],
  69. + [PY_STDLIB_MOD_SET_NA([_tkinter])])
  70. +
  71. # Check for enable-ipv6
  72. AH_TEMPLATE([ENABLE_IPV6], [Define if --enable-ipv6 is specified])
  73. AC_MSG_CHECKING([if --enable-ipv6 is specified])
  74. --
  75. 2.34.1