2
1

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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. From e3b96113ae2b5a0c3f775d5a9550dbbcffb702dd 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 4981087723..222c386f59 100644
  17. --- a/Makefile.pre.in
  18. +++ b/Makefile.pre.in
  19. @@ -1371,7 +1371,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. @@ -1418,7 +1420,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. @@ -1513,6 +1514,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 55d257515f..2efd7a6de0 100644
  49. --- a/configure.ac
  50. +++ b/configure.ac
  51. @@ -3436,6 +3436,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 0d6fe717da..4f8cfcd28d 100644
  65. --- a/setup.py
  66. +++ b/setup.py
  67. @@ -2573,11 +2573,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