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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. From 61535b58452a18d6654a02fd25bfbc562bbbdbea 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 | 11 +++++++----
  15. configure.ac | 9 +++++++++
  16. 2 files changed, 16 insertions(+), 4 deletions(-)
  17. diff --git a/Makefile.pre.in b/Makefile.pre.in
  18. index 1c7b38ce4f6..6ab184fe5f8 100644
  19. --- a/Makefile.pre.in
  20. +++ b/Makefile.pre.in
  21. @@ -1933,7 +1933,6 @@ LIBSUBDIRS= asyncio \
  22. multiprocessing multiprocessing/dummy \
  23. re \
  24. site-packages \
  25. - tkinter \
  26. tomllib \
  27. turtledemo \
  28. unittest \
  29. @@ -2060,9 +2059,6 @@ TESTSUBDIRS= ctypes/test \
  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. @@ -2082,6 +2078,13 @@ ifeq (@SQLITE3@,yes)
  39. LIBSUBDIRS += sqlite3
  40. endif
  41. +ifeq (@TK@,yes)
  42. +LIBSUBDIRS += tkinter
  43. +TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \
  44. + tkinter/test/test_ttk
  45. +endif
  46. +
  47. +
  48. TEST_MODULES=@TEST_MODULES@
  49. libinstall: all $(srcdir)/Modules/xxmodule.c
  50. @for i in $(SCRIPTDIR) $(LIBDEST); \
  51. diff --git a/configure.ac b/configure.ac
  52. index 0013afc9aad..342b295bcdd 100644
  53. --- a/configure.ac
  54. +++ b/configure.ac
  55. @@ -4231,6 +4231,15 @@ if test "$SQLITE3" = "no" ; then
  56. DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
  57. fi
  58. +AC_SUBST(TK)
  59. +AC_ARG_ENABLE(tk,
  60. + AS_HELP_STRING([--disable-tk], [disable tk]),
  61. + [ TK="${enableval}" ], [ TK=yes ])
  62. +
  63. +if test "$TK" = "no"; then
  64. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter"
  65. +fi
  66. +
  67. AC_SUBST(PYDOC)
  68. AC_ARG_ENABLE(pydoc,
  69. --
  70. 2.44.0