2
1

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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. From 5ee3e5ad62919c431b1f7b5ff91ddf606582df0e 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 | 54 ++++++++++++++++++++++++++++++++-----------------
  13. configure.ac | 5 +++++
  14. 2 files changed, 41 insertions(+), 18 deletions(-)
  15. diff --git a/Makefile.pre.in b/Makefile.pre.in
  16. index e8a6bd5c03..3abee36f49 100644
  17. --- a/Makefile.pre.in
  18. +++ b/Makefile.pre.in
  19. @@ -1317,8 +1317,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 \
  49. @@ -1376,26 +1396,24 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
  50. test/test_importlib/zipdata01 \
  51. test/test_importlib/zipdata02 \
  52. test/ziptestdata \
  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. + ctypes/test \
  72. + idlelib/idle_test \
  73. + distutils/tests \
  74. + test/test_importlib test/test_importlib/builtin \
  75. test/test_tools test/test_warnings test/test_warnings/data \
  76. - turtledemo \
  77. - multiprocessing multiprocessing/dummy \
  78. - unittest unittest/test unittest/test/testmock \
  79. - venv venv/scripts venv/scripts/common venv/scripts/posix \
  80. - curses pydoc_data
  81. + unittest/test unittest/test/testmock
  82. +
  83. +ifeq (@TEST_MODULES@,yes)
  84. +LIBSUBDIRS += $(TESTSUBDIRS)
  85. +endif
  86. +
  87. libinstall: build_all $(srcdir)/Modules/xxmodule.c
  88. @for i in $(SCRIPTDIR) $(LIBDEST); \
  89. do \
  90. diff --git a/configure.ac b/configure.ac
  91. index 7872b4dfee..b820d18c7c 100644
  92. --- a/configure.ac
  93. +++ b/configure.ac
  94. @@ -3213,6 +3213,11 @@ if test "$posix_threads" = "yes"; then
  95. AC_CHECK_FUNCS(pthread_getcpuclockid)
  96. fi
  97. +AC_SUBST(TEST_MODULES)
  98. +
  99. +AC_ARG_ENABLE(test-modules,
  100. + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
  101. + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
  102. # Check for enable-ipv6
  103. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  104. --
  105. 2.20.1