python-100-optional-test-modules.patch 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. Add an option to disable installation of test modules
  2. The Python standard distribution comes with many test modules, that
  3. are not necessarly useful on embedded targets.
  4. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  5. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  6. ---
  7. Makefile.pre.in | 40 +++++++++++++++++++++++++++-------------
  8. configure.in | 6 ++++++
  9. 2 files changed, 33 insertions(+), 13 deletions(-)
  10. Index: b/Makefile.pre.in
  11. ===================================================================
  12. --- a/Makefile.pre.in
  13. +++ b/Makefile.pre.in
  14. @@ -934,23 +934,40 @@
  15. plat-mac/lib-scriptpackages/SystemEvents \
  16. plat-mac/lib-scriptpackages/Terminal
  17. PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
  18. -LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
  19. - lib-tk/test/test_ttk site-packages test test/audiodata test/data \
  20. - test/cjkencodings test/decimaltestdata test/xmltestdata test/subprocessdata \
  21. - test/tracedmodules \
  22. +LIBSUBDIRS= lib-tk \
  23. + site-packages \
  24. encodings compiler hotshot \
  25. - email email/mime email/test email/test/data \
  26. - json json/tests \
  27. - sqlite3 sqlite3/test \
  28. - logging bsddb bsddb/test csv importlib wsgiref \
  29. - lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
  30. - lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
  31. - ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \
  32. - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
  33. + email email/mime \
  34. + json \
  35. + sqlite3 \
  36. + logging bsddb csv importlib wsgiref \
  37. + lib2to3 lib2to3/fixes lib2to3/pgen2 \
  38. + ctypes ctypes/macholib idlelib idlelib/Icons \
  39. + distutils distutils/command $(XMLLIBSUBDIRS) \
  40. multiprocessing multiprocessing/dummy \
  41. - unittest unittest/test \
  42. + unittest \
  43. lib-old \
  44. curses pydoc_data $(MACHDEPS)
  45. +
  46. +TESTSUBDIRS = lib-tk/test lib-tk/test/test_tkinter \
  47. + lib-tk/test/test_ttk \
  48. + test test/audiodata test/data \
  49. + test/cjkencodings test/decimaltestdata test/xmltestdata test/subprocessdata \
  50. + test/tracedmodules \
  51. + email/test email/test/data \
  52. + json/tests \
  53. + sqlite3/test \
  54. + bsddb/test \
  55. + lib2to3/tests \
  56. + lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
  57. + ctypes/test \
  58. + distutils/tests \
  59. + unittest/test
  60. +
  61. +ifeq (@TEST_MODULES@,yes)
  62. +LIBSUBDIRS += $(TESTSUBDIRS)
  63. +endif
  64. +
  65. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  66. @for i in $(SCRIPTDIR) $(LIBDEST); \
  67. do \
  68. Index: b/configure.ac
  69. ===================================================================
  70. --- a/configure.ac
  71. +++ b/configure.ac
  72. @@ -2614,6 +2614,12 @@
  73. fi
  74. +AC_SUBST(TEST_MODULES)
  75. +
  76. +AC_ARG_ENABLE(test-modules,
  77. + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
  78. + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
  79. +
  80. # Check for enable-ipv6
  81. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  82. AC_MSG_CHECKING([if --enable-ipv6 is specified])