0006-Add-an-option-to-disable-the-tk-module.patch 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. From bd14e6f232232c11b67477a5d8f0caf174a089d0 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. Upstream: N/A
  6. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  7. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  8. [ Andrey Smirnov: ported to Python 3.6 ]
  9. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
  10. [ Adam Duskett: ported to Python 3.10.0 ]
  11. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  12. [ Bernd Kuhls: ported to Python 3.11.4]
  13. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  14. [ Adam Duskett: ported to Python 3.12.1 ]
  15. Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
  16. [ Vincent Fazio: ported to Python 3.13.2 ]
  17. Signed-off-by: Vincent Fazio <vfazio@gmail.com>
  18. [ Vincent Fazio: fix Python 3.13.3 conflict ]
  19. Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
  20. ---
  21. Makefile.pre.in | 8 +++++---
  22. configure.ac | 7 +++++++
  23. 2 files changed, 12 insertions(+), 3 deletions(-)
  24. diff --git a/Makefile.pre.in b/Makefile.pre.in
  25. index 0f394d6ece4..a44307a0fb1 100644
  26. --- a/Makefile.pre.in
  27. +++ b/Makefile.pre.in
  28. @@ -2331,7 +2331,6 @@ LIBSUBDIRS= asyncio \
  29. re \
  30. site-packages \
  31. sysconfig \
  32. - tkinter \
  33. tomllib \
  34. turtledemo \
  35. unittest \
  36. @@ -2439,7 +2438,6 @@ TESTSUBDIRS= idlelib/idle_test \
  37. test/test_pydoc \
  38. test/test_pyrepl \
  39. test/test_sqlite3 \
  40. - test/test_tkinter \
  41. test/test_tomllib \
  42. test/test_tomllib/data \
  43. test/test_tomllib/data/invalid \
  44. @@ -2461,7 +2459,6 @@ TESTSUBDIRS= idlelib/idle_test \
  45. test/test_tools \
  46. test/test_tools/i18n_data \
  47. test/test_tools/msgfmt_data \
  48. - test/test_ttk \
  49. test/test_unittest \
  50. test/test_unittest/testmock \
  51. test/test_warnings \
  52. @@ -2483,6 +2480,11 @@ TESTSUBDIRS= idlelib/idle_test \
  53. test/xmltestdata/c14n-20 \
  54. test/zipimport_data
  55. +ifeq (@TK@,yes)
  56. +LIBSUBDIRS += tkinter
  57. +TESTSUBDIRS += test/test_tkinter test/test_ttk
  58. +endif
  59. +
  60. COMPILEALL_OPTS=-j0
  61. ifeq (@PYDOC@,yes)
  62. diff --git a/configure.ac b/configure.ac
  63. index b6d5bb3d9c5..a1a91e094cd 100644
  64. --- a/configure.ac
  65. +++ b/configure.ac
  66. @@ -4680,6 +4680,13 @@ AC_ARG_ENABLE(pydoc,
  67. AS_HELP_STRING([--disable-pydoc], [disable pydoc]),
  68. [ PYDOC="${enableval}" ], [ PYDOC=yes ])
  69. +AC_SUBST(TK)
  70. +AC_ARG_ENABLE(tk,
  71. + AS_HELP_STRING([--disable-tk], [disable tk]),
  72. + [ TK="${enableval}" ], [ TK=yes ])
  73. +AS_IF([test "$TK" = "no"],
  74. + [PY_STDLIB_MOD_SET_NA([_tkinter])])
  75. +
  76. # Check for enable-ipv6
  77. AH_TEMPLATE([ENABLE_IPV6], [Define if --enable-ipv6 is specified])
  78. AC_MSG_CHECKING([if --enable-ipv6 is specified])
  79. --
  80. 2.34.1