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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. From f96a00d42e714171f1d90501ed73594fddee570f 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. [aduskett@gmail.com: Update for python 3.6.4]
  10. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  11. ---
  12. Makefile.pre.in | 11 ++++++++---
  13. configure.ac | 9 +++++++++
  14. 2 files changed, 17 insertions(+), 3 deletions(-)
  15. diff --git a/Makefile.pre.in b/Makefile.pre.in
  16. index a1ce0712cd..dc1e917cc3 100644
  17. --- a/Makefile.pre.in
  18. +++ b/Makefile.pre.in
  19. @@ -1231,7 +1231,7 @@ maninstall: altmaninstall
  20. # Install the library
  21. XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
  22. -LIBSUBDIRS= tkinter site-packages \
  23. +LIBSUBDIRS= site-packages \
  24. asyncio \
  25. collections concurrent concurrent/futures encodings \
  26. email email/mime \
  27. @@ -1248,8 +1248,7 @@ LIBSUBDIRS= tkinter site-packages \
  28. venv venv/scripts venv/scripts/common venv/scripts/posix \
  29. curses
  30. -TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
  31. - tkinter/test/test_ttk test \
  32. +TESTSUBDIRS= test \
  33. test/audiodata \
  34. test/capath test/data \
  35. test/cjkencodings test/decimaltestdata test/xmltestdata \
  36. @@ -1297,6 +1296,12 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
  37. test/test_tools test/test_warnings test/test_warnings/data \
  38. unittest/test unittest/test/testmock
  39. +ifeq (@TK@,yes)
  40. +LIBSUBDIRS += tkinter
  41. +TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \
  42. + tkinter/test/test_ttk
  43. +endif
  44. +
  45. ifeq (@LIB2TO3@,yes)
  46. LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2
  47. TESTSUBDIRS += lib2to3/tests \
  48. diff --git a/configure.ac b/configure.ac
  49. index d7582cfea4..6a56a5b0c1 100644
  50. --- a/configure.ac
  51. +++ b/configure.ac
  52. @@ -3121,6 +3121,15 @@ if test "$SQLITE3" = "no" ; then
  53. DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
  54. fi
  55. +AC_SUBST(TK)
  56. +AC_ARG_ENABLE(tk,
  57. + AS_HELP_STRING([--disable-tk], [disable tk]),
  58. + [ TK="${enableval}" ], [ TK=yes ])
  59. +
  60. +if test "$TK" = "no"; then
  61. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter"
  62. +fi
  63. +
  64. AC_SUBST(PYDOC)
  65. AC_ARG_ENABLE(pydoc,
  66. --
  67. 2.13.5