diff mbox

[PATCHv2] package/kodi: needs .py modules

Message ID 1442178783-27567-1-git-send-email-yann.morin.1998@free.fr
State Rejected
Headers show

Commit Message

Yann E. MORIN Sept. 13, 2015, 9:13 p.m. UTC
Kodi segfaults as soon as it tries to load a python module:

    Could not find platform independent libraries <prefix>
    Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
    ImportError: No module named site
    Segmentation fault

Turns out that keeping .py modules (with or without .pyc) fixes the
issue.

Currently, Kodi selects python, but since the format of modules is a
choice, we can not select it.

Fix that by inverting the dependency on python from Kodi:
  - turn it into a depends rather than a select,
  - add the dependency to ! pyc-only
  - update the comment accordingly.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

---
changes v1 -> v2:
  - fix spurious 'i' (vim insert)
---
 package/kodi/Config.in | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Thomas Petazzoni Sept. 13, 2015, 9:29 p.m. UTC | #1
Yann,

On Sun, 13 Sep 2015 23:13:03 +0200, Yann E. MORIN wrote:
> Kodi segfaults as soon as it tries to load a python module:
> 
>     Could not find platform independent libraries <prefix>
>     Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>     ImportError: No module named site
>     Segmentation fault
> 
> Turns out that keeping .py modules (with or without .pyc) fixes the
> issue.
> 
> Currently, Kodi selects python, but since the format of modules is a
> choice, we can not select it.
> 
> Fix that by inverting the dependency on python from Kodi:
>   - turn it into a depends rather than a select,
>   - add the dependency to ! pyc-only
>   - update the comment accordingly.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Do we actually understand why it doesn't work? There is really no
reason for .py files to be necessary. Does it happen with Python 2 or
Python 3? Apparently, Kodi selects Python 2, so there really shouldn't
be any problem with having just .pyc files (Python 3 can be more
tricky in that respect.

> changes v1 -> v2:
>   - fix spurious 'i' (vim insert)

But it wasn't enough it seems :)

> -comment "kodi needs a toolchain w/ C++, threads, wchar, dynamic library"
> +comment "kodi needs python and .py modiules, and a toolchain w/ C++, threads, wchar, dynamic library"

                                      ^^^^^^^^
Thomas
Yann E. MORIN Sept. 13, 2015, 9:35 p.m. UTC | #2
Thomas, All,

On 2015-09-13 23:29 +0200, Thomas Petazzoni spake thusly:
> On Sun, 13 Sep 2015 23:13:03 +0200, Yann E. MORIN wrote:
> > Kodi segfaults as soon as it tries to load a python module:
> > 
> >     Could not find platform independent libraries <prefix>
> >     Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
> >     ImportError: No module named site
> >     Segmentation fault
> > 
> > Turns out that keeping .py modules (with or without .pyc) fixes the
> > issue.
> > 
> > Currently, Kodi selects python, but since the format of modules is a
> > choice, we can not select it.
> > 
> > Fix that by inverting the dependency on python from Kodi:
> >   - turn it into a depends rather than a select,
> >   - add the dependency to ! pyc-only
> >   - update the comment accordingly.
> > 
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> 
> Do we actually understand why it doesn't work? There is really no
> reason for .py files to be necessary.

Well, what do I know about python? ;-)

