0017-Add-an-option-to-disable-IDLE.patch 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. From f74c580b9e5bd8c710627b48cea4e152426e71e6 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. [ Adam Duskett: ported to Python 3.10.0 ]
  11. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  12. ---
  13. Makefile.pre.in | 7 ++++++-
  14. configure.ac | 6 ++++++
  15. setup.py | 5 ++++-
  16. 3 files changed, 16 insertions(+), 2 deletions(-)
  17. diff --git a/Makefile.pre.in b/Makefile.pre.in
  18. index 8e5f6762d20..4e407cbcfa9 100644
  19. --- a/Makefile.pre.in
  20. +++ b/Makefile.pre.in
  21. @@ -1875,7 +1875,9 @@ bininstall: commoninstall altbininstall
  22. -rm -f $(DESTDIR)$(LIBPC)/python3-embed.pc
  23. (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python3-embed.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. @@ -1925,7 +1927,6 @@ LIBSUBDIRS= asyncio \
  32. ensurepip ensurepip/_bundled \
  33. html \
  34. http \
  35. - idlelib idlelib/Icons \
  36. importlib importlib/resources importlib/metadata \
  37. json \
  38. logging \
  39. @@ -2090,6 +2091,10 @@ ifeq (@EXPAT@,yes)
  40. LIBSUBDIRS += $(XMLLIBSUBDIRS)
  41. endif
  42. +ifeq (@IDLE@,yes)
  43. +LIBSUBDIRS += idlelib idlelib/Icons
  44. +endif
  45. +
  46. TEST_MODULES=@TEST_MODULES@
  47. libinstall: all $(srcdir)/Modules/xxmodule.c
  48. @for i in $(SCRIPTDIR) $(LIBDEST); \
  49. diff --git a/configure.ac b/configure.ac
  50. index cb7e980e5b5..fe497ec9dfb 100644
  51. --- a/configure.ac
  52. +++ b/configure.ac
  53. @@ -7206,6 +7206,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. # generate output files
  63. AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh)
  64. AC_CONFIG_FILES([Modules/Setup.bootstrap Modules/Setup.stdlib])
  65. diff --git a/setup.py b/setup.py
  66. index e02591dae10..ada914c5501 100644
  67. --- a/setup.py
  68. +++ b/setup.py
  69. @@ -1598,11 +1598,14 @@ class DummyProcess:
  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. +
  81. setup(# PyPI Metadata (PEP 301)
  82. name = "Python",
  83. version = sys.version.split()[0],
  84. --
  85. 2.44.0