python-2.7-105-optional-curses.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. Add an option to disable the curses module
  2. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. ---
  4. Makefile.pre.in | 6 +++++-
  5. configure.in | 9 +++++++++
  6. 2 files changed, 14 insertions(+), 1 deletion(-)
  7. Index: Python-2.7.2/Makefile.pre.in
  8. ===================================================================
  9. --- Python-2.7.2.orig/Makefile.pre.in
  10. +++ Python-2.7.2/Makefile.pre.in
  11. @@ -867,7 +867,7 @@
  12. multiprocessing multiprocessing/dummy \
  13. unittest \
  14. lib-old \
  15. - curses $(MACHDEPS)
  16. + $(MACHDEPS)
  17. ifeq (@TEST_MODULES@,yes)
  18. LIBSUBDIRS += test test/data \
  19. @@ -906,6 +906,10 @@
  20. endif
  21. endif
  22. +ifeq (@CURSES@,yes)
  23. +LIBSUBDIRS += curses
  24. +endif
  25. +
  26. libinstall: build_all $(srcdir)/Lib/$(PLATDIR)
  27. @for i in $(SCRIPTDIR) $(LIBDEST); \
  28. do \
  29. Index: Python-2.7.2/configure.in
  30. ===================================================================
  31. --- Python-2.7.2.orig/configure.in
  32. +++ Python-2.7.2/configure.in
  33. @@ -2425,6 +2425,15 @@
  34. DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter"
  35. fi
  36. +AC_SUBST(CURSES)
  37. +AC_ARG_ENABLE(curses,
  38. + AS_HELP_STRING([--disable-curses], [disable curses]),
  39. + [ CURSES="${enableval}" ], [ CURSES=yes ])
  40. +
  41. +if test "$CURSES" = "no"; then
  42. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _curses _curses_panel"
  43. +fi
  44. +
  45. AC_SUBST(PYDOC)
  46. AC_ARG_ENABLE(pydoc,