python3-110-optional-idle.patch 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. Add an option to disable IDLE
  2. IDLE is an IDE embedded into python, written using Tk, so it doesn't make
  3. much sense to have it into our build.
  4. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
  5. ---
  6. Makefile.pre.in | 8 +++++++-
  7. configure.ac | 6 ++++++
  8. setup.py | 4 +++-
  9. 3 files changed, 16 insertions(+), 2 deletions(-)
  10. Index: cpython/Makefile.pre.in
  11. ===================================================================
  12. --- cpython.orig/Makefile.pre.in
  13. +++ cpython/Makefile.pre.in
  14. @@ -950,7 +950,9 @@
  15. -rm -f $(DESTDIR)$(LIBPC)/python3.pc
  16. (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
  17. -rm -f $(DESTDIR)$(BINDIR)/idle3
  18. +ifeq (@IDLE@,yes)
  19. (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
  20. +endif
  21. -rm -f $(DESTDIR)$(BINDIR)/pydoc3
  22. ifeq (@PYDOC@,yes)
  23. (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
  24. @@ -986,7 +988,7 @@
  25. email email/mime \
  26. html json http dbm xmlrpc \
  27. logging csv wsgiref urllib \
  28. - ctypes ctypes/macholib idlelib idlelib/Icons \
  29. + ctypes ctypes/macholib \
  30. distutils distutils/command \
  31. importlib \
  32. turtledemo \
  33. @@ -1069,6 +1071,10 @@
  34. LIBSUBDIRS += $(XMLLIBSUBDIRS)
  35. endif
  36. +ifeq (@IDLE@,yes)
  37. +LIBSUBDIRS += idlelib idlelib/Icons
  38. +endif
  39. +
  40. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  41. @for i in $(SCRIPTDIR) $(LIBDEST); \
  42. do \
  43. Index: cpython/configure.ac
  44. ===================================================================
  45. --- cpython.orig/configure.ac
  46. +++ cpython/configure.ac
  47. @@ -2519,6 +2519,12 @@
  48. AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]),
  49. [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
  50. +AC_SUBST(IDLE)
  51. +
  52. +AC_ARG_ENABLE(idle3,
  53. + AS_HELP_STRING([--disable-idle3], [disable idle3 IDE]),
  54. + [ IDLE="${enableval}" ], [ IDLE=yes ])
  55. +
  56. # Check for enable-ipv6
  57. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  58. AC_MSG_CHECKING([if --enable-ipv6 is specified])
  59. Index: cpython/setup.py
  60. ===================================================================
  61. --- cpython.orig/setup.py
  62. +++ cpython/setup.py
  63. @@ -2124,11 +2124,13 @@
  64. import warnings
  65. warnings.filterwarnings("ignore",category=DeprecationWarning)
  66. - scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py']
  67. + scripts = ['Lib/smtpd.py']
  68. if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
  69. scripts += [ 'Tools/scripts/pydoc3' ]
  70. if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"):
  71. scripts += [ 'Tools/scripts/2to3' ]
  72. + if not '--disable-idle3' in sysconfig.get_config_var("CONFIG_ARGS"):
  73. + scripts += [ 'Tools/scripts/idle3' ]
  74. setup(# PyPI Metadata (PEP 301)
  75. name = "Python",