2
1

python3-112-old-stdlib-cache.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. python3: Fix pyc-only related runtime exceptions
  2. Python3 changes the pyc lookup strategy, ignoring the
  3. __pycache__ directory if the .py file is missing. Change
  4. install location to enable use of .pyc without their parent .py
  5. See http://www.python.org/dev/peps/pep-3147
  6. Signed-off-by: Daniel Nelson <daniel@sigpwr.com>
  7. --- python3-3.3.0/configure.ac 2013-01-27 16:35:52.429067797 -0800
  8. +++ python3-3.3.0/configure.ac 2013-01-27 16:43:43.528601443 -0800
  9. @@ -1827,6 +1827,23 @@
  10. LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
  11. esac
  12. +STDLIB_CACHE_FLAGS=
  13. +AC_MSG_CHECKING(for --enable-old-stdlib-cache)
  14. +AC_ARG_ENABLE(old-stdlib-cache,
  15. + AS_HELP_STRING([--enable-old-stdlib-cache], [enable pre-pep3147 stdlib cache]),
  16. +[
  17. + if test "$enableval" = "yes"
  18. + then
  19. + STDLIB_CACHE_FLAGS="-b"
  20. + else
  21. + STDLIB_CACHE_FLAGS=""
  22. + fi
  23. +],
  24. +[
  25. + STDLIB_CACHE_FLAGS=""
  26. +])
  27. +AC_SUBST(STDLIB_CACHE_FLAGS)
  28. +
  29. AC_MSG_CHECKING(for --enable-framework)
  30. if test "$enable_framework"
  31. then
  32. --- python3-3.3.0/Makefile.pre.in 2013-01-27 16:35:52.422067642 -0800
  33. +++ python3-3.3.0/Makefile.pre.in 2013-01-27 16:37:03.710650439 -0800
  34. @@ -143,6 +143,9 @@
  35. # Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
  36. OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@
  37. +# Option to enable old-style precompiled stdlib
  38. +STDLIB_CACHE_FLAGS=@STDLIB_CACHE_FLAGS@
  39. +
  40. # Environment to run shared python without installed libraries
  41. RUNSHARED= @RUNSHARED@
  42. @@ -1079,12 +1082,12 @@
  43. fi
  44. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  45. $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
  46. - -d $(LIBDEST) -f \
  47. + -d $(LIBDEST) -f $(STDLIB_CACHE_FLAGS) \
  48. -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
  49. $(DESTDIR)$(LIBDEST)
  50. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  51. $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
  52. - -d $(LIBDEST)/site-packages -f \
  53. + -d $(LIBDEST)/site-packages -f $(STDLIB_CACHE_FLAGS) \
  54. -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  55. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  56. $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt