From e010b4985cea93daddec398db101a0b48c7a564d Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Tue, 5 Jan 2016 11:12:16 +0100 Subject: python: add a PACKAGECONFIG for _tkinter Currently _tkinter is only built when tcl/tk is available before the python do_configure task is built. Make this deterministic by providing a PACKAGECONFIG for it. If tkinter is in PACKAGECONFIG add the needed dependencies, if not force that tkinter is not built. Note that currently enabling tkinter does not work due to a cyclic dependency: 'python' depends on 'tk/tcl' depends on 'cracklib' depends on 'python' Signed-off-by: Max Krummenacher --- .../python/python/dont_build_tkinter.patch | 24 ++++++++++++++++++++++ recipes-devtools/python/python_2.7.9.bbappend | 19 +++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 recipes-devtools/python/python/dont_build_tkinter.patch create mode 100644 recipes-devtools/python/python_2.7.9.bbappend (limited to 'recipes-devtools') diff --git a/recipes-devtools/python/python/dont_build_tkinter.patch b/recipes-devtools/python/python/dont_build_tkinter.patch new file mode 100644 index 0000000..bdd47a8 --- /dev/null +++ b/recipes-devtools/python/python/dont_build_tkinter.patch @@ -0,0 +1,24 @@ +_tkinter module needs tk module along with tcl. +Force python to not be built with _tkinter. + +Upstream-Status: Inappropriate [distribution] + +Signed-off-by: Andrei Gherzan + +--- Python-2.7.9/setup.py.orig 2015-12-20 16:56:24.580951972 +0100 ++++ Python-2.7.9/setup.py 2015-12-20 17:00:34.524083526 +0100 +@@ -1762,10 +1762,11 @@ + self.extensions.extend(exts) + + # Call the method for detecting whether _tkinter can be compiled +- self.detect_tkinter(inc_dirs, lib_dirs) ++ # disable detection of tcl/tk and thus don't build python with _tkinter ++ #self.detect_tkinter(inc_dirs, lib_dirs) + +- if '_tkinter' not in [e.name for e in self.extensions]: +- missing.append('_tkinter') ++ #if '_tkinter' not in [e.name for e in self.extensions]: ++ # missing.append('_tkinter') + + ## # Uncomment these lines if you want to play with xxmodule.c + ## ext = Extension('xx', ['xxmodule.c']) diff --git a/recipes-devtools/python/python_2.7.9.bbappend b/recipes-devtools/python/python_2.7.9.bbappend new file mode 100644 index 0000000..ff0071f --- /dev/null +++ b/recipes-devtools/python/python_2.7.9.bbappend @@ -0,0 +1,19 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/python:" + +SRC_URI_remove = "file://avoid_warning_about_tkinter.patch" + +PACKAGECONFIG ?= "" + +PACKAGECONFIG[tkinter] = ",,tk" +PACKAGECONFIG_remove_class-native = "tkinter" +PACKAGECONFIG_remove_class-nativesdk = "tkinter" +RDEPENDS_${PN}-tkinter_append += "${@base_contains('PACKAGECONFIG', 'tkinter', 'tcl tk', '', d)}" +SRC_URI += " \ + ${@base_contains('PACKAGECONFIG', 'tkinter', '', 'file://dont_build_tkinter.patch', d)} \ +" +python __anonymous() { + if not 'openembedded-layer' in d.getVar('BBFILE_COLLECTIONS'): + if 'tkinter' in d.getVar('PACKAGECONFIG'): + bb.error('Python PACKAGECONFIG tkinter requires tk provided by' \ + 'meta-oe layer but the layer is not available.') +} -- cgit v1.2.3