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

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