python-2.7-100-optional-test-modules.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. ---
  6. Makefile.pre.in | 40 +++++++++++++++++++++++++++-------------
  7. configure.in | 6 ++++++
  8. 2 files changed, 33 insertions(+), 13 deletions(-)
  9. Index: Python-2.7.1/Makefile.pre.in
  10. ===================================================================
  11. --- Python-2.7.1.orig/Makefile.pre.in
  12. +++ Python-2.7.1/Makefile.pre.in
  13. @@ -851,23 +851,37 @@
  14. plat-mac/lib-scriptpackages/SystemEvents \
  15. plat-mac/lib-scriptpackages/Terminal
  16. PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
  17. -LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
  18. - lib-tk/test/test_ttk site-packages test test/data \
  19. - test/decimaltestdata test/xmltestdata \
  20. - test/tracedmodules \
  21. +LIBSUBDIRS= lib-tk \
  22. + site-packages \
  23. encodings compiler hotshot \
  24. - email email/mime email/test email/test/data \
  25. - json json/tests \
  26. - sqlite3 sqlite3/test \
  27. - logging bsddb bsddb/test csv importlib wsgiref \
  28. - lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
  29. - lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
  30. - ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \
  31. - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
  32. + email email/mime \
  33. + json \
  34. + sqlite3 \
  35. + logging bsddb csv importlib wsgiref \
  36. + lib2to3 lib2to3/fixes lib2to3/pgen2 \
  37. + ctypes ctypes/macholib idlelib idlelib/Icons \
  38. + distutils distutils/command $(XMLLIBSUBDIRS) \
  39. multiprocessing multiprocessing/dummy \
  40. - unittest unittest/test \
  41. + unittest \
  42. lib-old \
  43. curses pydoc_data $(MACHDEPS)
  44. +
  45. +ifeq (@TEST_MODULES@,yes)
  46. +LIBSUBDIRS += lib-tk/test lib-tk/test/test_tkinter \
  47. + lib-tk/test/test_ttk test test/data \
  48. + test/decimaltestdata test/xmltestdata \
  49. + test/tracedmodules \
  50. + email/test email/test/data \
  51. + sqlite3/test \
  52. + bsddb/test \
  53. + lib2to3/tests \
  54. + lib2to3/tests/data \
  55. + lib2to3/tests/data/fixers \
  56. + lib2to3/tests/data/fixers/myfixes \
  57. + ctypes/test distutils/tests \
  58. + unittest/test
  59. +endif
  60. +
  61. libinstall: build_all $(srcdir)/Lib/$(PLATDIR)
  62. @for i in $(SCRIPTDIR) $(LIBDEST); \
  63. do \
  64. Index: Python-2.7.1/configure.in
  65. ===================================================================
  66. --- Python-2.7.1.orig/configure.in
  67. +++ Python-2.7.1/configure.in
  68. @@ -2393,6 +2393,12 @@
  69. fi
  70. +AC_SUBST(TEST_MODULES)
  71. +
  72. +AC_ARG_ENABLE(test-modules,
  73. + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
  74. + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
  75. +
  76. # Check for enable-ipv6
  77. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  78. AC_MSG_CHECKING([if --enable-ipv6 is specified])