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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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: Python-2.7.2/Makefile.pre.in
  11. ===================================================================
  12. --- Python-2.7.2.orig/Makefile.pre.in
  13. +++ Python-2.7.2/Makefile.pre.in
  14. @@ -856,23 +856,30 @@
  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/data \
  20. - test/cjkencodings test/decimaltestdata test/xmltestdata test/subprocessdata \
  21. - test/tracedmodules \
  22. +LIBSUBDIRS= lib-tk 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/cjkencodings test/decimaltestdata test/xmltestdata test/subprocessdata \
  49. + test/tracedmodules email/test email/test/data \
  50. + json/tests sqlite3/test bsddb/test lib2to3/tests \
  51. + lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
  52. + ctypes/test distutils/tests unittest/test
  53. +endif
  54. +
  55. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  56. @for i in $(SCRIPTDIR) $(LIBDEST); \
  57. do \
  58. Index: Python-2.7.2/configure.in
  59. ===================================================================
  60. --- Python-2.7.2.orig/configure.in
  61. +++ Python-2.7.2/configure.in
  62. @@ -2408,6 +2408,12 @@
  63. fi
  64. +AC_SUBST(TEST_MODULES)
  65. +
  66. +AC_ARG_ENABLE(test-modules,
  67. + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
  68. + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
  69. +
  70. # Check for enable-ipv6
  71. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  72. AC_MSG_CHECKING([if --enable-ipv6 is specified])