be4d9437ae0deadce3d19f832f80104bfe4454a5
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / python / 007-disable-extensions.patch
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  
9 +# disabled extensions
10 +DISABLED_EXTENSIONS=   @DISABLED_EXTENSIONS@
11  
12  # Subdirectories with code
13  SRCDIRS=       @SRCDIRS@
14 @@ -477,6 +479,7 @@
15         esac; \
16         $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
17                 _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
18 +               DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \
19                 $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
20  
21  # Build static library
22 @@ -1191,7 +1194,8 @@
23  # Install the dynamically loadable modules
24  # This goes into $(exec_prefix)
25  sharedinstall: sharedmods
26 -       $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
27 +       $(RUNSHARED) DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \
28 +               $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
29                 --prefix=$(prefix) \
30                 --install-scripts=$(BINDIR) \
31                 --install-platlib=$(DESTSHARED) \
32 Index: b/configure.ac
33 ===================================================================
34 --- a/configure.ac
35 +++ b/configure.ac
36 @@ -2284,6 +2284,8 @@
37  
38  AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
39  
40 +AC_SUBST(DISABLED_EXTENSIONS)
41 +
42  # Check for use of the system expat library
43  AC_MSG_CHECKING(for --with-system-expat)
44  AC_ARG_WITH(system_expat,
45 Index: b/setup.py
46 ===================================================================
47 --- a/setup.py
48 +++ b/setup.py
49 @@ -33,7 +33,10 @@
50  COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
51  
52  # This global variable is used to hold the list of modules to be disabled.
53 -disabled_module_list = []
54 +try:
55 +    disabled_module_list = sysconfig.get_config_var("DISABLED_EXTENSIONS").split(" ")
56 +except KeyError:
57 +    disabled_module_list = list()
58  
59  def add_dir_to_list(dirlist, dir):
60      """Add the directory 'dir' to the list 'dirlist' (at the front) if