I never said I understood the issue. Just that having only .pyc modules
make Kodi segfault, while having .py makes it work... :-(

All I got was the trace above. There was nothing (of interest) in Kodi's
own log file.

> Does it happen with Python 2 or
> Python 3?

Kodi uses python 2, that's what I have in my config.

> Apparently, Kodi selects Python 2, so there really shouldn't
> be any problem with having just .pyc files (Python 3 can be more
> tricky in that respect.
> 
> > changes v1 -> v2:
> >   - fix spurious 'i' (vim insert)
> 
> But it wasn't enough it seems :)
> 
> > -comment "kodi needs a toolchain w/ C++, threads, wchar, dynamic library"
> > +comment "kodi needs python and .py modiules, and a toolchain w/ C++, threads, wchar, dynamic library"
> 
>                                       ^^^^^^^^

Meh.

Regards,
Yann E. MORIN.
Arnout Vandecappelle Sept. 15, 2015, 4:37 p.m. UTC | #3
On 13-09-15 23:13, Yann E. MORIN wrote:
> Kodi segfaults as soon as it tries to load a python module:
> 
>     Could not find platform independent libraries <prefix>
>     Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>     ImportError: No module named site
>     Segmentation fault
> 
> Turns out that keeping .py modules (with or without .pyc) fixes the
> issue.
> 
> Currently, Kodi selects python, but since the format of modules is a
> choice, we can not select it.

 I think it's a lot more user-friendly to do

	select BR2_PACKAGE_PYTHON_PY_PYC

 That removes the possibility for the user to select the PY_ONLY option, but I
don't think that that's so terribly important. And it does make life a whole lot
simpler for someone who wants to select Kodi. They already have to go and enable
an EGL provider, so let's not make their life harder by requiring manual
selection of python with the correct, non-default _PY_PYC option...

 Regards,
 Arnout


> 
> Fix that by inverting the dependency on python from Kodi:
>   - turn it into a depends rather than a select,
>   - add the dependency to ! pyc-only
>   - update the comment accordingly.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> 
> ---
> changes v1 -> v2:
>   - fix spurious 'i' (vim insert)
> ---
>  package/kodi/Config.in | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/package/kodi/Config.in b/package/kodi/Config.in
> index 797f59d..6d6c47b 100644
> --- a/package/kodi/Config.in
> +++ b/package/kodi/Config.in
> @@ -2,10 +2,11 @@ config BR2_PACKAGE_KODI_ARCH_SUPPORTS
>  	bool
>  	default y if (BR2_arm || (BR2_mipsel && BR2_TOOLCHAIN_USES_GLIBC) || BR2_i386 || BR2_x86_64) && BR2_PACKAGE_BOOST_ARCH_SUPPORTS
>  
> -comment "kodi needs a toolchain w/ C++, threads, wchar, dynamic library"
> +comment "kodi needs python and .py modiules, and a toolchain w/ C++, threads, wchar, dynamic library"
>  	depends on BR2_PACKAGE_KODI_ARCH_SUPPORTS
>  	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS \
> -		|| !BR2_USE_WCHAR || BR2_STATIC_LIBS
> +		|| !BR2_USE_WCHAR || BR2_STATIC_LIBS \
> +		|| !BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON_PYC_ONLY
>  	depends on BR2_USE_MMU
>  
>  config BR2_PACKAGE_KODI_EGL_GLES
> @@ -65,7 +66,6 @@ menuconfig BR2_PACKAGE_KODI
>  	select BR2_PACKAGE_OPENSSL
>  	select BR2_PACKAGE_PCRE
>  	select BR2_PACKAGE_PCRE_UCP
> -	select BR2_PACKAGE_PYTHON
>  	select BR2_PACKAGE_PYTHON_BSDDB
>  	select BR2_PACKAGE_PYTHON_BZIP2
>  	select BR2_PACKAGE_PYTHON_CURSES
> @@ -94,6 +94,8 @@ menuconfig BR2_PACKAGE_KODI
>  	depends on BR2_USE_WCHAR
>  	depends on !BR2_STATIC_LIBS # python
>  	depends on BR2_PACKAGE_KODI_ARCH_SUPPORTS
> +	depends on BR2_PACKAGE_PYTHON
> +	depends on !BR2_PACKAGE_PYTHON_PYC_ONLY
>  	help
>  	  Kodi is an award-winning free and open source (GPL) software
>  	  media player and entertainment hub for digital media.
>
Yann E. MORIN Sept. 15, 2015, 8:03 p.m. UTC | #4
Arnout, All,

On 2015-09-15 18:37 +0200, Arnout Vandecappelle spake thusly:
> On 13-09-15 23:13, Yann E. MORIN wrote:
> > Kodi segfaults as soon as it tries to load a python module:
> > 
> >     Could not find platform independent libraries <prefix>
> >     Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
> >     ImportError: No module named site
> >     Segmentation fault
> > 
> > Turns out that keeping .py modules (with or without .pyc) fixes the
> > issue.
> > 
> > Currently, Kodi selects python, but since the format of modules is a
> > choice, we can not select it.
> 
>  I think it's a lot more user-friendly to do
> 
> 	select BR2_PACKAGE_PYTHON_PY_PYC

Two problems with that option:
  - first, it is not acceptable; one must *not* select a symbol that is
    part of a choice
  - Kconfig won't even act on that select, in fact:

    $ cat select-choice.in
    config FOO
        bool "foo"
        select BAR_B
    
    choice BAR
        bool "bar"
    
    config BAR_A
        bool "bar-a"
    
    config BAR_B
        bool "bar-b"
    
    config BAR_C
        bool "bar-c"
    
    endchoice

    $ cat .config
    #
    # Automatically generated file; DO NOT EDIT.
    # Configuration
    #
    CONFIG_FOO=y
    CONFIG_BAR_A=y
    # CONFIG_BAR_B is not set
    # CONFIG_BAR_C is not set

So, as you can see, even though FOO is set, BAR_B is not, even though
FOO selects it.

>  That removes the possibility for the user to select the PY_ONLY option, but I
> don't think that that's so terribly important. And it does make life a whole lot
> simpler for someone who wants to select Kodi. They already have to go and enable
> an EGL provider, so let's not make their life harder by requiring manual
> selection of python with the correct, non-default _PY_PYC option...

One alternative (if we are *that* concerned with user-friendliness),
would be to introduce an intermediate symbol that allows to get rid of
.py, something like:

    config BR2_PKG_PYTHON_WANTS_PY
        bool

    choice
        bool "module fomat"

    config BR2_PKG_PYTHON_PY_ONLY
        bool ".py only"

    config BR2_PKG_PYTHON_PYC_ONLY
        bool ".pyc only"
        depends on !BR2_PKG_PYTHON_WANTS_PY

    endchoice

(note: .py+.pyc option voluntarily omitted).

and then Kodi would select BR2_PKG_PYTHON_WANTS_PY.

But that's just ugly, even just for the sake of simplicity.

Regards,
Yann E. MORIN.
Arnout Vandecappelle Sept. 15, 2015, 8:52 p.m. UTC | #5
On 15-09-15 22:03, Yann E. MORIN wrote:
> Arnout, All,
> 
> On 2015-09-15 18:37 +0200, Arnout Vandecappelle spake thusly:
>> On 13-09-15 23:13, Yann E. MORIN wrote:
>>> Kodi segfaults as soon as it tries to load a python module:
>>>
>>>     Could not find platform independent libraries <prefix>
>>>     Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>>>     ImportError: No module named site
>>>     Segmentation fault
>>>
>>> Turns out that keeping .py modules (with or without .pyc) fixes the
>>> issue.
>>>
>>> Currently, Kodi selects python, but since the format of modules is a
>>> choice, we can not select it.
>>
>>  I think it's a lot more user-friendly to do
>>
>> 	select BR2_PACKAGE_PYTHON_PY_PYC
> 
> Two problems with that option:
>   - first, it is not acceptable; one must *not* select a symbol that is
>     part of a choice
>   - Kconfig won't even act on that select, in fact:

 I guess 1 is a result of 2, right? Stupid Kconfig.

 In that case, there really is no alternative except what you propose. The
ugliness of BR2_PACKAGE_PYTHON_WANTS_PY is too horrible to even consider.

 Well, perhaps better would be to make kodi not crash in PYC_ONLY :-)

 Regards,
 Arnout


> 
>     $ cat select-choice.in
>     config FOO
>         bool "foo"
>         select BAR_B
>     
>     choice BAR
>         bool "bar"
>     
>     config BAR_A
>         bool "bar-a"
>     
>     config BAR_B
>         bool "bar-b"
>     
>     config BAR_C
>         bool "bar-c"
>     
>     endchoice
> 
>     $ cat .config
>     #
>     # Automatically generated file; DO NOT EDIT.
>     # Configuration
>     #
>     CONFIG_FOO=y
>     CONFIG_BAR_A=y
>     # CONFIG_BAR_B is not set
>     # CONFIG_BAR_C is not set
> 
> So, as you can see, even though FOO is set, BAR_B is not, even though
> FOO selects it.
> 
>>  That removes the possibility for the user to select the PY_ONLY option, but I
>> don't think that that's so terribly important. And it does make life a whole lot
>> simpler for someone who wants to select Kodi. They already have to go and enable
>> an EGL provider, so let's not make their life harder by requiring manual
>> selection of python with the correct, non-default _PY_PYC option...
> 
> One alternative (if we are *that* concerned with user-friendliness),
> would be to introduce an intermediate symbol that allows to get rid of
> .py, something like:
> 
>     config BR2_PKG_PYTHON_WANTS_PY
>         bool
> 
>     choice
>         bool "module fomat"
> 
>     config BR2_PKG_PYTHON_PY_ONLY
>         bool ".py only"
> 
>     config BR2_PKG_PYTHON_PYC_ONLY
>         bool ".pyc only"
>         depends on !BR2_PKG_PYTHON_WANTS_PY
> 
>     endchoice
> 
> (note: .py+.pyc option voluntarily omitted).
> 
> and then Kodi would select BR2_PKG_PYTHON_WANTS_PY.
> 
> But that's just ugly, even just for the sake of simplicity.
> 
> Regards,
> Yann E. MORIN.
> 
>
Yann E. MORIN Sept. 15, 2015, 9:05 p.m. UTC | #6
Arnout, All,

On 2015-09-15 22:52 +0200, Arnout Vandecappelle spake thusly:
> On 15-09-15 22:03, Yann E. MORIN wrote:
> > On 2015-09-15 18:37 +0200, Arnout Vandecappelle spake thusly:
> >> On 13-09-15 23:13, Yann E. MORIN wrote:
> >>> Kodi segfaults as soon as it tries to load a python module:
> >>>
> >>>     Could not find platform independent libraries <prefix>
> >>>     Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
> >>>     ImportError: No module named site
> >>>     Segmentation fault
> >>>
> >>> Turns out that keeping .py modules (with or without .pyc) fixes the
> >>> issue.
> >>>
> >>> Currently, Kodi selects python, but since the format of modules is a
> >>> choice, we can not select it.
> >>
> >>  I think it's a lot more user-friendly to do
> >>
> >> 	select BR2_PACKAGE_PYTHON_PY_PYC
> > 
> > Two problems with that option:
> >   - first, it is not acceptable; one must *not* select a symbol that is
> >     part of a choice
> >   - Kconfig won't even act on that select, in fact:
> 
>  I guess 1 is a result of 2, right? Stupid Kconfig.

Well, not really. If you allow a symbol of a choice to be selected, then
how would you handle this case;

    config FOO
        bool "foo"
        select BUZ_A

    config BAR
        bool "bar"
        select BUZ_B

    choice
        bool "buz"

    config BUZ_A
        bool "buz-a"

    config BUZ_B
        bool "buz-b"

    endchoice

That's basicaly unsolvable.

Hence, selecting a choice entry does not make sense to start with.

>  In that case, there really is no alternative except what you propose. The
> ugliness of BR2_PACKAGE_PYTHON_WANTS_PY is too horrible to even consider.

Yes, _WANTS_PY is ugly.

Regards,
Yann E. MORIN.
Thomas Petazzoni Sept. 19, 2015, 12:40 p.m. UTC | #7
Hello,

On Sun, 13 Sep 2015 23:35:13 +0200, Yann E. MORIN wrote:

> > Do we actually understand why it doesn't work? There is really no
> > reason for .py files to be necessary.
> 
> Well, what do I know about python? ;-)
> 
> I never said I understood the issue. Just that having only .pyc modules
> make Kodi segfault, while having .py makes it work... :-(
> 
> All I got was the trace above. There was nothing (of interest) in Kodi's
> own log file.

As you can imagine, I'm not too happy with this solution. I believe
Kodi is doing something incorrect, since if you just run Python with
the .pyc files, and do "import site", it works just fine.

There is some logic in Kodi that tries to set the PYTHONHOME
environment variable. Can you see in the logs if you see the following
messages (from xbmc/interfaces/python/XBPython.cpp) :

  CLog::Log(LOGINFO, "initializing python engine.");
  CLog::Log(LOGDEBUG, "PYTHONHOME -> %s", CSpecialProtocol::TranslatePath("special://frameworks").c_str());
  CLog::Log(LOGDEBUG, "PYTHONPATH -> %s", CSpecialProtocol::TranslatePath("special://frameworks").c_str());

Alternatively, can you change Python, in file Modules/getpath.c,
function calculate_path(), and dump all the environment variables?

I could do it myself, but Kodi is so long to build... :-/

Thanks!

Thomas
Yann E. MORIN Sept. 19, 2015, 3:47 p.m. UTC | #8
Thomas, All,

On 2015-09-19 14:40 +0200, Thomas Petazzoni spake thusly:
> Hello,
> 
> On Sun, 13 Sep 2015 23:35:13 +0200, Yann E. MORIN wrote:
> 
> > > Do we actually understand why it doesn't work? There is really no
> > > reason for .py files to be necessary.
> > 
> > Well, what do I know about python? ;-)
> > 
> > I never said I understood the issue. Just that having only .pyc modules
> > make Kodi segfault, while having .py makes it work... :-(
> > 
> > All I got was the trace above. There was nothing (of interest) in Kodi's
> > own log file.
> 
> As you can imagine, I'm not too happy with this solution. I believe
> Kodi is doing something incorrect, since if you just run Python with
> the .pyc files, and do "import site", it works just fine.

Yeah, I would not say the patch is the optimal solution.

> There is some logic in Kodi that tries to set the PYTHONHOME
> environment variable. Can you see in the logs if you see the following
> messages (from xbmc/interfaces/python/XBPython.cpp) :
> 
>   CLog::Log(LOGINFO, "initializing python engine.");
>   CLog::Log(LOGDEBUG, "PYTHONHOME -> %s", CSpecialProtocol::TranslatePath("special://frameworks").c_str());
>   CLog::Log(LOGDEBUG, "PYTHONPATH -> %s", CSpecialProtocol::TranslatePath("special://frameworks").c_str());

No, those messages I did not see. Only the message about suggesting to
set PYTHONHOME followed by the segfault.

> Alternatively, can you change Python, in file Modules/getpath.c,
> function calculate_path(), and dump all the environment variables?

Sure, I can have a look at it. No promise, though...

Regards,
Yann E. MORIN.
Thomas Petazzoni Sept. 20, 2015, 8:17 a.m. UTC | #9
Hello,

On Sat, 19 Sep 2015 17:47:35 +0200, Yann E. MORIN wrote:

> > There is some logic in Kodi that tries to set the PYTHONHOME
> > environment variable. Can you see in the logs if you see the following
> > messages (from xbmc/interfaces/python/XBPython.cpp) :
> > 
> >   CLog::Log(LOGINFO, "initializing python engine.");
> >   CLog::Log(LOGDEBUG, "PYTHONHOME -> %s", CSpecialProtocol::TranslatePath("special://frameworks").c_str());
> >   CLog::Log(LOGDEBUG, "PYTHONPATH -> %s", CSpecialProtocol::TranslatePath("special://frameworks").c_str());
> 
> No, those messages I did not see. Only the message about suggesting to
> set PYTHONHOME followed by the segfault.

All the messages you posted are coming from Python itself. I'm
interested in seeing under what conditions is Kodi starting the Python
interpreter. But there's lot of code in Kodi, so I'm not sure from
which place the Python interpreter is started and causing the segfault
you're seeing.

Any chance you do a debug symbols enabled build to get a backtrace of
Kodi ?

> > Alternatively, can you change Python, in file Modules/getpath.c,
> > function calculate_path(), and dump all the environment variables?
> 
> Sure, I can have a look at it. No promise, though...

Yes, sure. You could also report a bug in the Kodi bug tracker? They
might at least be able to give some hints about what's going on.

Thanks,

Thomas
Bernd Kuhls Sept. 26, 2015, 2:40 p.m. UTC | #10
Am Sun, 13 Sep 2015 23:29:42 +0200 schrieb Thomas Petazzoni:

> Yann,
> 
> On Sun, 13 Sep 2015 23:13:03 +0200, Yann E. MORIN wrote:
>> Kodi segfaults as soon as it tries to load a python module:
>> 
>>     Could not find platform independent libraries <prefix> Consider
>>     setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>>     ImportError: No module named site Segmentation fault
>> 
>> Turns out that keeping .py modules (with or without .pyc) fixes the
>> issue.
>> 
>> Currently, Kodi selects python, but since the format of modules is a
>> choice, we can not select it.
>> 
>> Fix that by inverting the dependency on python from Kodi:
>>   - turn it into a depends rather than a select,
>>   - add the dependency to ! pyc-only - update the comment accordingly.
>> 
>> Signed-off-by: "Yann E. MORIN"
>> <yann.morin.1998@free.fr>
> 
> Do we actually understand why it doesn't work? There is really no reason
> for .py files to be necessary.

Hi Thomas, hi Yann,

according to http://kodi.wiki/view/Add-on_rules Kodi apparently 
expects .py files in add-ons:

"All source files must be included. No pre-compiled files will be 
allowed."

Some more information about this can be found here:
http://forum.kodi.tv/showthread.php?tid=181065&pid=1580560#pid1580560
https://github.com/OpenELEC/OpenELEC.tv/issues/3335#issuecomment-51490468

I remember that several years ago I had problems after removing .py files 
from my xbmc/kodi box so I kept them ever since ;)

