All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Python related patches
@ 2012-03-12 21:24 Andreas Oberritter
  2012-03-12 21:24 ` [PATCH 1/5] python, python-native: always set platform to linux2 Andreas Oberritter
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Andreas Oberritter @ 2012-03-12 21:24 UTC (permalink / raw)
  To: openembedded-core

This set of patches obsoletes all my pending
python-related patches. See the individual patches
for detailed descriptions.

All patches were runtime-tested on mips32el.

Andreas Oberritter (5):
  python, python-native: always set platform to linux2
  python: regenerate plat-linux2/*.py
  python: depend on bzip2
  python-native: distutils: don't use libdir, remove dead code path
  python, python-native: bump PR

 ...2-distutils-prefix-is-inside-staging-area.patch |    6 ++--
 .../sys_platform_is_now_always_linux2.patch        |   39 ++++++++++++++++++++
 .../recipes-devtools/python/python-native_2.7.2.bb |    1 +
 meta/recipes-devtools/python/python.inc            |    2 +-
 .../python/python/07-linux3-regen-fix.patch        |   18 ---------
 .../python/sys_platform_is_now_always_linux2.patch |   39 ++++++++++++++++++++
 meta/recipes-devtools/python/python_2.7.2.bb       |   15 +++++++-
 7 files changed, 96 insertions(+), 24 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch
 delete mode 100644 meta/recipes-devtools/python/python/07-linux3-regen-fix.patch
 create mode 100644 meta/recipes-devtools/python/python/sys_platform_is_now_always_linux2.patch

-- 
1.7.5.4




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] python, python-native: always set platform to linux2
  2012-03-12 21:24 [PATCH 0/5] Python related patches Andreas Oberritter
@ 2012-03-12 21:24 ` Andreas Oberritter
  2012-03-12 21:24 ` [PATCH 2/5] python: regenerate plat-linux2/*.py Andreas Oberritter
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Andreas Oberritter @ 2012-03-12 21:24 UTC (permalink / raw)
  To: openembedded-core

* Fixes many problems with linux2 vs. linux3. At least:
  - Detected version was from build-host instead of target-host.
  - linuxaudiodev and ossaudiodev were disabled for linux3.
  - Files were missing in /usr/lib/python2.7/plat-linux3.
* Imported from upstream HG rev c816479f6aaf
* Bugtracker URL: http://bugs.python.org/issue12326

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 .../sys_platform_is_now_always_linux2.patch        |   39 ++++++++++++++++++++
 .../recipes-devtools/python/python-native_2.7.2.bb |    1 +
 .../python/python/07-linux3-regen-fix.patch        |   18 ---------
 .../python/sys_platform_is_now_always_linux2.patch |   39 ++++++++++++++++++++
 meta/recipes-devtools/python/python_2.7.2.bb       |    2 +-
 5 files changed, 80 insertions(+), 19 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch
 delete mode 100644 meta/recipes-devtools/python/python/07-linux3-regen-fix.patch
 create mode 100644 meta/recipes-devtools/python/python/sys_platform_is_now_always_linux2.patch

diff --git a/meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch b/meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch
new file mode 100644
index 0000000..ed52936
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Accepted [http://hg.python.org/cpython/rev/c816479f6aaf/]
+Bugtracker: http://bugs.python.org/issue12326
+
+[Removed "Misc/NEWS" hunk]
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+# HG changeset patch
+# User Victor Stinner <victor.stinner@haypocalc.com>
+# Date 1313841758 -7200
+# Node ID c816479f6aaf71dbd3f3fe4b239186d60c55ce48
+# Parent  3e093590ac57fdda428c7da3f72ddf0c475ecf2b
+Issue #12326: sys.platform is now always 'linux2' on Linux
+
+Even if Python is compiled on Linux 3.
+
+diff --git a/configure b/configure
+--- a/configure
++++ b/configure
+@@ -2995,6 +2995,7 @@ then
+ 	MACHDEP="$ac_md_system$ac_md_release"
+ 
+ 	case $MACHDEP in
++	linux*) MACHDEP="linux2";;
+ 	cygwin*) MACHDEP="cygwin";;
+ 	darwin*) MACHDEP="darwin";;
+ 	atheos*) MACHDEP="atheos";;
+diff --git a/configure.in b/configure.in
+--- a/configure.in
++++ b/configure.in
+@@ -293,6 +293,7 @@ then
+ 	MACHDEP="$ac_md_system$ac_md_release"
+ 
+ 	case $MACHDEP in
++	linux*) MACHDEP="linux2";;
+ 	cygwin*) MACHDEP="cygwin";;
+ 	darwin*) MACHDEP="darwin";;
+ 	atheos*) MACHDEP="atheos";;
+
diff --git a/meta/recipes-devtools/python/python-native_2.7.2.bb b/meta/recipes-devtools/python/python-native_2.7.2.bb
index 8bf0af0..b00e2fc 100644
--- a/meta/recipes-devtools/python/python-native_2.7.2.bb
+++ b/meta/recipes-devtools/python/python-native_2.7.2.bb
@@ -13,6 +13,7 @@ SRC_URI += "file://04-default-is-optimized.patch \
            file://nohostlibs.patch \
            file://multilib.patch \
            file://add-md5module-support.patch \
+           file://sys_platform_is_now_always_linux2.patch \
            "
 S = "${WORKDIR}/Python-${PV}"
 
diff --git a/meta/recipes-devtools/python/python/07-linux3-regen-fix.patch b/meta/recipes-devtools/python/python/07-linux3-regen-fix.patch
deleted file mode 100644
index d7fb313..0000000
--- a/meta/recipes-devtools/python/python/07-linux3-regen-fix.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Upstream-Status: Inappropriate [embedded specific]
-
-Without this patch it calls cross-compiled python if host is running linux-3.0
-python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h
-| ./regen: line 3: /OE/shr-core/tmp/work/armv4t-oe-linux-gnueabi/python-2.6.6-nk2.8/Python-2.6.6/python: cannot execute binary file
-
-diff -uNr Python-2.6.6.orig//Lib/plat-linux3/regen Python-2.6.6/Lib/plat-linux3/regen
---- Python-2.6.6.orig//Lib/plat-linux3/regen	1970-01-01 01:00:00.000000000 +0100
-+++ Python-2.6.6/Lib/plat-linux3/regen	2001-08-09 14:48:17.000000000 +0200
-@@ -0,0 +1,8 @@
-+#! /bin/sh
-+case `uname` in
-+Linux*)	;;
-+*)	echo Probably not on a Linux system 1>&2
-+	exit 1;;
-+esac
-+set -v
-+h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/dlfcn.h
diff --git a/meta/recipes-devtools/python/python/sys_platform_is_now_always_linux2.patch b/meta/recipes-devtools/python/python/sys_platform_is_now_always_linux2.patch
new file mode 100644
index 0000000..ed52936
--- /dev/null
+++ b/meta/recipes-devtools/python/python/sys_platform_is_now_always_linux2.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Accepted [http://hg.python.org/cpython/rev/c816479f6aaf/]
+Bugtracker: http://bugs.python.org/issue12326
+
+[Removed "Misc/NEWS" hunk]
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+# HG changeset patch
+# User Victor Stinner <victor.stinner@haypocalc.com>
+# Date 1313841758 -7200
+# Node ID c816479f6aaf71dbd3f3fe4b239186d60c55ce48
+# Parent  3e093590ac57fdda428c7da3f72ddf0c475ecf2b
+Issue #12326: sys.platform is now always 'linux2' on Linux
+
+Even if Python is compiled on Linux 3.
+
+diff --git a/configure b/configure
+--- a/configure
++++ b/configure
+@@ -2995,6 +2995,7 @@ then
+ 	MACHDEP="$ac_md_system$ac_md_release"
+ 
+ 	case $MACHDEP in
++	linux*) MACHDEP="linux2";;
+ 	cygwin*) MACHDEP="cygwin";;
+ 	darwin*) MACHDEP="darwin";;
+ 	atheos*) MACHDEP="atheos";;
+diff --git a/configure.in b/configure.in
+--- a/configure.in
++++ b/configure.in
+@@ -293,6 +293,7 @@ then
+ 	MACHDEP="$ac_md_system$ac_md_release"
+ 
+ 	case $MACHDEP in
++	linux*) MACHDEP="linux2";;
+ 	cygwin*) MACHDEP="cygwin";;
+ 	darwin*) MACHDEP="darwin";;
+ 	atheos*) MACHDEP="atheos";;
+
diff --git a/meta/recipes-devtools/python/python_2.7.2.bb b/meta/recipes-devtools/python/python_2.7.2.bb
index 2b18c53..7c2ce57 100644
--- a/meta/recipes-devtools/python/python_2.7.2.bb
+++ b/meta/recipes-devtools/python/python_2.7.2.bb
@@ -12,7 +12,6 @@ SRC_URI += "\
   file://05-enable-ctypes-cross-build.patch \
   file://06-ctypes-libffi-fix-configure.patch \
   file://06-avoid_usr_lib_termcap_path_in_linking.patch \
-  file://07-linux3-regen-fix.patch \
   file://99-ignore-optimization-flag.patch \
   ${DISTRO_SRC_URI} \
   file://multilib.patch \
@@ -21,6 +20,7 @@ SRC_URI += "\
   file://setup_py_skip_cross_import_check.patch \
   file://add-md5module-support.patch \
   file://host_include_contamination.patch \
+  file://sys_platform_is_now_always_linux2.patch \
 "
 
 S = "${WORKDIR}/Python-${PV}"
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] python: regenerate plat-linux2/*.py
  2012-03-12 21:24 [PATCH 0/5] Python related patches Andreas Oberritter
  2012-03-12 21:24 ` [PATCH 1/5] python, python-native: always set platform to linux2 Andreas Oberritter
