2
1

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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. From bbbfe699d648a5cb191203b16e1786e8cf4ea908 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. ---
  14. Makefile.pre.in | 10 +++++++---
  15. configure.ac | 9 +++++++++
  16. 2 files changed, 16 insertions(+), 3 deletions(-)
  17. diff --git a/Makefile.pre.in b/Makefile.pre.in
  18. index 9f4cdf14cf..4f83911200 100644
  19. --- a/Makefile.pre.in
  20. +++ b/Makefile.pre.in
  21. @@ -1920,7 +1920,6 @@ LIBSUBDIRS= asyncio \
  22. multiprocessing multiprocessing/dummy \
  23. re \
  24. site-packages \
  25. - tkinter \
  26. tomllib \
  27. turtledemo \
  28. unittest \
  29. @@ -2038,9 +2038,6 @@
  30. test/xmltestdata \
  31. test/xmltestdata/c14n-20 \
  32. test/ziptestdata \
  33. - tkinter/test \
  34. - tkinter/test/test_tkinter \
  35. - tkinter/test/test_ttk \
  36. unittest/test \
  37. unittest/test/testmock
  38. ifeq (@PYDOC@,yes)
  39. @@ -2021,6 +2018,13 @@ ifeq (@SQLITE3@,yes)
  40. LIBSUBDIRS += sqlite3
  41. endif
  42. +ifeq (@TK@,yes)
  43. +LIBSUBDIRS += tkinter
  44. +TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \
  45. + tkinter/test/test_ttk
  46. +endif
  47. +
  48. +
  49. TEST_MODULES=@TEST_MODULES@
  50. libinstall: all $(srcdir)/Modules/xxmodule.c
  51. @for i in $(SCRIPTDIR) $(LIBDEST); \
  52. diff --git a/configure.ac b/configure.ac
  53. index 4cc0951ab9..f4ce506801 100644
  54. --- a/configure.ac
  55. +++ b/configure.ac
  56. @@ -4180,6 +4180,15 @@ if test "$SQLITE3" = "no" ; then
  57. DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
  58. fi
  59. +AC_SUBST(TK)
  60. +AC_ARG_ENABLE(tk,
  61. + AS_HELP_STRING([--disable-tk], [disable tk]),
  62. + [ TK="${enableval}" ], [ TK=yes ])
  63. +
  64. +if test "$TK" = "no"; then
  65. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter"
  66. +fi
  67. +
  68. AC_SUBST(PYDOC)
  69. AC_ARG_ENABLE(pydoc,
  70. --
  71. 2.34.1