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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. From 5bbd94f014c89665d02a8a32442822ab7c5520d0 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. [aduskett@gmail.com: Update for python 3.6.4]
  11. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  12. ---
  13. Makefile.pre.in | 7 ++++++-
  14. configure.ac | 6 ++++++
  15. setup.py | 4 +++-
  16. 3 files changed, 15 insertions(+), 2 deletions(-)
  17. diff --git a/Makefile.pre.in b/Makefile.pre.in
  18. index dc4b92b6fe..3e43066d90 100644
  19. --- a/Makefile.pre.in
  20. +++ b/Makefile.pre.in
  21. @@ -1194,7 +1194,9 @@ bininstall: altbininstall
  22. -rm -f $(DESTDIR)$(LIBPC)/python3.pc
  23. (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
  24. -rm -f $(DESTDIR)$(BINDIR)/idle3
  25. +ifeq (@IDLE@,yes)
  26. (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
  27. +endif
  28. -rm -f $(DESTDIR)$(BINDIR)/pydoc3
  29. ifeq (@PYDOC@,yes)
  30. (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
  31. @@ -1239,7 +1241,6 @@ LIBSUBDIRS= site-packages \
  32. html json http dbm xmlrpc \
  33. logging csv wsgiref urllib \
  34. ctypes ctypes/macholib \
  35. - idlelib idlelib/Icons \
  36. distutils distutils/command \
  37. importlib \
  38. turtledemo \
  39. @@ -1309,6 +1310,10 @@ ifeq (@EXPAT@,yes)
  40. LIBSUBDIRS += $(XMLLIBSUBDIRS)
  41. endif
  42. +ifeq (@IDLE@,yes)
  43. +LIBSUBDIRS += idlelib idlelib/Icons
  44. +endif
  45. +
  46. ifeq (@LIB2TO3@,yes)
  47. LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2
  48. TESTSUBDIRS += lib2to3/tests \
  49. diff --git a/configure.ac b/configure.ac
  50. index 1d610e132b..2699e7ceb1 100644
  51. --- a/configure.ac
  52. +++ b/configure.ac
  53. @@ -3183,6 +3183,12 @@ AC_ARG_ENABLE(lib2to3,
  54. AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]),
  55. [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
  56. +AC_SUBST(IDLE)
  57. +
  58. +AC_ARG_ENABLE(idle3,
  59. + AS_HELP_STRING([--disable-idle3], [disable idle3 IDE]),
  60. + [ IDLE="${enableval}" ], [ IDLE=yes ])
  61. +
  62. # Check for enable-ipv6
  63. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  64. AC_MSG_CHECKING([if --enable-ipv6 is specified])
  65. diff --git a/setup.py b/setup.py
  66. index 38aa5e605e..d642825c1e 100644
  67. --- a/setup.py
  68. +++ b/setup.py
  69. @@ -2324,11 +2324,13 @@ def main():
  70. import warnings
  71. warnings.filterwarnings("ignore",category=DeprecationWarning)
  72. - scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py']
  73. + scripts = [ 'Lib/smtpd.py']
  74. if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
  75. scripts += [ 'Tools/scripts/pydoc3' ]
  76. if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"):
  77. scripts += [ 'Tools/scripts/2to3' ]
  78. + if not '--disable-idle3' in sysconfig.get_config_var("CONFIG_ARGS"):
  79. + scripts += [ 'Tools/scripts/idle3' ]
  80. setup(# PyPI Metadata (PEP 301)
  81. name = "Python",
  82. --
  83. 2.13.5