0023-Add-an-option-to-disable-IDLE.patch 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. From c3ad1d6fc8f1fa56ee0522389227454710bf7877 Mon Sep 17 00:00:00 2001
  2. From: Maxime Ripard <maxime.ripard@free-electrons.com>
  3. Date: Wed, 22 Feb 2017 17:45:14 -0800
  4. Subject: [PATCH] Add an option to disable IDLE
  5. IDLE is an IDE embedded into python, written using Tk, so it doesn't make
  6. much sense to have it into our build.
  7. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
  8. [ Andrey Smirnov: ported to Python 3.6 ]
  9. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
  10. ---
  11. Makefile.pre.in | 7 ++++++-
  12. configure.ac | 6 ++++++
  13. setup.py | 4 +++-
  14. 3 files changed, 15 insertions(+), 2 deletions(-)
  15. diff --git a/Makefile.pre.in b/Makefile.pre.in
  16. index f49abf8395..bc777e6504 100644
  17. --- a/Makefile.pre.in
  18. +++ b/Makefile.pre.in
  19. @@ -1287,7 +1287,9 @@ bininstall: altbininstall
  20. -rm -f $(DESTDIR)$(LIBPC)/python3-embed.pc
  21. (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python3-embed.pc)
  22. -rm -f $(DESTDIR)$(BINDIR)/idle3
  23. +ifeq (@IDLE@,yes)
  24. (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
  25. +endif
  26. -rm -f $(DESTDIR)$(BINDIR)/pydoc3
  27. ifeq (@PYDOC@,yes)
  28. (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
  29. @@ -1330,7 +1332,6 @@ LIBSUBDIRS= site-packages \
  30. html json http dbm xmlrpc \
  31. logging csv wsgiref urllib \
  32. ctypes ctypes/macholib \
  33. - idlelib idlelib/Icons \
  34. distutils distutils/command \
  35. importlib \
  36. turtledemo \
  37. @@ -1420,6 +1421,10 @@ ifeq (@EXPAT@,yes)
  38. LIBSUBDIRS += $(XMLLIBSUBDIRS)
  39. endif
  40. +ifeq (@IDLE@,yes)
  41. +LIBSUBDIRS += idlelib idlelib/Icons
  42. +endif
  43. +
  44. ifeq (@LIB2TO3@,yes)
  45. LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2
  46. TESTSUBDIRS += lib2to3/tests \
  47. diff --git a/configure.ac b/configure.ac
  48. index 99bbc37b07..8c9706582e 100644
  49. --- a/configure.ac
  50. +++ b/configure.ac
  51. @@ -3284,6 +3284,12 @@ AC_ARG_ENABLE(lib2to3,
  52. AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]),
  53. [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
  54. +AC_SUBST(IDLE)
  55. +
  56. +AC_ARG_ENABLE(idle3,
  57. + AS_HELP_STRING([--disable-idle3], [disable idle3 IDE]),
  58. + [ IDLE="${enableval}" ], [ IDLE=yes ])
  59. +
  60. # Check for enable-ipv6
  61. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  62. AC_MSG_CHECKING([if --enable-ipv6 is specified])
  63. diff --git a/setup.py b/setup.py
  64. index d2727c0da5..9f09b3d985 100644
  65. --- a/setup.py
  66. +++ b/setup.py
  67. @@ -2402,11 +2402,13 @@ def main():
  68. import warnings
  69. warnings.filterwarnings("ignore",category=DeprecationWarning)
  70. - scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py']
  71. + scripts = [ 'Lib/smtpd.py']
  72. if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
  73. scripts += [ 'Tools/scripts/pydoc3' ]
  74. if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"):
  75. scripts += [ 'Tools/scripts/2to3' ]
  76. + if not '--disable-idle3' in sysconfig.get_config_var("CONFIG_ARGS"):
  77. + scripts += [ 'Tools/scripts/idle3' ]
  78. setup(# PyPI Metadata (PEP 301)
  79. name = "Python",
  80. --
  81. 2.20.1