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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. From f1b15834045d0641c43014b970721df066fa71f7 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 08c5e8a..461c5e3 100644
  19. --- a/Makefile.pre.in
  20. +++ b/Makefile.pre.in
  21. @@ -1389,7 +1389,9 @@ bininstall: 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. @@ -1439,7 +1441,6 @@ LIBSUBDIRS= asyncio \
  32. ensurepip ensurepip/_bundled \
  33. html \
  34. http \
  35. - idlelib idlelib/Icons \
  36. importlib importlib/metadata \
  37. json \
  38. logging \
  39. @@ -1552,6 +1553,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: build_all $(srcdir)/Modules/xxmodule.c
  48. @for i in $(SCRIPTDIR) $(LIBDEST); \
  49. diff --git a/configure.ac b/configure.ac
  50. index e99a174..baaa743 100644
  51. --- a/configure.ac
  52. +++ b/configure.ac
  53. @@ -6073,6 +6073,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/ld_so_aix], [chmod +x Modules/ld_so_aix])
  65. diff --git a/setup.py b/setup.py
  66. index e30ed52..4dff249 100644
  67. --- a/setup.py
  68. +++ b/setup.py
  69. @@ -2722,11 +2722,14 @@ 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. +
  81. setup(# PyPI Metadata (PEP 301)
  82. name = "Python",
  83. version = sys.version.split()[0],
  84. --
  85. 2.30.2