Add patches to compile some modules and to skip warnings about some other
cover Add patches to compile some modules and to skip warnings about some other
The following changes since commit 5607729d9901c394b7cd4db6e38fe7fb19116f39:
self-hosted-image: Increase space for build and allow builder user sudo access (2012-04-04 17:17:55 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib ag/pythonbug2
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ag/pythonbug2
Andrei Gherzan (6):
gdbm: Activate -enable-libgdbm-compat and add symlinks to headers in
include/gdbm
python: Add patch for 64bit platform
python: Add patch to search for db.h in inc_dirs and remove warning
python: Add patch to avoid warning about bsddb module
python: Add patch to avoid warning about _tkinter
python: Add patch to avoid warning about sunaudiodev module
.../python/python/avoid_warning_about_bsddb.patch | 23 ++++++++ .../python/avoid_warning_about_tkinter.patch | 25 +++++++++ .../avoid_warning_for_sunos_specific_module.patch | 23 ++++++++ .../python/check-if-target-is-64b-not-host.patch | 57 ++++++++++++++++++++ ...search_db_h_in_inc_dirs_and_avoid_warning.patch | 40 ++++++++++++++ meta/recipes-devtools/python/python_2.7.2.bb | 7 ++- meta/recipes-support/gdbm/gdbm_1.10.bb | 13 ++++- 7 files changed, 186 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-devtools/python/python/avoid_warning_about_bsddb.patch create mode 100644 meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch create mode 100644 meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch create mode 100644 meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch create mode 100644 meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
Signature · 1 line
1.7.5.4
PATCH 1/6 gdbm: Activate -enable-libgdbm-compat and add symlinks to headers in include/gdbm
ndbm.h is needed by python for dbm module. This is why -enable-libgdbm-compat was added to configure.
The second change is because python is looking for the gdbm headers in include/gdbm. The easiest way to solve this issue is to add symlinks in include/gdbm.
[YOCTO #1937]
--- meta/recipes-support/gdbm/gdbm_1.10.bb | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)
meta/recipes-support/gdbm/gdbm_1.10.bb +12 -1
@@ -4,7 +4,7 @@ SECTION = "libs" LICENSE = "GPLv3" LIC_FILES_CHKSUM = "file://COPYING;md5=241da1b9fe42e642cbb2c24d5e0c4d24" -PR = "r1" +PR = "r2" SRC_URI = "${GNU_MIRROR}/gdbm/gdbm-${PV}.tar.gz"
@@ -13,4 +13,15 @@ SRC_URI[sha256sum] = "23f8134c5b94bbfb06d756a6b78f074fba6e6028cf2fe01341d40b26db inherit autotools gettext lib_package +# Needed for dbm python module +EXTRA_OECONF = "-enable-libgdbm-compat" + BBCLASSEXTEND = "native nativesdk" + +do_install_append () { + # Create a symlink to ndbm.h and gdbm.h in include/gdbm to let other packages to find + # these headers + install -d ${D}${includedir}/gdbm + ln -sf ../ndbm.h ${D}/${includedir}/gdbm/ndbm.h + ln -sf ../gdbm.h ${D}/${includedir}/gdbm/gdbm.h +}
Signature · 1 line
1.7.5.4
PATCH 2/6 python: Add patch for 64bit platform
This patch was added for 64bit host machines. In the compile process python is checking if platform is a 64bit platform using sys.maxint which is the host's value. The patch fixes this issue so that python would check if TARGET machine is 64bit not the HOST machine. In this way will have "dl" and "imageop" modules built if HOST machine is 64bit but the target machine is 32bit.
[YOCTO #1937]
--- .../python/check-if-target-is-64b-not-host.patch | 57 ++++++++++++++++++++ meta/recipes-devtools/python/python_2.7.2.bb | 3 +- 2 files changed, 59 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch new file +57 -0
@@ -0,0 +1,57 @@ +Author: Andrei Gherzan <[email protected]> +Date: Sun Mar 25 02:02:27 2012 +0200 + +This patch was added for 64bit host machines. In the compile process python +is checking if platform is a 64bit platform using sys.maxint which is the host's +value. The patch fixes this issue so that python would check if TARGET machine +is 64bit not the HOST machine. In this way will have "dl" and "imageop" modules +built if HOST machine is 64bit but the target machine is 32bit. + +Signed-off-by: Andrei Gherzan <[email protected]> + +Upstream-Status: Pending + +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py 2012-03-25 01:10:41.540163187 +0200 ++++ Python-2.7.2/setup.py 2012-03-25 01:26:06.092539990 +0200 +@@ -23,6 +23,21 @@ + # This global variable is used to hold the list of modules to be disabled. + disabled_module_list = [] + ++def target_is_64bit_platform (): ++ """ ++ In case of cross-compile, some modules are not build as setup checks if HOST ++ is 64bit and not TARGET. ++ As python was built for TARGET we can check this in pyconfig.h in this way: ++ Sizeof LONG on a 32 bit platform is 4 bytes ++ Sizeof LONG on a 64 bit platform is 8 bytes ++ """ ++ pyconf = open("pyconfig.h").read() ++ aux = re.search(r"#s*define\s+SIZEOF_LONG\s+8\s*", pyconf) ++ if aux is not None: ++ return True ++ else: ++ return False ++ + def add_dir_to_list(dirlist, dir): + """Add the directory 'dir' to the list 'dirlist' (at the front) if + 1) 'dir' is not already in 'dirlist' +@@ -628,7 +643,7 @@ + exts.append( Extension('audioop', ['audioop.c']) ) + + # Disabled on 64-bit platforms +- if sys.maxint != 9223372036854775807L: ++ if not target_is_64bit_platform(): + # Operations on images + exts.append( Extension('imageop', ['imageop.c']) ) + else: +@@ -1418,7 +1433,7 @@ + missing.append('_codecs_%s' % loc) + + # Dynamic loading module +- if sys.maxint == 0x7fffffff: ++ if not target_is_64bit_platform(): + # This requires sizeof(int) == sizeof(long) == sizeof(char*) + dl_inc = find_file('dlfcn.h', [], inc_dirs) + if (dl_inc is not None) and (platform not in ['atheos']):
meta/recipes-devtools/python/python_2.7.2.bb +2 -1
@@ -1,6 +1,6 @@ require python.inc DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib" -PR = "${INC_PR}.9" +PR = "${INC_PR}.10" DISTRO_SRC_URI ?= "file://sitecustomize.py" DISTRO_SRC_URI_linuxstdbase = ""
@@ -21,6 +21,7 @@ SRC_URI += "\ file://host_include_contamination.patch \ file://sys_platform_is_now_always_linux2.patch \ file://fix_for_using_different_libdir.patch \ + file://check-if-target-is-64b-not-host.patch \ " S = "${WORKDIR}/Python-${PV}"
Signature · 1 line
1.7.5.4
PATCH 3/6 python: Add patch to search for db.h in inc_dirs and remove warning
In reply to Andrei Gherzanpython should search for db.h in inc_dirs and not in a hardcoded path. If db.h is found but HASHVERSION is not 2 we avoid a warning by not. adding this module to missing variable.
[YOCTO #1937]
--- ...search_db_h_in_inc_dirs_and_avoid_warning.patch | 40 ++++++++++++++++++++ meta/recipes-devtools/python/python_2.7.2.bb | 3 +- 2 files changed, 42 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch new file +40 -0
@@ -0,0 +1,40 @@ +python should search for db.h in inc_dirs and not in a hardcoded path. +If db.h is found but HASHVERSION is not 2 we avoid a warning by not +adding this module to missing variable. + +Upstream-Status: Inappropriate [distribution] + +Signed-off-by: Andrei Gherzan <[email protected]> + +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py 2012-04-05 22:27:22.437199989 +0300 ++++ Python-2.7.2/setup.py 2012-04-05 22:26:38.000000000 +0300 +@@ -1141,12 +1141,12 @@ + # the more recent berkeleydb's db.h file first in the include path + # when attempting to compile and it will fail. + f = "/usr/include/db.h" +- ++ if len(inc_dirs) != 0: ++ f = os.path.join(inc_dirs[0], "db.h") + if sys.platform == 'darwin': + if is_macosx_sdk_path(f): + sysroot = macosx_sdk_root() + f = os.path.join(sysroot, f[1:]) +- + if os.path.exists(f) and not db_incs: + data = open(f).read() + m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) +@@ -1161,8 +1161,10 @@ + libraries=libraries)) + else: + exts.append(Extension('bsddb185', ['bsddbmodule.c'])) +- else: +- missing.append('bsddb185') ++ # If a newer version is detected don't report an useless ++ # warning ++ #else: ++ # missing.append('bsddb185') + else: + missing.append('bsddb185') +
meta/recipes-devtools/python/python_2.7.2.bb +2 -1
@@ -1,6 +1,6 @@ require python.inc DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib" -PR = "${INC_PR}.10" +PR = "${INC_PR}.11" DISTRO_SRC_URI ?= "file://sitecustomize.py" DISTRO_SRC_URI_linuxstdbase = ""
@@ -22,6 +22,7 @@ SRC_URI += "\ file://sys_platform_is_now_always_linux2.patch \ file://fix_for_using_different_libdir.patch \ file://check-if-target-is-64b-not-host.patch \ + file://search_db_h_in_inc_dirs_and_avoid_warning.patch \ " S = "${WORKDIR}/Python-${PV}"
Signature · 1 line
1.7.5.4
PATCH 4/6 python: Add patch to avoid warning about bsddb module
In reply to Andrei Gherzan_bsddb module can be built only with db version between 4.1 and 4.7. Avoid a warning by not adding this module to missing variable.
[YOCTO #1937]
--- .../python/python/avoid_warning_about_bsddb.patch | 23 ++++++++++++++++++++ meta/recipes-devtools/python/python_2.7.2.bb | 3 +- 2 files changed, 25 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-devtools/python/python/avoid_warning_about_bsddb.patch
meta/recipes-devtools/python/python/avoid_warning_about_bsddb.patch new file +23 -0
@@ -0,0 +1,23 @@ +_bsddb module can be built only with db version between 4.1 and 4.7. +Avoid a warning by not adding this module to missing variable. + +Upstream-Status: Inappropriate [distribution] + +Signed-off-by: Andrei Gherzan <[email protected]> + + +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py 2012-04-05 23:16:49.268139840 +0300 ++++ Python-2.7.2/setup.py 2012-04-05 23:17:30.912138622 +0300 +@@ -1024,7 +1024,9 @@ + db_incs = None + dblibs = [] + dblib_dir = None +- missing.append('_bsddb') ++ # We need db version between 4.1 and 4.7 ++ # Avoid this warning ++ #missing.append('_bsddb') + + # The sqlite interface + sqlite_setup_debug = False # verbose debug prints from this script?
meta/recipes-devtools/python/python_2.7.2.bb +2 -1
@@ -1,6 +1,6 @@ require python.inc DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib" -PR = "${INC_PR}.11" +PR = "${INC_PR}.12" DISTRO_SRC_URI ?= "file://sitecustomize.py" DISTRO_SRC_URI_linuxstdbase = ""
@@ -23,6 +23,7 @@ SRC_URI += "\ file://fix_for_using_different_libdir.patch \ file://check-if-target-is-64b-not-host.patch \ file://search_db_h_in_inc_dirs_and_avoid_warning.patch \ + file://avoid_warning_about_bsddb.patch \ " S = "${WORKDIR}/Python-${PV}"
Signature · 1 line
1.7.5.4
PATCH 5/6 python: Add patch to avoid warning about _tkinter
In reply to Andrei Gherzan_tkinter module needs tk module along with tcl. tk is not yet integrated in yocto so we skip the check for this module.
Avoid a warning by not adding this module to missing variable.
[YOCTO #1937]
--- .../python/avoid_warning_about_tkinter.patch | 25 ++++++++++++++++++++ meta/recipes-devtools/python/python_2.7.2.bb | 3 +- 2 files changed, 27 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch new file +25 -0
@@ -0,0 +1,25 @@ +_tkinter module needs tk module along with tcl. tk is not yet integrated +in yocto so we skip the check for this module. +Avoid a warning by not adding this module to missing variable. + +Upstream-Status: Inappropriate [distribution] + +Signed-off-by: Andrei Gherzan <[email protected]> + +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py 2012-04-05 23:18:38.500136647 +0300 ++++ Python-2.7.2/setup.py 2012-04-05 23:19:35.888134969 +0300 +@@ -1634,8 +1634,10 @@ + # Call the method for detecting whether _tkinter can be compiled + self.detect_tkinter(inc_dirs, lib_dirs) + +- if '_tkinter' not in [e.name for e in self.extensions]: +- missing.append('_tkinter') ++ # tkinter module will not be avalaible as yocto ++ # doesn't have tk integrated (yet) ++ #if '_tkinter' not in [e.name for e in self.extensions]: ++ # missing.append('_tkinter') + + return missing +
meta/recipes-devtools/python/python_2.7.2.bb +2 -1
@@ -1,6 +1,6 @@ require python.inc DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib" -PR = "${INC_PR}.12" +PR = "${INC_PR}.13" DISTRO_SRC_URI ?= "file://sitecustomize.py" DISTRO_SRC_URI_linuxstdbase = ""
@@ -24,6 +24,7 @@ SRC_URI += "\ file://check-if-target-is-64b-not-host.patch \ file://search_db_h_in_inc_dirs_and_avoid_warning.patch \ file://avoid_warning_about_bsddb.patch \ + file://avoid_warning_about_tkinter.patch \ " S = "${WORKDIR}/Python-${PV}"
Signature · 1 line
1.7.5.4
PATCH 6/6 python: Add patch to avoid warning about sunaudiodev module
In reply to Andrei Gherzansunaudiodev module is sunos specific so we avoid a warning by not. adding this module to missing variable.
[YOCTO #1937]
--- .../avoid_warning_for_sunos_specific_module.patch | 23 ++++++++++++++++++++ meta/recipes-devtools/python/python_2.7.2.bb | 3 +- 2 files changed, 25 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch
meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch new file +23 -0
@@ -0,0 +1,23 @@ +sunaudiodev module is sunos specific so we avoid a warning by not +adding this module to missing variable. + +Upstream-Status: Inappropriate [distribution] + +Signed-off-by: Andrei Gherzan <[email protected]> + +Index: Python-2.7.2/setup.py +=================================================================== +--- Python-2.7.2.orig/setup.py 2012-04-05 22:29:18.049196608 +0300 ++++ Python-2.7.2/setup.py 2012-04-05 22:29:57.505195453 +0300 +@@ -1522,8 +1522,9 @@ + if platform == 'sunos5': + # SunOS specific modules + exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) ) +- else: +- missing.append('sunaudiodev') ++ # If platform is not sunos warning is useless ++ #else: ++ # missing.append('sunaudiodev') + + if platform == 'darwin': + # _scproxy
meta/recipes-devtools/python/python_2.7.2.bb +2 -1
@@ -1,6 +1,6 @@ require python.inc DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib" -PR = "${INC_PR}.13" +PR = "${INC_PR}.14" DISTRO_SRC_URI ?= "file://sitecustomize.py" DISTRO_SRC_URI_linuxstdbase = ""
@@ -25,6 +25,7 @@ SRC_URI += "\ file://search_db_h_in_inc_dirs_and_avoid_warning.patch \ file://avoid_warning_about_bsddb.patch \ file://avoid_warning_about_tkinter.patch \ + file://avoid_warning_for_sunos_specific_module.patch \ " S = "${WORKDIR}/Python-${PV}"
Signature · 1 line
1.7.5.4
Saul Wold
AppliedQuoted 11 lines · Andrei Gherzan
The following changes since commit
5607729d9901c394b7cd4db6e38fe7fb19116f39:self-hosted-image: Increase space for build and allow builder user sudo access (2012-04-04 17:17:55 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contribag/pythonbug2
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ag/pythonbug2Andrei Gherzan (6):
gdbm: Activate -enable-libgdbm-compat and add symlinks to headers in
include/gdbm
Merged into OE-Core
Quoted 6 lines
python: Add patch for 64bit platform
python: Add patch to search fordb.hininc_dirsand remove warning
python: Add patch to avoid warning about bsddb module
python: Add patch to avoid warning about_tkinter
python: Add patch to avoid warning about sunaudiodev module
We are going hold these, I will be integrating them into a master-next for holding.
Thanks
Sau!
Quoted 14 lines
.../python/python/avoid_warning_about_bsddb.patch | 23 ++++++++ .../python/avoid_warning_about_tkinter.patch | 25 +++++++++ .../avoid_warning_for_sunos_specific_module.patch | 23 ++++++++ .../python/check-if-target-is-64b-not-host.patch | 57 ++++++++++++++++++++ ...search_db_h_in_inc_dirs_and_avoid_warning.patch | 40 ++++++++++++++ meta/recipes-devtools/python/python_2.7.2.bb | 7 ++- meta/recipes-support/gdbm/gdbm_1.10.bb | 13 ++++- 7 files changed, 186 insertions(+), 2 deletions(-)create mode 100644
meta/recipes-devtools/python/python/avoid_warning_about_bsddb.patchcreate mode 100644meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patchcreate mode 100644meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patchcreate mode 100644meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patchcreate mode 100644meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
Quoted 7 lines · Saul Wold
Quoted 6 lines · Andrei Gherzan
The following changes since commit
5607729d9901c394b7cd4db6e38fe7fb19116f39:self-hosted-image: Increase space for build and allow builder user
sudo access (2012-04-04 17:17:55 +0100)
Quoted 10 lines
Quoted 7 lines
are available in the git repository at:
git://git.yoctoproject.org/poky-contribag/pythonbug2
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ag/pythonbug2Andrei Gherzan (6):
gdbm: Activate -enable-libgdbm-compat and add symlinks to headers in
include/gdbmMerged into OE-Core
Quoted 1 line
python: Add patch for 64bit platform
I think this patch is quite important, because building python on 32-bit vs. 64-bit build systems currently yields different results.
Quoted 11 lines
Quoted 5 lines
python: Add patch to search for
db.hininc_dirsand remove warning
python: Add patch to avoid warning about bsddb module
python: Add patch to avoid warning about_tkinter
python: Add patch to avoid warning about sunaudiodev moduleWe are going hold these, I will be integrating them into a master-next for holding.
Thanks
Sau!
Quoted 25 lines · Andrei Gherzan
The following changes since commit
5607729d9901c394b7cd4db6e38fe7fb19116f39:self-hosted-image: Increase space for build and allow builder user sudo access (2012-04-04 17:17:55 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contribag/pythonbug2
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ag/pythonbug2Andrei Gherzan (6):
gdbm: Activate -enable-libgdbm-compat and add symlinks to headers in
include/gdbm
python: Add patch for 64bit platform
python: Add patch to search fordb.hininc_dirsand remove warning
python: Add patch to avoid warning about bsddb module
python: Add patch to avoid warning about_tkinter
python: Add patch to avoid warning about sunaudiodev module.../python/python/avoid_warning_about_bsddb.patch | 23 ++++++++ .../python/avoid_warning_about_tkinter.patch | 25 +++++++++ .../avoid_warning_for_sunos_specific_module.patch | 23 ++++++++ .../python/check-if-target-is-64b-not-host.patch | 57 ++++++++++++++++++++ ...search_db_h_in_inc_dirs_and_avoid_warning.patch | 40 ++++++++++++++ meta/recipes-devtools/python/python_2.7.2.bb | 7 ++- meta/recipes-support/gdbm/gdbm_1.10.bb | 13 ++++- 7 files changed, 186 insertions(+), 2 deletions(-)
Quoted 6 lines
create mode 100644
meta/recipes-devtools/python/python/avoid_warning_about_bsddb.patchcreate mode 100644meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patchcreate mode 100644meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patchcreate mode 100644meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patchcreate mode 100644meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
All of these have been merged into OE-Core, the gdbm one was added added earlier for 1.2.
Thanks for your contributions
Sau!