Reviewed-by: Bernd Kuhls <bernd.kuhls@t-online.de>

Regards, Bernd
Yann E. MORIN Dec. 5, 2015, 8:38 p.m. UTC | #11
All,

On 2015-09-13 23:13 +0200, Yann E. MORIN spake thusly:
> Kodi segfaults as soon as it tries to load a python module:
> 
>     Could not find platform independent libraries <prefix>
>     Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
>     ImportError: No module named site
>     Segmentation fault
> 
> Turns out that keeping .py modules (with or without .pyc) fixes the
> issue.
> 
> Currently, Kodi selects python, but since the format of modules is a
> choice, we can not select it.
> 
> Fix that by inverting the dependency on python from Kodi:
>   - turn it into a depends rather than a select,
>   - add the dependency to ! pyc-only
>   - update the comment accordingly.

This is wrong and causes reursive dependencies:

    package/kodi/Config.in:33:error: recursive dependency detected!
    package/kodi/Config.in:33:      symbol BR2_PACKAGE_KODI depends on BR2_PACKAGE_PYTHON
    package/python/Config.in:5:     symbol BR2_PACKAGE_PYTHON is selected by BR2_PACKAGE_SAMBA4
    package/samba4/Config.in:7:     symbol BR2_PACKAGE_SAMBA4 is selected by BR2_PACKAGE_KODI_LIBSMBCLIENT
    package/kodi/Config.in:216:     symbol BR2_PACKAGE_KODI_LIBSMBCLIENT depends on BR2_PACKAGE_KODI

