2
1

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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. From dd4ac2662ae1feaa3a29c4088193e48645b080f7 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. [ Vincent Fazio: fixup setup array to reflect upstream ]
  13. Signed-off-by: Vincent Fazio <vfazio@gmail.com>
  14. ---
  15. Makefile.pre.in | 7 ++++++-
  16. configure.ac | 6 ++++++
  17. setup.py | 4 +++-
  18. 3 files changed, 15 insertions(+), 2 deletions(-)
  19. diff --git a/Makefile.pre.in b/Makefile.pre.in
  20. index 8e5f6762d2..4e407cbcfa 100644
  21. --- a/Makefile.pre.in
  22. +++ b/Makefile.pre.in
  23. @@ -1875,7 +1875,9 @@ bininstall: commoninstall altbininstall
  24. -rm -f $(DESTDIR)$(LIBPC)/python3-embed.pc
  25. (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python3-embed.pc)
  26. -rm -f $(DESTDIR)$(BINDIR)/idle3
  27. +ifeq (@IDLE@,yes)
  28. (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
  29. +endif
  30. -rm -f $(DESTDIR)$(BINDIR)/pydoc3
  31. ifeq (@PYDOC@,yes)
  32. (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
  33. @@ -1925,7 +1927,6 @@ LIBSUBDIRS= asyncio \
  34. ensurepip ensurepip/_bundled \
  35. html \
  36. http \
  37. - idlelib idlelib/Icons \
  38. importlib importlib/resources importlib/metadata \
  39. json \
  40. logging \
  41. @@ -2090,6 +2091,10 @@ ifeq (@EXPAT@,yes)
  42. LIBSUBDIRS += $(XMLLIBSUBDIRS)
  43. endif
  44. +ifeq (@IDLE@,yes)
  45. +LIBSUBDIRS += idlelib idlelib/Icons
  46. +endif
  47. +
  48. TEST_MODULES=@TEST_MODULES@
  49. libinstall: all $(srcdir)/Modules/xxmodule.c
  50. @for i in $(SCRIPTDIR) $(LIBDEST); \
  51. diff --git a/configure.ac b/configure.ac
  52. index cb7e980e5b..fe497ec9df 100644
  53. --- a/configure.ac
  54. +++ b/configure.ac
  55. @@ -7206,6 +7206,12 @@ AC_ARG_ENABLE(lib2to3,
  56. AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]),
  57. [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
  58. +AC_SUBST(IDLE)
  59. +
  60. +AC_ARG_ENABLE(idle3,
  61. + AS_HELP_STRING([--disable-idle3], [disable idle3 IDE]),
  62. + [ IDLE="${enableval}" ], [ IDLE=yes ])
  63. +
  64. # generate output files
  65. AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh)
  66. AC_CONFIG_FILES([Modules/Setup.bootstrap Modules/Setup.stdlib])
  67. diff --git a/setup.py b/setup.py
  68. index 78d880f9db..ca05faec97 100644
  69. --- a/setup.py
  70. +++ b/setup.py
  71. @@ -1598,12 +1598,14 @@ class DummyProcess:
  72. import warnings
  73. warnings.filterwarnings("ignore",category=DeprecationWarning)
  74. - scripts = ['Tools/scripts/idle3']
  75. + scripts = []
  76. if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
  77. scripts += [ 'Tools/scripts/pydoc3' ]
  78. if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"):
  79. scripts += [ 'Tools/scripts/2to3' ]
  80. + if not '--disable-idle3' in sysconfig.get_config_var("CONFIG_ARGS"):
  81. + scripts += [ 'Tools/scripts/idle3' ]
  82. setup(# PyPI Metadata (PEP 301)
  83. name = "Python",
  84. --
  85. 2.34.1