Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/3] #1937
@ 2012-03-25  0:42 Andrei Gherzan
  2012-03-25  0:43 ` [PATCH 1/3] gdbm: Activate -enable-libgdbm-compat and add symlinks to headers in include/gdbm Andrei Gherzan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrei Gherzan @ 2012-03-25  0:42 UTC (permalink / raw)
  To: openembedded-core

1. Integrate tk for python module _tkinter.
2. Fix gdbm for python module dbm.
3. Fix python while checking if 64bit machine - modules dl and imageop
are now built on a 64bit host machine.

The following changes since commit 5a6ded1355156557635004fdde2c01feec436be2:

  yocto-kernel: new script (2012-03-22 19:21:15 +0000)

are available in the git repository at:
  git://git.yoctoproject.org/poky-contrib ag/master
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ag/master

Andrei Gherzan (3):
  gdbm: Activate -enable-libgdbm-compat and add symlinks to headers in
    include/gdbm
  tk: Integrate tk v8.5.11
  python: Add tk and tcl to DEPENDS conditionally and add patch for
    64bit platform

 .../python/check-if-target-is-64b-not-host.patch   |   57 ++++++++++++++++
 meta/recipes-devtools/python/python_2.7.2.bb       |    7 ++-
 meta/recipes-devtools/tcltk/tk_8.5.11.bb           |   68 ++++++++++++++++++++
 meta/recipes-support/gdbm/gdbm_1.10.bb             |   13 ++++-
 4 files changed, 143 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
 create mode 100644 meta/recipes-devtools/tcltk/tk_8.5.11.bb

-- 
1.7.5.4




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

* [PATCH 1/3] gdbm: Activate -enable-libgdbm-compat and add symlinks to headers in include/gdbm
  2012-03-25  0:42 [PATCH 0/3] #1937 Andrei Gherzan
@ 2012-03-25  0:43 ` Andrei Gherzan
  2012-03-25  0:43 ` [PATCH 2/3] tk: Integrate tk v8.5.11 Andrei Gherzan
  2012-03-25  0:43 ` [PATCH 3/3] python: Add tk and tcl to DEPENDS conditionally and add patch for 64bit platform Andrei Gherzan
  2 siblings, 0 replies; 4+ messages in thread
From: Andrei Gherzan @ 2012-03-25  0:43 UTC (permalink / raw)
  To: openembedded-core

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]

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
---
 meta/recipes-support/gdbm/gdbm_1.10.bb |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-support/gdbm/gdbm_1.10.bb b/meta/recipes-support/gdbm/gdbm_1.10.bb
index 9b2fde4..26b8009 100644
--- a/meta/recipes-support/gdbm/gdbm_1.10.bb
+++ b/meta/recipes-support/gdbm/gdbm_1.10.bb
@@ -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
+}
-- 
1.7.5.4




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

