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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From ad6b66b34f71ff6b60b3be5f6fd3e781cdeecd59 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. ---
  10. Makefile.pre.in | 11 ++++++++---
  11. configure.ac | 9 +++++++++
  12. 2 files changed, 17 insertions(+), 3 deletions(-)
  13. diff --git a/Makefile.pre.in b/Makefile.pre.in
  14. index d826d8ac4b..dc84384680 100644
  15. --- a/Makefile.pre.in
  16. +++ b/Makefile.pre.in
  17. @@ -1390,7 +1390,7 @@ maninstall: altmaninstall
  18. # Install the library
  19. XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
  20. -LIBSUBDIRS= tkinter site-packages \
  21. +LIBSUBDIRS= site-packages \
  22. asyncio \
  23. collections concurrent concurrent/futures encodings \
  24. email email/mime \
  25. @@ -1408,8 +1408,7 @@ LIBSUBDIRS= tkinter site-packages \
  26. curses \
  27. zoneinfo
  28. -TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
  29. - tkinter/test/test_ttk test \
  30. +TESTSUBDIRS= test \
  31. test/audiodata \
  32. test/capath test/data \
  33. test/cjkencodings test/decimaltestdata \
  34. @@ -1480,6 +1479,12 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
  35. test/test_tools test/test_warnings test/test_warnings/data \
  36. unittest/test unittest/test/testmock
  37. +ifeq (@TK@,yes)
  38. +LIBSUBDIRS += tkinter
  39. +TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \
  40. + tkinter/test/test_ttk
  41. +endif
  42. +
  43. ifeq (@LIB2TO3@,yes)
  44. LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2
  45. TESTSUBDIRS += lib2to3/tests \
  46. diff --git a/configure.ac b/configure.ac
  47. index 8b5c65974c..4c72dae960 100644
  48. --- a/configure.ac
  49. +++ b/configure.ac
  50. @@ -3338,6 +3338,15 @@ if test "$SQLITE3" = "no" ; then
  51. DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
  52. fi
  53. +AC_SUBST(TK)
  54. +AC_ARG_ENABLE(tk,
  55. + AS_HELP_STRING([--disable-tk], [disable tk]),
  56. + [ TK="${enableval}" ], [ TK=yes ])
  57. +
  58. +if test "$TK" = "no"; then
  59. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter"
  60. +fi
  61. +
  62. AC_SUBST(PYDOC)
  63. AC_ARG_ENABLE(pydoc,
  64. --
  65. 2.25.1