diff options
author | Andreas Oberritter <obi@opendreambox.org> | 2010-10-15 02:16:00 +0000 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2010-10-20 18:30:24 -0700 |
commit | aa4585c5065e05c759f16e1e8623fc7f40640f1b (patch) | |
tree | af7123d7932e3093fda32b0700a020b1925ba02e /recipes | |
parent | 4292ef191122b77b7d1890b74ab988e8c1f58615 (diff) | |
download | openembedded-aa4585c5065e05c759f16e1e8623fc7f40640f1b.tar.gz |
automake-1.11.1: omit compilation of pyc files on install
* On install, automake calls py-compile, which previously
compiled python source code to pyc and pyo, which both
got packaged.
* The python interpreter in OE contains patches to enable
optimization (pyo) by default:
04-default-is-optimized.patch
99-ignore-optimization-flag.patch
* automake created pyc files by calling py_compile.compile()
and adding the c suffix manually, resulting in identical
byte code for both pyc and pyo files.
* 0001-py-compile-compile-only-optimized-byte-code.patch
applies to automake 1.11 and automake master, but older
versions require a slightly modified patch. However,
older versions are only pinned by chinook-compat and
nylon, so I left them untouched.
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/automake/automake_1.11.1.bb | 4 | ||||
-rw-r--r-- | recipes/automake/files/0001-py-compile-compile-only-optimized-byte-code.patch | 42 |
2 files changed, 45 insertions, 1 deletions
diff --git a/recipes/automake/automake_1.11.1.bb b/recipes/automake/automake_1.11.1.bb index 74477e7b95..057987508f 100644 --- a/recipes/automake/automake_1.11.1.bb +++ b/recipes/automake/automake_1.11.1.bb @@ -1,5 +1,7 @@ require automake.inc -PR = "${INC_PR}.0" +PR = "${INC_PR}.1" + +SRC_URI += "file://0001-py-compile-compile-only-optimized-byte-code.patch" SRC_URI[automake.md5sum] = "c2972c4d9b3e29c03d5f2af86249876f" SRC_URI[automake.sha256sum] = "5b159d3c0e0a1f87de71b68bcb9f1a1c49e9e71749c9b723f17e2e1e0295c7ae" diff --git a/recipes/automake/files/0001-py-compile-compile-only-optimized-byte-code.patch b/recipes/automake/files/0001-py-compile-compile-only-optimized-byte-code.patch new file mode 100644 index 0000000000..1eca0a8b64 --- /dev/null +++ b/recipes/automake/files/0001-py-compile-compile-only-optimized-byte-code.patch @@ -0,0 +1,42 @@ +upstream: OE-only + +From 4f84894b3df47ce797100f25d2d79f08bb27cd0d Mon Sep 17 00:00:00 2001 +From: Andreas Oberritter <obi@opendreambox.org> +Date: Thu, 14 Oct 2010 12:25:50 +0200 +Subject: [PATCH] py-compile: compile only optimized byte code + +--- + lib/py-compile | 17 ----------------- + 1 files changed, 0 insertions(+), 17 deletions(-) + +diff --git a/lib/py-compile b/lib/py-compile +index 3f9d05b..101c814 100755 +--- a/lib/py-compile ++++ b/lib/py-compile +@@ -101,23 +101,6 @@ else + filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" + fi + +-$PYTHON -c " +-import sys, os, py_compile +- +-files = '''$files''' +- +-sys.stdout.write('Byte-compiling python modules...\n') +-for file in files.split(): +- $pathtrans +- $filetrans +- if not os.path.exists(filepath) or not (len(filepath) >= 3 +- and filepath[-3:] == '.py'): +- continue +- sys.stdout.write(file) +- sys.stdout.flush() +- py_compile.compile(filepath, filepath + 'c', path) +-sys.stdout.write('\n')" || exit $? +- + # this will fail for python < 1.5, but that doesn't matter ... + $PYTHON -O -c " + import sys, os, py_compile +-- +1.7.0.4 + |