0013-Add-an-option-to-disable-installation-of-test-module.patch 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. From 5c6722b6790ee6b8828a7f8a90b7fd173b77867f Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Wed, 22 Feb 2017 17:01:18 -0800
  4. Subject: [PATCH] Add an option to disable installation of test modules
  5. The Python standard distribution comes with many test modules, that
  6. are not necessarly useful on embedded targets.
  7. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  8. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  9. [ Andrey Smirnov: ported to Python 3.6 ]
  10. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
  11. [james.hilliard1@gmail.com: adapt to python 3.9]
  12. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
  13. ---
  14. Makefile.pre.in | 56 ++++++++++++++++++++++++++++++++-----------------
  15. configure.ac | 5 +++++
  16. 2 files changed, 42 insertions(+), 19 deletions(-)
  17. diff --git a/Makefile.pre.in b/Makefile.pre.in
  18. index 6eacfd6961..bbc779ee6a 100644
  19. --- a/Makefile.pre.in
  20. +++ b/Makefile.pre.in
  21. @@ -1405,8 +1405,29 @@ maninstall: altmaninstall
  22. # Install the library
  23. XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
  24. -LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
  25. - tkinter/test/test_ttk site-packages test \
  26. +
  27. +LIBSUBDIRS= tkinter site-packages \
  28. + asyncio \
  29. + collections concurrent concurrent/futures encodings \
  30. + email email/mime \
  31. + ensurepip ensurepip/_bundled \
  32. + html json http dbm xmlrpc \
  33. + sqlite3 \
  34. + logging csv wsgiref urllib \
  35. + lib2to3 lib2to3/fixes lib2to3/pgen2 \
  36. + ctypes ctypes/macholib \
  37. + idlelib idlelib/Icons \
  38. + distutils distutils/command $(XMLLIBSUBDIRS) \
  39. + importlib \
  40. + turtledemo \
  41. + multiprocessing multiprocessing/dummy \
  42. + unittest \
  43. + venv venv/scripts venv/scripts/common venv/scripts/posix \
  44. + curses pydoc_data \
  45. + zoneinfo
  46. +
  47. +TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
  48. + tkinter/test/test_ttk test \
  49. test/audiodata \
  50. test/capath test/data \
  51. test/cjkencodings test/decimaltestdata \
  52. @@ -1467,28 +1488,25 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
  53. test/test_importlib/zipdata02 \
  54. test/test_zoneinfo test/test_zoneinfo/data \
  55. test/ziptestdata \
  56. - asyncio \
  57. test/test_asyncio \
  58. - collections concurrent concurrent/futures encodings \
  59. - email email/mime test/test_email test/test_email/data \
  60. - ensurepip ensurepip/_bundled \
  61. - html json test/test_json http dbm xmlrpc \
  62. - sqlite3 sqlite3/test \
  63. - logging csv wsgiref urllib \
  64. - lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
  65. + test/test_email test/test_email/data \
  66. + test/test_json \
  67. + sqlite3/test \
  68. + lib2to3/tests \
  69. lib2to3/tests/data lib2to3/tests/data/fixers \
  70. lib2to3/tests/data/fixers/myfixes \
  71. - ctypes ctypes/test ctypes/macholib \
  72. - idlelib idlelib/Icons idlelib/idle_test \
  73. - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
  74. + ctypes/test \
  75. + idlelib/idle_test \
  76. + distutils/tests \
  77. test/test_peg_generator \
  78. + test/test_importlib test/test_importlib/builtin \
  79. test/test_tools test/test_warnings test/test_warnings/data \
  80. - turtledemo \
  81. - multiprocessing multiprocessing/dummy \
  82. - unittest unittest/test unittest/test/testmock \
  83. - venv venv/scripts venv/scripts/common venv/scripts/posix \
  84. - curses pydoc_data \
  85. - zoneinfo
  86. + unittest/test unittest/test/testmock
  87. +
  88. +ifeq (@TEST_MODULES@,yes)
  89. +LIBSUBDIRS += $(TESTSUBDIRS)
  90. +endif
  91. +
  92. libinstall: build_all $(srcdir)/Modules/xxmodule.c
  93. @for i in $(SCRIPTDIR) $(LIBDEST); \
  94. do \
  95. diff --git a/configure.ac b/configure.ac
  96. index 5b897d8e46..bebad207f8 100644
  97. --- a/configure.ac
  98. +++ b/configure.ac
  99. @@ -3365,6 +3365,11 @@ if test "$posix_threads" = "yes"; then
  100. AC_CHECK_FUNCS(pthread_getcpuclockid)
  101. fi
  102. +AC_SUBST(TEST_MODULES)
  103. +
  104. +AC_ARG_ENABLE(test-modules,
  105. + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
  106. + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
  107. # Check for enable-ipv6
  108. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  109. --
  110. 2.20.1