Marking as "rejected". I'll try to find a better solution.

Regards,
Yann E. MORIN.

> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> 
> ---
> changes v1 -> v2:
>   - fix spurious 'i' (vim insert)
> ---
>  package/kodi/Config.in | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/package/kodi/Config.in b/package/kodi/Config.in
> index 797f59d..6d6c47b 100644
> --- a/package/kodi/Config.in
> +++ b/package/kodi/Config.in
> @@ -2,10 +2,11 @@ config BR2_PACKAGE_KODI_ARCH_SUPPORTS
>  	bool
>  	default y if (BR2_arm || (BR2_mipsel && BR2_TOOLCHAIN_USES_GLIBC) || BR2_i386 || BR2_x86_64) && BR2_PACKAGE_BOOST_ARCH_SUPPORTS
>  
> -comment "kodi needs a toolchain w/ C++, threads, wchar, dynamic library"
> +comment "kodi needs python and .py modiules, and a toolchain w/ C++, threads, wchar, dynamic library"
>  	depends on BR2_PACKAGE_KODI_ARCH_SUPPORTS
>  	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS \
> -		|| !BR2_USE_WCHAR || BR2_STATIC_LIBS
> +		|| !BR2_USE_WCHAR || BR2_STATIC_LIBS \
> +		|| !BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON_PYC_ONLY
>  	depends on BR2_USE_MMU
>  
>  config BR2_PACKAGE_KODI_EGL_GLES
> @@ -65,7 +66,6 @@ menuconfig BR2_PACKAGE_KODI
>  	select BR2_PACKAGE_OPENSSL
>  	select BR2_PACKAGE_PCRE
>  	select BR2_PACKAGE_PCRE_UCP
> -	select BR2_PACKAGE_PYTHON
>  	select BR2_PACKAGE_PYTHON_BSDDB
>  	select BR2_PACKAGE_PYTHON_BZIP2
>  	select BR2_PACKAGE_PYTHON_CURSES
> @@ -94,6 +94,8 @@ menuconfig BR2_PACKAGE_KODI
>  	depends on BR2_USE_WCHAR
>  	depends on !BR2_STATIC_LIBS # python
>  	depends on BR2_PACKAGE_KODI_ARCH_SUPPORTS
> +	depends on BR2_PACKAGE_PYTHON
> +	depends on !BR2_PACKAGE_PYTHON_PYC_ONLY
>  	help
>  	  Kodi is an award-winning free and open source (GPL) software
>  	  media player and entertainment hub for digital media.
> -- 
> 1.9.1
>
diff mbox

