Skip to contentSkip to conversation

python2: Add PACKAGECONFIG for tkinter to support tk from meta-oe

PATCH In review Jate Sujjavanich 3 participants 6 messages Jul 14, 2014 – Jul 21, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python2: Add PACKAGECONFIG for tkinter to support tk from meta-oe

Previously, the python recipe did not have a way to add a DEPENDS on tk.

This makes the option available for users of the meta-oe/meta-oe layer.

---
 meta/recipes-devtools/python/python_2.7.3.bb |    2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/python/python_2.7.3.bb +2 -0
index 0d64172..cc54296 100644
@@ -42,6 +42,8 @@ S = "${WORKDIR}/Python-${PV}"
 
 inherit autotools multilib_header python-dir pythonnative
 
+PACKAGECONFIG[tkinter] = ",,tk,tk tk-lib"
+
 # The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources
 #Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
 TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
Signature · 1 line
1.7.9.5
#1 lore raw

Jate Sujjavanich <[email protected]>

Quoted 1 line · writes:

+PACKAGECONFIG[tkinter] = ",,tk,tk tk-lib"

What do you want to reach with this? Afais, build is not more deterministic than before and requiring both 'tk' and 'tk-lib' when 'tkinter' is *not* enabled does not look sane to me either.

You probably want something like

| PACKAGECONFIG[tkinter]="--with-tkinter, --without-tkinter, tk tk-lib"

although I do not know/checked whether '--with*-tkinter' is supported by python's configure script.

Enrico

author
#2 lore raw

Python 2.7.x does not use an explicit configure option for tk support. Instead, it tries to detect the tk and tcl libraries before compiling python-tkinter.

In PACKAGECONFIG[*], items three and four are the DEPENDS and RDEPENDS, respectively. They are only added to the python DEPENDS/RDEPENDS when the user adds tkinter to the PACKAGECONFIG value.

This thread contains more discussion:

https://lists.yoctoproject.org/pipermail/yocto/2014-July/thread.html#20415

- Jate S.

Quoted 25 lines · Enrico Scholz

Jate Sujjavanich <[email protected]>

Quoted 1 line · writes:

+PACKAGECONFIG[tkinter] = ",,tk,tk tk-lib"

What do you want to reach with this? Afais, build is not more deterministic
than before and requiring both 'tk' and 'tk-lib' when 'tkinter' is *not* enabled does not look sane to me either.

You probably want something like

| PACKAGECONFIG[tkinter]="--with-tkinter, --without-tkinter, tk tk-lib"

although I do not know/checked whether '--with*-tkinter' is supported by python's configure script.

Enrico
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 3 lines · Jate S

Python 2.7.x does not use an explicit configure option for tk support. Instead, it tries to detect the tk and tcl libraries before compiling python-tkinter.

Your patch does not solve the issue of non-deterministic builds. When tk was added by some other way, python will get tkinter support although PACKAGECONFIG was not set.

An idea to make build deterministic might be patching of detect_modules() in setup.py to add disabled modules to 'missing'. E.g.

|             missing.append('_tkinter')
| 
|+        missing.extend(os.environ('OE_HACK_MISSING').split())
|         return missing

Probably there are better/cleaner ways but I am not familar with python distutils.

Enrico

author
#4 lore raw

The presence of the tk library determines whether python's compile task will build tkinter. Then the presence of python-tkinter in IMAGE_INSTALL will then determine whether it is installed.

In the absence of tk provided by meta-oe, the python recipe will install an empty python-tkinter package.

I cannot think of a cleaner way to do this right now. Ideally the package python-tkinter could trigger a python DEPENDS on tk...

Martin, you originally suggested the PACKAGECONFIG. Do you have any further thoughts on this?

- Jate S.

Quoted 23 lines · Enrico Scholz
Quoted 3 lines · Jate S

Python 2.7.x does not use an explicit configure option for tk support. Instead, it tries to detect the tk and tcl libraries before compiling python-tkinter.

Your patch does not solve the issue of non-deterministic builds. When tk was added by some other way, python will get tkinter support although PACKAGECONFIG was not set.

An idea to make build deterministic might be patching of detect_modules() in setup.py to add disabled modules to 'missing'. E.g.

|             missing.append('_tkinter')
|
|+        missing.extend(os.environ('OE_HACK_MISSING').split())
|         return missing

Probably there are better/cleaner ways but I am not familar with python distutils.

Enrico

#5 lore raw
Quoted 7 lines · Jate S

The presence of the tk library determines whether python's compile task will build tkinter. Then the presence of python-tkinter in IMAGE_INSTALL will then determine whether it is installed.

In the absence of tk provided by meta-oe, the python recipe will install an empty python-tkinter package.

Quoted 6 lines

I cannot think of a cleaner way to do this right now. Ideally the package python-tkinter could trigger a python DEPENDS on tk...

Martin, you originally suggested the PACKAGECONFIG. Do you have any further thoughts on this?

Richard just submitted patch to explicitly disable tk, extend the patch to make it configurable and use this new option from PACKAGECONFIG

http://git.openembedded.org/openembedded-core/commit/?id=53ae544cfdac22c82af452b8c7ebe6664296bd9b

Quoted 29 lines

- Jate S.

Quoted 23 lines · Enrico Scholz
Quoted 3 lines · Jate S

Python 2.7.x does not use an explicit configure option for tk support. Instead, it tries to detect the tk and tcl libraries before compiling python-tkinter.

Your patch does not solve the issue of non-deterministic builds. When tk was added by some other way, python will get tkinter support although PACKAGECONFIG was not set.

An idea to make build deterministic might be patching of detect_modules() in setup.py to add disabled modules to 'missing'. E.g.

|             missing.append('_tkinter')
|
|+        missing.extend(os.environ('OE_HACK_MISSING').split())
|         return missing

Probably there are better/cleaner ways but I am not familar with python distutils.

Enrico

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]