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

login
register
mail settings
Submitter Jate S
Date July 14, 2014, 2:46 p.m.
Message ID <1405349203-32702-1-git-send-email-jatedev@gmail.com>
Download mbox | patch
Permalink /patch/75469/
State New
Headers show

Comments

Jate S - July 14, 2014, 2:46 p.m.
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.

Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
---
 meta/recipes-devtools/python/python_2.7.3.bb |    2 ++
 1 file changed, 2 insertions(+)
Enrico Scholz - July 14, 2014, 3:31 p.m.
Jate Sujjavanich <jatedev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
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
Jate S - July 14, 2014, 5:58 p.m.
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.



On Mon, Jul 14, 2014 at 11:31 AM, Enrico Scholz <
enrico.scholz@sigma-chemnitz.de> wrote:

> Jate Sujjavanich <jatedev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 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
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
Enrico Scholz - July 14, 2014, 6:32 p.m.
Jate S <jatedev@gmail.com> writes:

> 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
Jate S - July 21, 2014, 1:01 a.m.
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.


On Mon, Jul 14, 2014 at 2:32 PM, Enrico Scholz
<enrico.scholz@sigma-chemnitz.de> wrote:
> Jate S <jatedev@gmail.com> writes:
>
>> 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
Martin Jansa - July 21, 2014, 3:08 a.m.
On Sun, Jul 20, 2014 at 09:01:05PM -0400, Jate S wrote:
> 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?

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

> 
> - Jate S.
> 
> 
> On Mon, Jul 14, 2014 at 2:32 PM, Enrico Scholz
> <enrico.scholz@sigma-chemnitz.de> wrote:
> > Jate S <jatedev@gmail.com> writes:
> >
> >> 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

Patch

diff --git a/meta/recipes-devtools/python/python_2.7.3.bb b/meta/recipes-devtools/python/python_2.7.3.bb
index 0d64172..cc54296 100644
--- a/meta/recipes-devtools/python/python_2.7.3.bb
+++ b/meta/recipes-devtools/python/python_2.7.3.bb
@@ -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__"