X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fpython3%2F007-disable-extensions.patch;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fpython3%2F007-disable-extensions.patch;h=ce931f7284bba07247291180c92cacaeb7594754;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/python3/007-disable-extensions.patch b/cirros-testvm/src-cirros/buildroot-2015.05/package/python3/007-disable-extensions.patch new file mode 100644 index 0000000..ce931f7 --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/package/python3/007-disable-extensions.patch @@ -0,0 +1,100 @@ +Add infrastructure to disable the build of certain extensions + +Some of the extensions part of the Python core have dependencies on +external libraries (sqlite, tk, etc.) or are relatively big and not +necessarly always useful (CJK codecs for example). By extensions, we +mean part of Python modules that are written in C and therefore +compiled to binary code. + +Therefore, we introduce a small infrastructure that allows to disable +some of those extensions. This can be done inside the configure.ac by +adding values to the DISABLED_EXTENSIONS variable (which is a +word-separated list of extensions). + +The implementation works as follow : + + * configure.ac defines a DISABLED_EXTENSIONS variable, which is + substituted (so that when Makefile.pre is generated from + Makefile.pre.in, the value of the variable is substituted). For + now, this DISABLED_EXTENSIONS variable is empty, later patches will + use it. + + * Makefile.pre.in passes the DISABLED_EXTENSIONS value down to the + variables passed in the environment when calling the setup.py + script that actually builds and installs those extensions. + + * setup.py is modified so that the existing "disabled_module_list" is + filled with those pre-disabled extensions listed in + DISABLED_EXTENSIONS. + +Patch ported to python2.7 by Maxime Ripard , and +then extended by Thomas Petazzoni +. + +Signed-off-by: Thomas Petazzoni +--- + Makefile.pre.in | 4 ++++ + configure.ac | 2 ++ + setup.py | 5 ++++- + 3 files changed, 10 insertions(+), 1 deletion(-) + +Index: b/Makefile.pre.in +=================================================================== +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -180,6 +180,8 @@ + # configure script arguments + CONFIG_ARGS= @CONFIG_ARGS@ + ++# disabled extensions ++DISABLED_EXTENSIONS= @DISABLED_EXTENSIONS@ + + # Subdirectories with code + SRCDIRS= @SRCDIRS@ +@@ -577,6 +579,7 @@ + esac; \ + $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ + _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ ++ DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \ + $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build + + # Build static library +@@ -1387,7 +1390,8 @@ + # Install the dynamically loadable modules + # This goes into $(exec_prefix) + sharedinstall: sharedmods +- $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ ++ $(RUNSHARED) DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \ ++ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ + --prefix=$(prefix) \ + --install-scripts=$(BINDIR) \ + --install-platlib=$(DESTSHARED) \ +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -2369,6 +2369,8 @@ + + PKG_PROG_PKG_CONFIG + ++AC_SUBST(DISABLED_EXTENSIONS) ++ + # Check for use of the system expat library + AC_MSG_CHECKING(for --with-system-expat) + AC_ARG_WITH(system_expat, +Index: b/setup.py +=================================================================== +--- a/setup.py ++++ b/setup.py +@@ -39,7 +39,10 @@ + COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")) + + # This global variable is used to hold the list of modules to be disabled. +-disabled_module_list = [] ++try: ++ disabled_module_list = sysconfig.get_config_var("DISABLED_EXTENSIONS").split(" ") ++except KeyError: ++ disabled_module_list = list() + + def add_dir_to_list(dirlist, dir): + """Add the directory 'dir' to the list 'dirlist' (after any relative