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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. From 203087fe335a4b254c415f298ac6710d3f98b27e 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. ---
  12. Makefile.pre.in | 55 ++++++++++++++++++++++++++++++++++++-------------------
  13. configure.ac | 5 +++++
  14. 2 files changed, 41 insertions(+), 19 deletions(-)
  15. diff --git a/Makefile.pre.in b/Makefile.pre.in
  16. index 0e06ddb..029d3e3 100644
  17. --- a/Makefile.pre.in
  18. +++ b/Makefile.pre.in
  19. @@ -1191,8 +1191,28 @@ maninstall: altmaninstall
  20. # Install the library
  21. XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
  22. -LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
  23. - tkinter/test/test_ttk site-packages test \
  24. +
  25. +LIBSUBDIRS= tkinter site-packages \
  26. + asyncio \
  27. + collections concurrent concurrent/futures encodings \
  28. + email email/mime \
  29. + ensurepip ensurepip/_bundled \
  30. + html json http dbm xmlrpc \
  31. + sqlite3 \
  32. + logging csv wsgiref urllib \
  33. + lib2to3 lib2to3/fixes lib2to3/pgen2 \
  34. + ctypes ctypes/macholib \
  35. + idlelib idlelib/Icons \
  36. + distutils distutils/command $(XMLLIBSUBDIRS) \
  37. + importlib \
  38. + turtledemo \
  39. + multiprocessing multiprocessing/dummy \
  40. + unittest \
  41. + venv venv/scripts venv/scripts/common venv/scripts/posix \
  42. + curses pydoc_data
  43. +
  44. +TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
  45. + tkinter/test/test_ttk test \
  46. test/audiodata \
  47. test/capath test/data \
  48. test/cjkencodings test/decimaltestdata test/xmltestdata \
  49. @@ -1226,29 +1246,26 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
  50. test/test_importlib/namespace_pkgs/project3/parent/child \
  51. test/test_importlib/namespace_pkgs/module_and_namespace_package \
  52. test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \
  53. - asyncio \
  54. test/test_asyncio \
  55. - collections concurrent concurrent/futures encodings \
  56. - email email/mime test/test_email test/test_email/data \
  57. - ensurepip ensurepip/_bundled \
  58. - html json test/test_json http dbm xmlrpc \
  59. - sqlite3 sqlite3/test \
  60. - logging csv wsgiref urllib \
  61. - lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
  62. + test/test_email test/test_email/data \
  63. + test/test_json \
  64. + sqlite3/test \
  65. + lib2to3/tests \
  66. lib2to3/tests/data lib2to3/tests/data/fixers \
  67. lib2to3/tests/data/fixers/myfixes \
  68. - ctypes ctypes/test ctypes/macholib \
  69. - idlelib idlelib/Icons idlelib/idle_test \
  70. - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
  71. - importlib test/test_importlib test/test_importlib/builtin \
  72. + ctypes/test \
  73. + idlelib/idle_test \
  74. + distutils/tests \
  75. + test/test_importlib test/test_importlib/builtin \
  76. test/test_importlib/extension test/test_importlib/frozen \
  77. test/test_importlib/import_ test/test_importlib/source \
  78. test/test_tools test/test_warnings test/test_warnings/data \
  79. - turtledemo \
  80. - multiprocessing multiprocessing/dummy \
  81. - unittest unittest/test unittest/test/testmock \
  82. - venv venv/scripts venv/scripts/common venv/scripts/posix \
  83. - curses pydoc_data
  84. + unittest/test unittest/test/testmock
  85. +
  86. +ifeq (@TEST_MODULES@,yes)
  87. +LIBSUBDIRS += $(TESTSUBDIRS)
  88. +endif
  89. +
  90. libinstall: build_all $(srcdir)/Modules/xxmodule.c
  91. @for i in $(SCRIPTDIR) $(LIBDEST); \
  92. do \
  93. diff --git a/configure.ac b/configure.ac
  94. index fc4e71a..972eaca 100644
  95. --- a/configure.ac
  96. +++ b/configure.ac
  97. @@ -3081,6 +3081,11 @@ if test "$posix_threads" = "yes"; then
  98. AC_CHECK_FUNCS(pthread_atfork)
  99. fi
  100. +AC_SUBST(TEST_MODULES)
  101. +
  102. +AC_ARG_ENABLE(test-modules,
  103. + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
  104. + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
  105. # Check for enable-ipv6
  106. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  107. --
  108. 2.9.3