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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. From 0b04847e1007f5d34b986eb12ae63f140d14b01e 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. ---
  19. Makefile.pre.in | 8 +++++---
  20. configure.ac | 7 +++++++
  21. 2 files changed, 12 insertions(+), 3 deletions(-)
  22. diff --git a/Makefile.pre.in b/Makefile.pre.in
  23. index 88a48eb5333..6d6631cbe31 100644
  24. --- a/Makefile.pre.in
  25. +++ b/Makefile.pre.in
  26. @@ -2331,7 +2331,6 @@ LIBSUBDIRS= asyncio \
  27. re \
  28. site-packages \
  29. sysconfig \
  30. - tkinter \
  31. tomllib \
  32. turtledemo \
  33. unittest \
  34. @@ -2439,7 +2438,6 @@ TESTSUBDIRS= idlelib/idle_test \
  35. test/test_pydoc \
  36. test/test_pyrepl \
  37. test/test_sqlite3 \
  38. - test/test_tkinter \
  39. test/test_tomllib \
  40. test/test_tomllib/data \
  41. test/test_tomllib/data/invalid \
  42. @@ -2460,7 +2458,6 @@ TESTSUBDIRS= idlelib/idle_test \
  43. test/test_tomllib/data/valid/multiline-basic-str \
  44. test/test_tools \
  45. test/test_tools/i18n_data \
  46. - test/test_ttk \
  47. test/test_unittest \
  48. test/test_unittest/testmock \
  49. test/test_warnings \
  50. @@ -2482,6 +2479,11 @@ TESTSUBDIRS= idlelib/idle_test \
  51. test/xmltestdata/c14n-20 \
  52. test/zipimport_data
  53. +ifeq (@TK@,yes)
  54. +LIBSUBDIRS += tkinter
  55. +TESTSUBDIRS += test/test_tkinter test/test_ttk
  56. +endif
  57. +
  58. COMPILEALL_OPTS=-j0
  59. ifeq (@PYDOC@,yes)
  60. diff --git a/configure.ac b/configure.ac
  61. index b6d5bb3d9c5..a1a91e094cd 100644
  62. --- a/configure.ac
  63. +++ b/configure.ac
  64. @@ -4680,6 +4680,13 @@ AC_ARG_ENABLE(pydoc,
  65. AS_HELP_STRING([--disable-pydoc], [disable pydoc]),
  66. [ PYDOC="${enableval}" ], [ PYDOC=yes ])
  67. +AC_SUBST(TK)
  68. +AC_ARG_ENABLE(tk,
  69. + AS_HELP_STRING([--disable-tk], [disable tk]),
  70. + [ TK="${enableval}" ], [ TK=yes ])
  71. +AS_IF([test "$TK" = "no"],
  72. + [PY_STDLIB_MOD_SET_NA([_tkinter])])
  73. +
  74. # Check for enable-ipv6
  75. AH_TEMPLATE([ENABLE_IPV6], [Define if --enable-ipv6 is specified])
  76. AC_MSG_CHECKING([if --enable-ipv6 is specified])
  77. --
  78. 2.34.1