110-optional-idle.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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: b/Makefile.pre.in
  11. ===================================================================
  12. --- a/Makefile.pre.in
  13. +++ b/Makefile.pre.in
  14. @@ -1101,7 +1101,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. @@ -1149,7 +1151,6 @@
  25. html json http dbm xmlrpc \
  26. logging csv wsgiref urllib \
  27. ctypes ctypes/macholib \
  28. - idlelib idlelib/Icons \
  29. distutils distutils/command \
  30. importlib \
  31. turtledemo \
  32. @@ -1226,6 +1227,10 @@
  33. LIBSUBDIRS += $(XMLLIBSUBDIRS)
  34. endif
  35. +ifeq (@IDLE@,yes)
  36. +LIBSUBDIRS += idlelib idlelib/Icons
  37. +endif
  38. +
  39. ifeq (@TEST_MODULES@,yes)
  40. LIBSUBDIRS += $(TESTSUBDIRS)
  41. endif
  42. Index: b/configure.ac
  43. ===================================================================
  44. --- a/configure.ac
  45. +++ b/configure.ac
  46. @@ -2746,6 +2746,12 @@
  47. AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]),
  48. [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
  49. +AC_SUBST(IDLE)
  50. +
  51. +AC_ARG_ENABLE(idle3,
  52. + AS_HELP_STRING([--disable-idle3], [disable idle3 IDE]),
  53. + [ IDLE="${enableval}" ], [ IDLE=yes ])
  54. +
  55. # Check for enable-ipv6
  56. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  57. AC_MSG_CHECKING([if --enable-ipv6 is specified])
  58. Index: b/setup.py
  59. ===================================================================
  60. --- a/setup.py
  61. +++ b/setup.py
  62. @@ -2201,11 +2201,13 @@
  63. import warnings
  64. warnings.filterwarnings("ignore",category=DeprecationWarning)
  65. - scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py']
  66. + scripts = ['Lib/smtpd.py']
  67. if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
  68. scripts += [ 'Tools/scripts/pydoc3' ]
  69. if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"):
  70. scripts += [ 'Tools/scripts/2to3' ]
  71. + if not '--disable-idle3' in sysconfig.get_config_var("CONFIG_ARGS"):
  72. + scripts += [ 'Tools/scripts/idle3' ]
  73. setup(# PyPI Metadata (PEP 301)
  74. name = "Python",