summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@opendreambox.org>2012-02-25 02:19:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-26 11:42:34 +0000
commiteb8ce05d1315110bb1d297dcd4971edf3a54ca9a (patch)
tree191b265fc071d3bf2034ac44264a0fcb7c36996b /meta
parent6aa3a09876cebb3c2ef3a2d91bbdd10e1b5c6190 (diff)
downloadpoky-eb8ce05d1315110bb1d297dcd4971edf3a54ca9a.tar.gz
automake: 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. * 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. (From OE-Core rev: 40ccf816c597e7eed5243fb4b4e9473d2b58afaa) Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Khem Raj <raj.khem@gmail.com> The patch was imported from the OpenEmbedded git server (git://git.openembedded.org/openembedded) as of commit id aa4585c5065e05c759f16e1e8623fc7f40640f1b. Modified to apply to automake version 1.11.2 and to include a patch header. Also renamed the patch. Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/automake/automake/py-compile-compile-only-optimized-byte-code.patch42
-rw-r--r--meta/recipes-devtools/automake/automake_1.11.2.bb5
2 files changed, 45 insertions, 2 deletions
diff --git a/meta/recipes-devtools/automake/automake/py-compile-compile-only-optimized-byte-code.patch b/meta/recipes-devtools/automake/automake/py-compile-compile-only-optimized-byte-code.patch
new file mode 100644
index 0000000000..f09bfbca5d
--- /dev/null
+++ b/meta/recipes-devtools/automake/automake/py-compile-compile-only-optimized-byte-code.patch
@@ -0,0 +1,42 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3* OE-Core's python creates the same binary output
4 for both pyc and pyo, so disable the creation of
5 pyc files by automake.
6
7Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
8---
9 lib/py-compile | 17 -----------------
10 1 files changed, 0 insertions(+), 17 deletions(-)
11
12diff --git a/lib/py-compile b/lib/py-compile
13index 3f9d05b..101c814 100755
14--- a/lib/py-compile
15+++ b/lib/py-compile
16@@ -101,23 +101,6 @@ else
17 filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)"
18 fi
19
20-$PYTHON -c "
21-import sys, os, py_compile
22-
23-files = '''$files'''
24-
25-sys.stdout.write('Byte-compiling python modules...\n')
26-for file in files.split():
27- $pathtrans
28- $filetrans
29- if not os.path.exists(filepath) or not (len(filepath) >= 3
30- and filepath[-3:] == '.py'):
31- continue
32- sys.stdout.write(file)
33- sys.stdout.flush()
34- py_compile.compile(filepath, filepath + 'c', path)
35-sys.stdout.write('\n')" || exit $?
36-
37 # this will fail for python < 1.5, but that doesn't matter ...
38 $PYTHON -O -c "
39 import sys, os, py_compile
40--
411.7.0.4
42
diff --git a/meta/recipes-devtools/automake/automake_1.11.2.bb b/meta/recipes-devtools/automake/automake_1.11.2.bb
index 4534c390ba..4271336070 100644
--- a/meta/recipes-devtools/automake/automake_1.11.2.bb
+++ b/meta/recipes-devtools/automake/automake_1.11.2.bb
@@ -37,9 +37,10 @@ PATHFIXPATCH_virtclass-nativesdk = ""
37SRC_URI += "${PATHFIXPATCH} \ 37SRC_URI += "${PATHFIXPATCH} \
38 file://prefer-cpio-over-pax-for-ustar-archives.patch \ 38 file://prefer-cpio-over-pax-for-ustar-archives.patch \
39 file://python-libdir.patch \ 39 file://python-libdir.patch \
40 file://automake_1.11.2_fix_for_pkglibexec_SCRIPTS.patch" 40 file://automake_1.11.2_fix_for_pkglibexec_SCRIPTS.patch \
41 file://py-compile-compile-only-optimized-byte-code.patch"
41 42
42PR = "r1" 43PR = "r2"
43SRC_URI[md5sum] = "18194e804d415767bae8f703c963d456" 44SRC_URI[md5sum] = "18194e804d415767bae8f703c963d456"
44SRC_URI[sha256sum] = "4f46d1f9380c8a3506280750f630e9fc915cb1a435b724be56b499d016368718" 45SRC_URI[sha256sum] = "4f46d1f9380c8a3506280750f630e9fc915cb1a435b724be56b499d016368718"
45 46