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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. From 1d2891204c6bf05d5e2eb0e5fa2ee78f6a2b755b Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Wed, 23 Dec 2015 11:47:00 +0100
  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. ---
  10. Makefile.pre.in | 56 ++++++++++++++++++++++++++++++++++++--------------------
  11. configure.ac | 6 ++++++
  12. 2 files changed, 42 insertions(+), 20 deletions(-)
  13. diff --git a/Makefile.pre.in b/Makefile.pre.in
  14. index 9420860..d4c771a 100644
  15. --- a/Makefile.pre.in
  16. +++ b/Makefile.pre.in
  17. @@ -1166,8 +1166,30 @@ maninstall: altmaninstall
  18. PLATDIR= @PLATDIR@
  19. MACHDEPS= $(PLATDIR)
  20. XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
  21. -LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
  22. - tkinter/test/test_ttk site-packages test \
  23. +LIBSUBDIRS= tkinter \
  24. + site-packages \
  25. + asyncio \
  26. + collections concurrent concurrent/futures encodings \
  27. + email email/mime \
  28. + ensurepip ensurepip/_bundled \
  29. + html json http dbm xmlrpc \
  30. + sqlite3 \
  31. + logging csv wsgiref urllib \
  32. + lib2to3 lib2to3/fixes lib2to3/pgen2 \
  33. + ctypes ctypes/macholib \
  34. + idlelib idlelib/Icons \
  35. + distutils distutils/command $(XMLLIBSUBDIRS) \
  36. + importlib \
  37. + turtledemo \
  38. + multiprocessing multiprocessing/dummy \
  39. + unittest \
  40. + venv venv/scripts venv/scripts/posix \
  41. + curses pydoc_data $(MACHDEPS)
  42. +
  43. +TESTSUBDIRS = tkinter/test tkinter/test/test_tkinter tkinter/test/test_ttk \
  44. + test test/test_asyncio \
  45. + test/test_email test/test_email/data \
  46. + test/test_json \
  47. test/audiodata \
  48. test/capath test/data \
  49. test/cjkencodings test/decimaltestdata test/xmltestdata \
  50. @@ -1199,28 +1221,22 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
  51. test/test_importlib/namespace_pkgs/project3/parent/child \
  52. test/test_importlib/namespace_pkgs/module_and_namespace_package \
  53. test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \
  54. - asyncio \
  55. - test/test_asyncio \
  56. - collections concurrent concurrent/futures encodings \
  57. - email email/mime test/test_email test/test_email/data \
  58. - ensurepip ensurepip/_bundled \
  59. - html json test/test_json http dbm xmlrpc \
  60. - sqlite3 sqlite3/test \
  61. - logging csv wsgiref urllib \
  62. - lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
  63. + sqlite3/test \
  64. + lib2to3/tests \
  65. lib2to3/tests/data lib2to3/tests/data/fixers \
  66. lib2to3/tests/data/fixers/myfixes \
  67. - ctypes ctypes/test ctypes/macholib \
  68. - idlelib idlelib/Icons idlelib/idle_test \
  69. - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
  70. - importlib test/test_importlib test/test_importlib/builtin \
  71. + ctypes/test \
  72. + idlelib/idle_test \
  73. + distutils/tests \
  74. + test/test_importlib test/test_importlib/builtin \
  75. test/test_importlib/extension test/test_importlib/frozen \
  76. test/test_importlib/import_ test/test_importlib/source \
  77. - turtledemo \
  78. - multiprocessing multiprocessing/dummy \
  79. - unittest unittest/test unittest/test/testmock \
  80. - venv venv/scripts venv/scripts/posix \
  81. - curses pydoc_data $(MACHDEPS)
  82. + unittest/test unittest/test/testmock
  83. +
  84. +ifeq (@TEST_MODULES@,yes)
  85. +LIBSUBDIRS += $(TESTSUBDIRS)
  86. +endif
  87. +
  88. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  89. @for i in $(SCRIPTDIR) $(LIBDEST); \
  90. do \
  91. diff --git a/configure.ac b/configure.ac
  92. index bfb599e..9f3d226 100644
  93. --- a/configure.ac
  94. +++ b/configure.ac
  95. @@ -2895,6 +2895,12 @@ if test "$posix_threads" = "yes"; then
  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. +
  103. # Check for enable-ipv6
  104. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  105. AC_MSG_CHECKING([if --enable-ipv6 is specified])
  106. --
  107. 2.6.4