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 / 004-old-stdlib-cache.patch
1 python3: Fix pyc-only related runtime exceptions
2
3 Python3 changes the pyc lookup strategy, ignoring the
4 __pycache__ directory if the .py file is missing. Change
5 install location to enable use of .pyc without their parent .py
6
7 See http://www.python.org/dev/peps/pep-3147
8
9 Signed-off-by: Daniel Nelson <daniel@sigpwr.com>
10
11 Index: b/configure.ac
12 ===================================================================
13 --- a/configure.ac
14 +++ b/configure.ac
15 @@ -352,6 +352,23 @@
16  AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
17  AC_SUBST(FRAMEWORKINSTALLAPPSPREFIX)
18  
19 +STDLIB_CACHE_FLAGS=
20 +AC_MSG_CHECKING(for --enable-old-stdlib-cache)
21 +AC_ARG_ENABLE(old-stdlib-cache,
22 +    AS_HELP_STRING([--enable-old-stdlib-cache], [enable pre-pep3147 stdlib cache]),
23 +[
24 +    if test "$enableval" = "yes"
25 +    then
26 +        STDLIB_CACHE_FLAGS="-b"
27 +    else
28 +        STDLIB_CACHE_FLAGS="" 
29 +    fi
30 +],
31 +[
32 +    STDLIB_CACHE_FLAGS="" 
33 +])
34 +AC_SUBST(STDLIB_CACHE_FLAGS)
35 +
36  ##AC_ARG_WITH(dyld,
37  ##            AS_HELP_STRING([--with-dyld],
38  ##                           [Use (OpenStep|Rhapsody) dynamic linker]))
39 Index: b/Makefile.pre.in
40 ===================================================================
41 --- a/Makefile.pre.in
42 +++ b/Makefile.pre.in
43 @@ -162,6 +162,9 @@
44  # Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
45  OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@
46  
47 +# Option to enable old-style precompiled stdlib
48 +STDLIB_CACHE_FLAGS=@STDLIB_CACHE_FLAGS@
49 +
50  # Environment to run shared python without installed libraries
51  RUNSHARED=       @RUNSHARED@
52  
53 @@ -1247,21 +1250,21 @@
54         fi
55         -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
56                 $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
57 -               -d $(LIBDEST) -f \
58 +               -d $(LIBDEST) -f $(STDLIB_CACHE_FLAGS) \
59                 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
60                 $(DESTDIR)$(LIBDEST)
61         -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
62                 $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
63 -               -d $(LIBDEST) -f \
64 +               -d $(LIBDEST) -f $(STDLIB_CACHE_FLAGS) \
65                 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
66                 $(DESTDIR)$(LIBDEST)
67         -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
68                 $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
69 -               -d $(LIBDEST)/site-packages -f \
70 +               -d $(LIBDEST)/site-packages -f $(STDLIB_CACHE_FLAGS) \
71                 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
72         -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
73                 $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
74 -               -d $(LIBDEST)/site-packages -f \
75 +               -d $(LIBDEST)/site-packages -f $(STDLIB_CACHE_FLAGS) \
76                 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
77         -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
78                 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt