007-disable-extensions.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. Index: b/Makefile.pre.in
  2. ===================================================================
  3. --- a/Makefile.pre.in
  4. +++ b/Makefile.pre.in
  5. @@ -156,6 +156,8 @@
  6. # configure script arguments
  7. CONFIG_ARGS= @CONFIG_ARGS@
  8. +# disabled extensions
  9. +DISABLED_EXTENSIONS= @DISABLED_EXTENSIONS@
  10. # Subdirectories with code
  11. SRCDIRS= @SRCDIRS@
  12. @@ -477,6 +479,7 @@
  13. esac; \
  14. $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
  15. _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
  16. + DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \
  17. $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
  18. # Build static library
  19. @@ -1191,7 +1194,8 @@
  20. # Install the dynamically loadable modules
  21. # This goes into $(exec_prefix)
  22. sharedinstall: sharedmods
  23. - $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
  24. + $(RUNSHARED) DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \
  25. + $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
  26. --prefix=$(prefix) \
  27. --install-scripts=$(BINDIR) \
  28. --install-platlib=$(DESTSHARED) \
  29. Index: b/configure.ac
  30. ===================================================================
  31. --- a/configure.ac
  32. +++ b/configure.ac
  33. @@ -2290,6 +2290,8 @@
  34. PKG_PROG_PKG_CONFIG
  35. +AC_SUBST(DISABLED_EXTENSIONS)
  36. +
  37. # Check for use of the system expat library
  38. AC_MSG_CHECKING(for --with-system-expat)
  39. AC_ARG_WITH(system_expat,
  40. Index: b/setup.py
  41. ===================================================================
  42. --- a/setup.py
  43. +++ b/setup.py
  44. @@ -33,7 +33,10 @@
  45. COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
  46. # This global variable is used to hold the list of modules to be disabled.
  47. -disabled_module_list = []
  48. +try:
  49. + disabled_module_list = sysconfig.get_config_var("DISABLED_EXTENSIONS").split(" ")
  50. +except KeyError:
  51. + disabled_module_list = list()
  52. def add_dir_to_list(dirlist, dir):
  53. """Add the directory 'dir' to the list 'dirlist' (at the front) if