@ 2012-03-12 21:24 ` Andreas Oberritter
  2012-03-12 21:24 ` [PATCH 3/5] python: depend on bzip2 Andreas Oberritter
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Andreas Oberritter @ 2012-03-12 21:24 UTC (permalink / raw)
  To: openembedded-core

* If plat-linux2/DLFCN.py was present, python was broken in our
  image, i.e. it was unable to load many modules. This was due
  to changed RTLD_* constants in dlfcn.h
* Python includes a script, plat-linux2/regen, to regenerate
  the py source codes in this directory.
* Do what plat-linux2/regen would do, but use files from
  STAGING_INCDIR.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/python/python_2.7.2.bb |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/meta/recipes-devtools/python/python_2.7.2.bb b/meta/recipes-devtools/python/python_2.7.2.bb
index 7c2ce57..6317bb9 100644
--- a/meta/recipes-devtools/python/python_2.7.2.bb
+++ b/meta/recipes-devtools/python/python_2.7.2.bb
@@ -37,6 +37,17 @@ do_configure_prepend() {
 }
 
 do_compile() {
+        # regenerate platform specific files, because they depend on system headers
+        cd Lib/plat-linux2
+        include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python \
+                ${S}/Tools/scripts/h2py.py -i '(u_long)' \
+                ${STAGING_INCDIR}/dlfcn.h \
+                ${STAGING_INCDIR}/linux/cdrom.h \
+                ${STAGING_INCDIR}/netinet/in.h \
+                ${STAGING_INCDIR}/sys/types.h
+        sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
+        cd -
+
 	#
 	# Copy config.h and an appropriate Makefile for distutils.sysconfig,
 	# which laters uses the information out of these to compile extensions
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] python: depend on bzip2
  2012-03-12 21:24 [PATCH 0/5] Python related patches Andreas Oberritter
  2012-03-12 21:24 ` [PATCH 1/5] python, python-native: always set platform to linux2 Andreas Oberritter
  2012-03-12 21:24 ` [PATCH 2/5] python: regenerate plat-linux2/*.py Andreas Oberritter
@ 2012-03-12 21:24 ` Andreas Oberritter
  2012-03-12 21:24 ` [PATCH 4/5] python-native: distutils: don't use libdir, remove dead code path Andreas Oberritter
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Andreas Oberritter @ 2012-03-12 21:24 UTC (permalink / raw)
  To: openembedded-core

* Python auto-detects libbz2 and there's no way to
  force-disable it, so just enable it.
* Adds bz2 support to python-compression.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/python/python_2.7.2.bb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-devtools/python/python_2.7.2.bb b/meta/recipes-devtools/python/python_2.7.2.bb
index 6317bb9..6214c71 100644
--- a/meta/recipes-devtools/python/python_2.7.2.bb
+++ b/meta/recipes-devtools/python/python_2.7.2.bb
@@ -1,5 +1,5 @@
 require python.inc
-DEPENDS = "python-native db gdbm openssl readline sqlite3 zlib"
+DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib"
 DEPENDS_sharprom = "python-native db readline zlib gdbm openssl"
 PR = "${INC_PR}.6"
 
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] python-native: distutils: don't use libdir, remove dead code path
  2012-03-12 21:24 [PATCH 0/5] Python related patches Andreas Oberritter
                   ` (2 preceding siblings ...)
  2012-03-12 21:24 ` [PATCH 3/5] python: depend on bzip2 Andreas Oberritter
@ 2012-03-12 21:24 ` Andreas Oberritter
  2012-03-12 21:24 ` [PATCH 5/5] python, python-native: bump PR Andreas Oberritter
  2012-03-13 16:32 ` [PATCH 0/5] Python related patches Saul Wold
  5 siblings, 0 replies; 7+ messages in thread
From: Andreas Oberritter @ 2012-03-12 21:24 UTC (permalink / raw)
  To: openembedded-core

* Coming from OE-classic it was surprising that python-native now
  requires 'libdir' to be exported. Otherwise autoconf would fail
  to detect python libraries. This happend using a customized
  environment setup script to use OE's compiler and libs without
  bitbake.
* Use STAGING_LIBDIR instead of libdir.
* While at it, remove redundant 'and' statments.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 ...2-distutils-prefix-is-inside-staging-area.patch |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
index b46caf6..f89aaff 100644
--- a/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
+++ b/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
@@ -30,13 +30,13 @@ Upstream-Status: Inappropriate [embedded specific]
      If 'prefix' is supplied, use it instead of sys.prefix or
      sys.exec_prefix -- i.e., ignore 'plat_specific'.
      """
-+    lib_basename = os.getenv("libdir").split('/')[-1]
++    lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
      if prefix is None:
 -        prefix = plat_specific and EXEC_PREFIX or PREFIX
 +        if plat_specific:
-+            prefix = plat_specific and os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
++            prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
 +        else:
-+            prefix = plat_specific and EXEC_PREFIX or PREFIX
++            prefix = PREFIX
  
      if os.name == "posix":
          libpython = os.path.join(prefix,
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] python, python-native: bump PR
  2012-03-12 21:24 [PATCH 0/5] Python related patches Andreas Oberritter
                   ` (3 preceding siblings ...)
  2012-03-12 21:24 ` [PATCH 4/5] python-native: distutils: don't use libdir, remove dead code path Andreas Oberritter
@ 2012-03-12 21:24 ` Andreas Oberritter
  2012-03-13 16:32 ` [PATCH 0/5] Python related patches Saul Wold
  5 siblings, 0 replies; 7+ messages in thread
From: Andreas Oberritter @ 2012-03-12 21:24 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/recipes-devtools/python/python.inc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-devtools/python/python.inc b/meta/recipes-devtools/python/python.inc
index 3e970a7..aaf11ac 100644
--- a/meta/recipes-devtools/python/python.inc
+++ b/meta/recipes-devtools/python/python.inc
@@ -3,7 +3,7 @@ HOMEPAGE = "http://www.python.org"
 LICENSE = "PSFv2"
 SECTION = "devel/python"
 # bump this on every change in contrib/python/generate-manifest-2.7.py
-INC_PR = "r0"
+INC_PR = "r1"
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=2dffb81509b47974467ea23409909b1c"
 
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5] Python related patches
  2012-03-12 21:24 [PATCH 0/5] Python related patches Andreas Oberritter
                   ` (4 preceding siblings ...)
  2012-03-12 21:24 ` [PATCH 5/5] python, python-native: bump PR Andreas Oberritter
@ 2012-03-13 16:32 ` Saul Wold
  5 siblings, 0 replies; 7+ messages in thread
From: Saul Wold @ 2012-03-13 16:32 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 03/12/2012 02:24 PM, Andreas Oberritter wrote:
> This set of patches obsoletes all my pending
> python-related patches. See the individual patches
> for detailed descriptions.
>
> All patches were runtime-tested on mips32el.
>
> Andreas Oberritter (5):
>    python, python-native: always set platform to linux2
>    python: regenerate plat-linux2/*.py
>    python: depend on bzip2
>    python-native: distutils: don't use libdir, remove dead code path
>    python, python-native: bump PR
>
>   ...2-distutils-prefix-is-inside-staging-area.patch |    6 ++--
>   .../sys_platform_is_now_always_linux2.patch        |   39 ++++++++++++++++++++
>   .../recipes-devtools/python/python-native_2.7.2.bb |    1 +
>   meta/recipes-devtools/python/python.inc            |    2 +-
>   .../python/python/07-linux3-regen-fix.patch        |   18 ---------
>   .../python/sys_platform_is_now_always_linux2.patch |   39 ++++++++++++++++++++
>   meta/recipes-devtools/python/python_2.7.2.bb       |   15 +++++++-
>   7 files changed, 96 insertions(+), 24 deletions(-)
>   create mode 100644 meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch
>   delete mode 100644 meta/recipes-devtools/python/python/07-linux3-regen-fix.patch
>   create mode 100644 meta/recipes-devtools/python/python/sys_platform_is_now_always_linux2.patch
>

Merged this series along with util-linux, and package.bbclass

Thanks
	Sau!



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-03-13 16:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-12 21:24 [PATCH 0/5] Python related patches Andreas Oberritter
2012-03-12 21:24 ` [PATCH 1/5] python, python-native: always set platform to linux2 Andreas Oberritter
2012-03-12 21:24 ` [PATCH 2/5] python: regenerate plat-linux2/*.py Andreas Oberritter
2012-03-12 21:24 ` [PATCH 3/5] python: depend on bzip2 Andreas Oberritter
2012-03-12 21:24 ` [PATCH 4/5] python-native: distutils: don't use libdir, remove dead code path Andreas Oberritter
2012-03-12 21:24 ` [PATCH 5/5] python, python-native: bump PR Andreas Oberritter
2012-03-13 16:32 ` [PATCH 0/5] Python related patches Saul Wold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.