Contents of /trunk/python/patches/python-3.7.0-disable_modules_and_ssl.patch
Parent Directory | Revision Log
Revision 3251 -
(show annotations)
(download)
Thu Nov 22 12:34:04 2018 UTC (5 years, 10 months ago) by niro
File size: 1947 byte(s)
Thu Nov 22 12:34:04 2018 UTC (5 years, 10 months ago) by niro
File size: 1947 byte(s)
-added rediffed version for python-3.7 from gentoo.org
1 | From f8f8262fbc351a6a55e43db8412fb1263a2f7b53 Mon Sep 17 00:00:00 2001 |
2 | From: Mike Gilbert <floppym@gentoo.org> |
3 | Date: Fri, 5 Jan 2018 13:30:32 -0500 |
4 | Subject: [PATCH 02/10] Disable modules and SSL |
5 | |
6 | --- |
7 | setup.py | 17 ++++++++++++++--- |
8 | 1 file changed, 14 insertions(+), 3 deletions(-) |
9 | |
10 | diff --git a/setup.py b/setup.py |
11 | index a97a7559ca..16e2db7617 100644 |
12 | --- a/setup.py |
13 | +++ b/setup.py |
14 | @@ -43,7 +43,17 @@ host_platform = get_platform() |
15 | COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")) |
16 | |
17 | # This global variable is used to hold the list of modules to be disabled. |
18 | -disabled_module_list = [] |
19 | +pdm_env = "PYTHON_DISABLE_MODULES" |
20 | +if pdm_env in os.environ: |
21 | + disabled_module_list = os.environ[pdm_env].split() |
22 | +else: |
23 | + disabled_module_list = [] |
24 | + |
25 | +pds_env = "PYTHON_DISABLE_SSL" |
26 | +if pds_env in os.environ: |
27 | + disable_ssl = os.environ[pds_env] |
28 | +else: |
29 | + disable_ssl = 0 |
30 | |
31 | def add_dir_to_list(dirlist, dir): |
32 | """Add the directory 'dir' to the list 'dirlist' (after any relative |
33 | @@ -537,6 +547,7 @@ class PyBuildExt(build_ext): |
34 | os.unlink(tmpfile) |
35 | |
36 | def detect_modules(self): |
37 | + global disable_ssl |
38 | # Ensure that /usr/local is always used, but the local build |
39 | # directories (i.e. '.' and 'Include') must be first. See issue |
40 | # 10520. |
41 | @@ -876,11 +887,11 @@ class PyBuildExt(build_ext): |
42 | depends = ['socketmodule.h']) ) |
43 | # Detect SSL support for the socket module (via _ssl) |
44 | ssl_ext, hashlib_ext = self._detect_openssl(inc_dirs, lib_dirs) |
45 | - if ssl_ext is not None: |
46 | + if ssl_ext is not None and not disable_ssl: |
47 | exts.append(ssl_ext) |
48 | else: |
49 | missing.append('_ssl') |
50 | - if hashlib_ext is not None: |
51 | + if hashlib_ext is not None and not disable_ssl: |
52 | exts.append(hashlib_ext) |
53 | else: |
54 | missing.append('_hashlib') |
55 | -- |
56 | 2.18.0 |
57 |