[oe-commits] Andreas Oberritter : automake-1.11.1: omit compilation of pyc files on install

git version control git at git.openembedded.org
Fri Oct 22 03:30:55 UTC 2010


Module: openembedded.git
Branch: kergoth/autotools
Commit: aa4585c5065e05c759f16e1e8623fc7f40640f1b
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=aa4585c5065e05c759f16e1e8623fc7f40640f1b

Author: Andreas Oberritter <obi at opendreambox.org>
Date:   Fri Oct 15 02:16:00 2010 +0000

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 at opendreambox.org>
Signed-off-by: Khem Raj <raj.khem at gmail.com>

---

 recipes/automake/automake_1.11.1.bb                |    4 +-
 ...-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 74477e7..0579875 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 0000000..1eca0a8
--- /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 at 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
+





More information about the Openembedded-commits mailing list