Patch

diff --git a/package/kodi/Config.in b/package/kodi/Config.in
index 797f59d..6d6c47b 100644
--- a/package/kodi/Config.in
+++ b/package/kodi/Config.in
@@ -2,10 +2,11 @@  config BR2_PACKAGE_KODI_ARCH_SUPPORTS
 	bool
 	default y if (BR2_arm || (BR2_mipsel && BR2_TOOLCHAIN_USES_GLIBC) || BR2_i386 || BR2_x86_64) && BR2_PACKAGE_BOOST_ARCH_SUPPORTS
 
-comment "kodi needs a toolchain w/ C++, threads, wchar, dynamic library"
+comment "kodi needs python and .py modiules, and a toolchain w/ C++, threads, wchar, dynamic library"
 	depends on BR2_PACKAGE_KODI_ARCH_SUPPORTS
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS \
-		|| !BR2_USE_WCHAR || BR2_STATIC_LIBS
+		|| !BR2_USE_WCHAR || BR2_STATIC_LIBS \
+		|| !BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON_PYC_ONLY
 	depends on BR2_USE_MMU
 
 config BR2_PACKAGE_KODI_EGL_GLES
@@ -65,7 +66,6 @@  menuconfig BR2_PACKAGE_KODI
 	select BR2_PACKAGE_OPENSSL
 	select BR2_PACKAGE_PCRE
 	select BR2_PACKAGE_PCRE_UCP
-	select BR2_PACKAGE_PYTHON
 	select BR2_PACKAGE_PYTHON_BSDDB
 	select BR2_PACKAGE_PYTHON_BZIP2
 	select BR2_PACKAGE_PYTHON_CURSES
@@ -94,6 +94,8 @@  menuconfig BR2_PACKAGE_KODI
 	depends on BR2_USE_WCHAR
 	depends on !BR2_STATIC_LIBS # python
 	depends on BR2_PACKAGE_KODI_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_PYTHON
+	depends on !BR2_PACKAGE_PYTHON_PYC_ONLY
 	help
 	  Kodi is an award-winning free and open source (GPL) software
 	  media player and entertainment hub for digital media.