summaryrefslogtreecommitdiff
path: root/package/python/007-disable-extensions.patch
blob: 9365cb1f5b3438ebda316e0d725b94d27bacfcfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Index: b/Makefile.pre.in
===================================================================
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -156,6 +156,8 @@
 # configure script arguments
 CONFIG_ARGS=	@CONFIG_ARGS@
 
+# disabled extensions
+DISABLED_EXTENSIONS=	@DISABLED_EXTENSIONS@
 
 # Subdirectories with code
 SRCDIRS= 	@SRCDIRS@
@@ -477,6 +479,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
@@ -1191,7 +1194,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
@@ -2290,6 +2290,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
@@ -33,7 +33,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' (at the front) if