* [PATCH 2/3] tk: Integrate tk v8.5.11
  2012-03-25  0:42 [PATCH 0/3] #1937 Andrei Gherzan
  2012-03-25  0:43 ` [PATCH 1/3] gdbm: Activate -enable-libgdbm-compat and add symlinks to headers in include/gdbm Andrei Gherzan
@ 2012-03-25  0:43 ` Andrei Gherzan
  2012-03-25  0:43 ` [PATCH 3/3] python: Add tk and tcl to DEPENDS conditionally and add patch for 64bit platform Andrei Gherzan
  2 siblings, 0 replies; 4+ messages in thread
From: Andrei Gherzan @ 2012-03-25  0:43 UTC (permalink / raw)
  To: openembedded-core

Tk (along with Tcl) is needed in python for module _tkinter.

[YOCTO #1937]

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
---
 meta/recipes-devtools/tcltk/tk_8.5.11.bb |   68 ++++++++++++++++++++++++++++++
 1 files changed, 68 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-devtools/tcltk/tk_8.5.11.bb

diff --git a/meta/recipes-devtools/tcltk/tk_8.5.11.bb b/meta/recipes-devtools/tcltk/tk_8.5.11.bb
new file mode 100644
index 0000000..0de83d0
--- /dev/null
+++ b/meta/recipes-devtools/tcltk/tk_8.5.11.bb
@@ -0,0 +1,68 @@
+DESCRIPTION = "Tk graphical toolkit for the Tcl scripting language."
+LICENSE = "BSD-3-Clause"
+SECTION = "devel/tcltk"
+HOMEPAGE = "http://tcl.sourceforge.net"
+DEPENDS = "tcl virtual/libx11"
+
+LIC_FILES_CHKSUM = "file://../license.terms;md5=33c2a4845e058f33c0f52f375625f650 \
+                    file://../compat/license.terms;md5=33c2a4845e058f33c0f52f375625f650 \
+                    file://../library/license.terms;md5=33c2a4845e058f33c0f52f375625f650 \
+                    file://../macosx/license.terms;md5=33c2a4845e058f33c0f52f375625f650 \
+                    file://../tests/license.terms;md5=33c2a4845e058f33c0f52f375625f650 \
+                    file://../win/license.terms;md5=33c2a4845e058f33c0f52f375625f650 \
+                    "
+
+PR = "r0"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/tcl/tk${PV}-src.tar.gz"
+SRC_URI[md5sum] = "b61b72f0aad230091b100746f078b8f1"
+SRC_URI[sha256sum] = "d35810b33a0931656f1d128e7e0776cc0c4d8b9c72af322cab5a7ee30485eb70"
+
+S = "${WORKDIR}/tk${PV}/unix"
+
+inherit autotools
+
+EXTRA_OECONF = "--enable-threads \
+                --disable-rpath \
+                --with-tcl=${STAGING_BINDIR_CROSS} \
+                "
+
+do_configure() {
+	gnu-configize
+	oe_runconf
+}
+
+do_install() {
+	autotools_do_install
+	oe_libinstall -so libtk8.5 ${STAGING_LIBDIR}
+	sed -i "s+${WORKDIR}+${STAGING_INCDIR}+g" tkConfig.sh
+	sed -i "s,-L${libdir},," tkConfig.sh
+	install -d ${STAGING_BINDIR_CROSS}/
+	install -m 0755 tkConfig.sh ${STAGING_BINDIR_CROSS}
+	cd ..
+	for dir in compat generic unix
+	do
+		install -d ${STAGING_INCDIR}/tk${PV}/$dir
+		install -m 0644 $dir/*.h ${STAGING_INCDIR}/tk${PV}/$dir/
+	done
+}
+
+PACKAGES =+ "${PN}-demos \
+	     ${PN}-lib \
+	     "
+FILES_${PN}-lib   = "${libdir}/libtk8.5.so* \
+                     "
+FILES_${PN}-demos = "${libdir}/tk8.5/demos/* \
+                     "
+FILES_${PN}      += "${libdir}/tk8.5/ttk/* \
+		     ${libdir}/tk8.5/images/* \
+		     ${libdir}/tk8.5/msgs/* \
+		     ${libdir}/tk8.5/*.tcl \
+		     ${libdir}/tk8.5/tclIndex \
+		     "
+FILES_${PN}-dev += "${libdir}/tkConfig.sh \
+		    ${libdir}/tk8.5/tkAppInit.c \
+		    "
+
+RDEPENDS_${PN} += "tk-lib"
+
-- 
1.7.5.4




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

* [PATCH 3/3] python: Add tk and tcl to DEPENDS conditionally and add patch for 64bit platform
  2012-03-25  0:42 [PATCH 0/3] #1937 Andrei Gherzan
  2012-03-25  0:43 ` [PATCH 1/3] gdbm: Activate -enable-libgdbm-compat and add symlinks to headers in include/gdbm Andrei Gherzan
  2012-03-25  0:43 ` [PATCH 2/3] tk: Integrate tk v8.5.11 Andrei Gherzan
@ 2012-03-25  0:43 ` Andrei Gherzan
  2 siblings, 0 replies; 4+ messages in thread
From: Andrei Gherzan @ 2012-03-25  0:43 UTC (permalink / raw)
  To: openembedded-core

tk depends on virtual/x11 which is needed to build _tkinter python module.
tk and tcl was added in DEPENDS conditionally. If we have x11 in DISTRO_FEATURES
tk and tcl will be in DEPENDS and _tkinter will be built.

check-if-target-is-64b-not-host.patch
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]

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
---
 .../python/check-if-target-is-64b-not-host.patch   |   57 ++++++++++++++++++++
 meta/recipes-devtools/python/python_2.7.2.bb       |    7 ++-
 2 files changed, 63 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch

diff --git a/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch b/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
new file mode 100644
index 0000000..2b62db3
--- /dev/null
+++ b/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
@@ -0,0 +1,57 @@
+Author: Andrei Gherzan <andrei@gherzan.ro>
+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 <andrei@gherzan.ro>
+
+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']):
diff --git a/meta/recipes-devtools/python/python_2.7.2.bb b/meta/recipes-devtools/python/python_2.7.2.bb
index cb0a1d5..4b27b4d 100644
--- a/meta/recipes-devtools/python/python_2.7.2.bb
+++ b/meta/recipes-devtools/python/python_2.7.2.bb
@@ -1,7 +1,11 @@
 require python.inc
 DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib"
 DEPENDS_sharprom = "python-native db readline zlib gdbm openssl"
-PR = "${INC_PR}.8"
+PR = "${INC_PR}.9"
+
+# For _tkinter module we need tcl and tk.
+# Tk needs X.h and Xlib.h so it depends on virtual/libx11.
+DEPENDS += "${@base_contains('DISTRO_FEATURES', 'x11', 'tk tcl', '', d)}"
 
 DISTRO_SRC_URI ?= "file://sitecustomize.py"
 DISTRO_SRC_URI_linuxstdbase = ""
@@ -22,6 +26,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}"
-- 
1.7.5.4




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

end of thread, other threads:[~2012-03-25  0:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-25  0:42 [PATCH 0/3] #1937 Andrei Gherzan
2012-03-25  0:43 ` [PATCH 1/3] gdbm: Activate -enable-libgdbm-compat and add symlinks to headers in include/gdbm Andrei Gherzan
2012-03-25  0:43 ` [PATCH 2/3] tk: Integrate tk v8.5.11 Andrei Gherzan
2012-03-25  0:43 ` [PATCH 3/3] python: Add tk and tcl to DEPENDS conditionally and add patch for 64bit platform Andrei Gherzan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox