0027-Add-an-option-to-disable-IDLE.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. From 6187913d2d84a8f0df85781e32a23eb053365134 Mon Sep 17 00:00:00 2001
  2. From: Maxime Ripard <maxime.ripard@free-electrons.com>
  3. Date: Wed, 23 Dec 2015 11:50:42 +0100
  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. ---
  9. Makefile.pre.in | 7 ++++++-
  10. configure.ac | 6 ++++++
  11. setup.py | 4 +++-
  12. 3 files changed, 15 insertions(+), 2 deletions(-)
  13. diff --git a/Makefile.pre.in b/Makefile.pre.in
  14. index fcb1ac4..0c26bcf 100644
  15. --- a/Makefile.pre.in
  16. +++ b/Makefile.pre.in
  17. @@ -1158,7 +1158,9 @@ bininstall: altbininstall
  18. -rm -f $(DESTDIR)$(LIBPC)/python3.pc
  19. (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
  20. -rm -f $(DESTDIR)$(BINDIR)/idle3
  21. +ifeq (@IDLE@,yes)
  22. (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
  23. +endif
  24. -rm -f $(DESTDIR)$(BINDIR)/pydoc3
  25. ifeq (@PYDOC@,yes)
  26. (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
  27. @@ -1205,7 +1207,6 @@ LIBSUBDIRS= \
  28. html json http dbm xmlrpc \
  29. logging csv wsgiref urllib \
  30. ctypes ctypes/macholib \
  31. - idlelib idlelib/Icons \
  32. distutils distutils/command \
  33. importlib \
  34. turtledemo \
  35. @@ -1287,6 +1288,10 @@ ifeq (@EXPAT@,yes)
  36. LIBSUBDIRS += $(XMLLIBSUBDIRS)
  37. endif
  38. +ifeq (@IDLE@,yes)
  39. +LIBSUBDIRS += idlelib idlelib/Icons
  40. +endif
  41. +
  42. ifeq (@TEST_MODULES@,yes)
  43. LIBSUBDIRS += $(TESTSUBDIRS)
  44. endif
  45. diff --git a/configure.ac b/configure.ac
  46. index b1a1f39..d1be997 100644
  47. --- a/configure.ac
  48. +++ b/configure.ac
  49. @@ -3047,6 +3047,12 @@ AC_ARG_ENABLE(lib2to3,
  50. AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]),
  51. [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
  52. +AC_SUBST(IDLE)
  53. +
  54. +AC_ARG_ENABLE(idle3,
  55. + AS_HELP_STRING([--disable-idle3], [disable idle3 IDE]),
  56. + [ IDLE="${enableval}" ], [ IDLE=yes ])
  57. +
  58. # Check for enable-ipv6
  59. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  60. AC_MSG_CHECKING([if --enable-ipv6 is specified])
  61. diff --git a/setup.py b/setup.py
  62. index 53a471c..b443987 100644
  63. --- a/setup.py
  64. +++ b/setup.py
  65. @@ -2254,11 +2254,13 @@ def main():
  66. import warnings
  67. warnings.filterwarnings("ignore",category=DeprecationWarning)
  68. - scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py']
  69. + scripts = ['Lib/smtpd.py']
  70. if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
  71. scripts += [ 'Tools/scripts/pydoc3' ]
  72. if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"):
  73. scripts += [ 'Tools/scripts/2to3' ]
  74. + if not '--disable-idle3' in sysconfig.get_config_var("CONFIG_ARGS"):
  75. + scripts += [ 'Tools/scripts/idle3' ]
  76. setup(# PyPI Metadata (PEP 301)
  77. name = "Python",
  78. --
  79. 2.7.4