[oe-commits] Michael 'Mickey' Lauer : python[-native]: fix building ctypes for native version

git version control git at git.openembedded.org
Sat May 30 17:12:34 UTC 2009


Module: openembedded.git
Branch: fso/milestone5.5
Commit: 2832d9595495765916e144edb443409ce923f683
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=2832d9595495765916e144edb443409ce923f683

Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date:   Wed May 13 17:46:41 2009 +0200

python[-native]: fix building ctypes for native version
switch to INC_PR scheme

---

 .../05-enable-ctypes-cross-build.patch             |   28 ++++++++++++++++++++
 recipes/python/python-native_2.6.1.bb              |    2 +
 recipes/python/python.inc                          |    2 +-
 recipes/python/python_2.6.2.bb                     |    2 +-
 4 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/recipes/python/python-native-2.6.1/05-enable-ctypes-cross-build.patch b/recipes/python/python-native-2.6.1/05-enable-ctypes-cross-build.patch
new file mode 100644
index 0000000..def8238
--- /dev/null
+++ b/recipes/python/python-native-2.6.1/05-enable-ctypes-cross-build.patch
@@ -0,0 +1,28 @@
+# CTypes need to know the actual host we are building on.
+# Signed-Off: Michael Dietrich <mdt at emdete.de>
+
+Index: Python-2.6.1/setup.py
+===================================================================
+--- Python-2.6.1.orig/setup.py
++++ Python-2.6.1/setup.py
+@@ -1656,16 +1656,16 @@ class PyBuildExt(build_ext):
+                                          ffi_configfile):
+                 from distutils.dir_util import mkpath
+                 mkpath(ffi_builddir)
+-                config_args = []
++                config_args = [] # '--host=%s' % os.environ["HOST_SYS"], ]
+ 
+                 # Pass empty CFLAGS because we'll just append the resulting
+                 # CFLAGS to Python's; -g or -O2 is to be avoided.
+-                cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
+-                      % (ffi_builddir, ffi_srcdir, " ".join(config_args))
++                cmd = "(cd %s && autoconf -W cross) && (cd %s && env CFLAGS='' '%s/configure' %s)" \
++                      % (ffi_srcdir, ffi_builddir, ffi_srcdir, " ".join(config_args))
+ 
+                 res = os.system(cmd)
+                 if res or not os.path.exists(ffi_configfile):
+-                    print "Failed to configure _ctypes module"
++                    print "Failed to configure _ctypes module (res=%d) or missing conffile=%s" % ( res, ffi_configfile )
+                     return False
+ 
+             fficonfig = {}
diff --git a/recipes/python/python-native_2.6.1.bb b/recipes/python/python-native_2.6.1.bb
index 3ae4828..b5382ae 100644
--- a/recipes/python/python-native_2.6.1.bb
+++ b/recipes/python/python-native_2.6.1.bb
@@ -1,10 +1,12 @@
 require python.inc
 DEPENDS = "openssl-native bzip2-full-native"
+PR = "${INC_PR}.1"
 
 SRC_URI = "\
   http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
   file://00-fix-bindir-libdir-for-cross.patch;patch=1 \
   file://04-default-is-optimized.patch;patch=1 \
+  file://05-enable-ctypes-cross-build.patch;patch=1 \
   file://10-distutils-fix-swig-parameter.patch;patch=1 \
   file://11-distutils-never-modify-shebang-line.patch;patch=1 \
   file://12-distutils-prefix-is-inside-staging-area.patch;patch=1 \
diff --git a/recipes/python/python.inc b/recipes/python/python.inc
index 1e53e69..598d97c 100644
--- a/recipes/python/python.inc
+++ b/recipes/python/python.inc
@@ -4,7 +4,7 @@ LICENSE = "PSF"
 SECTION = "devel/python"
 PRIORITY = "optional"
 # bump this on every change in contrib/python/generate-manifest-2.6.py
-PR = "ml2"
+INC_PR = "ml4"
 
 DEFAULT_PREFERENCE = "-26"
 
diff --git a/recipes/python/python_2.6.2.bb b/recipes/python/python_2.6.2.bb
index 3ecac8f..a540b34 100644
--- a/recipes/python/python_2.6.2.bb
+++ b/recipes/python/python_2.6.2.bb
@@ -1,7 +1,7 @@
 require python.inc
 DEPENDS = "python-native db gdbm openssl readline sqlite3 tcl tk zlib"
 DEPENDS_sharprom = "python-native db readline zlib gdbm openssl"
-PR = "ml0"
+PR = "{$INC_PR}.1"
 
 SRC_URI = "\
   http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \





More information about the Openembedded-commits mailing list