The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / python3 / 016-distutils-no-pep3147.patch
1 Add distutils fix for PEP 3147 issue
2
3 Python 3 has a new standard for installing .pyc file, called PEP
4 3147. Unfortunately, this standard requires both the .py and .pyc
5 files to be installed for a Python module to be found. This is quite
6 annoying on space-constrained embedded systems, since the .py file is
7 technically not required for execution.
8
9 For the Python standard library, our Python 3 package already contains
10 a patch named python3-004-old-stdlib-cache.patch, which allows to
11 disable the PEP 3147 installation.
12
13 But that lives the distutils/setuptools package an unsolved
14 problem. This patch therefore adds a new patch to Python, which makes
15 distutils package use the traditional installation path when byte
16 compiling, rather than the PEP 3147 installation path. Since
17 setuptools relies on distutils internally, it also fixes setuptools
18 based packages.
19
20 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
21
22 Index: b/Lib/distutils/util.py
23 ===================================================================
24 --- a/Lib/distutils/util.py
25 +++ b/Lib/distutils/util.py
26 @@ -437,7 +437,9 @@
27              # Terminology from the py_compile module:
28              #   cfile - byte-compiled file
29              #   dfile - purported source filename (same as 'file' by default)
30 -            if optimize >= 0:
31 +            if "_python_sysroot" in os.environ:
32 +                cfile = file + (__debug__ and "c" or "o")
33 +            elif optimize >= 0:
34                  cfile = importlib.util.cache_from_source(
35                      file, debug_override=not optimize)
36              else: