We have moved to a new Sailfish OS Forum. Please start new discussions there.
8

python 3.7 missing curses

Tracked by Jolla (In release)

asked 2019-09-12 10:41:51 +0200

itsNotMe gravatar image

updated 2019-09-12 15:10:32 +0200

Updating to Sailfish 3.1 I wondering where is curses support for python3.7, as that worked before the update ? I'm not fully familar with that stuff, but when starting a python scripton on a terminal with

import ncurses

inside, it blames me with

ModuleNotFoundError: no Module named _curses

And yes in fact there is no lib under /usr/lib/python3.7/lib-dynload/_curses*.so...

Does this depends on

https://git.merproject.org/mer-core/python3/commit/75b9baf29d79660c61c59c628f90d4a2c083401c ?

What must i do to get this working?

Cheers.

edit retag flag offensive close delete

Comments

3

From my understanding, the commit you pointed indeed removed curses for GPLv3 reasons. It happened the same for sqlite, and to keep curses support, I created a separated package for the command line tool. Maybe something similar can be done in Python to package curses module in a separated package. If you need, I can help you proposing a MR.

Damien Caliste ( 2019-09-12 16:45:32 +0200 )edit

What do you mean with "for GPLv3 reasons"?

Mario ( 2019-09-12 20:38:15 +0200 )edit
3

Maybe @Andy Branson can correct me if I'm wrong, but I think that Jolla is providing SailfishOS as a commercial product without root access. But if you distribute GPLv3 software you need to provide a way to change the GPLv3 software with another version. Without root, this is hardly tractable (with a sudo why not), but surely something that the Jolla's contractor don't want to happen. So Jolla don't want to have GPLv3 software in the common distribution. Readline is now GPLv3 and all readline enabled features have been removed.

The solution we found for sqlite3 CLI was to provide the CLI in a separated package that is not distributed by default, but can be instalable with pkcon in the version available to the community on Jolla1, JollaC or Sony ports. I'm suggesting to do the same for curses module in Python.

Damien Caliste ( 2019-09-12 21:54:46 +0200 )edit

Allright, this only means that Jolla says more and more Goodbye to Opensource. Then let's wait and donate for Maemo Leste - and hope it will be soonly available for a few more phones! But nevertheless howto solve this problem for the rest of the day by using the developer mode:

  1. devel-su
  2. zypper install make gcc
  3. wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz
  4. tar -xzf Python-3.7.2.tgz
  5. cd Python-3.7.2; ./configure; make
  6. cp build/lib.linux*/_curs* /usr/lib/python3.7/lib-dynload/

Cheers

itsNotMe ( 2019-09-13 08:58:54 +0200 )edit
4

@itsNotMe, I don't think this change anything to the open source status of SailfishOS. The community version that is officialy hosted on Jolla's servers can still provide GPLv3 packages, like the already mentioned sqlite CLI package.

The trouble is that they didn't care enough when removing readline dependencies. I'm using sqlite CLI regularly so I noticed the change and contributed to have it as a separated package. I'm not using Python on the phone, so I didn't notice. But it's open source (yes it is), having it in the main repo is just a matter of contributing a bit.

Damien Caliste ( 2019-09-13 09:47:58 +0200 )edit

2 Answers

Sort by » oldest newest most voted
10

answered 2019-09-13 12:53:21 +0200

updated 2020-04-30 09:17:52 +0200

Edit 2020-04-30 : Jolla continue to update the python package, trying to deal with minimal dependencies on the base package to ease bootstraping of the full build of SailfishOS. Today, Matti Kosola accepted the patch to package ncurse separately (and improved it also to separate sqlite). It should be back in the next public version of SailfishOS. Yeh ! A python3-curses and a python3-sqlite packages should be available with pkcon, if not installed already by default.

Edit 2019-10-28 : after submitting the MR and having discussed with @Sage and @Pekka Vuorela, it appears that ncurses was disabled for other reasons than licensing (see the MR discussion) : they need to bootstrap Python (build it to build the rest), and they thus want to have a minimal set of dependencies for the boot straping process. Ncurses was not used elsewhere in SailfishOS, so it was removed… I've updated the MR to reenable it as a separated package from a separate spec file. The MR is still under discussion. For those who need ncurses now, here is a local build from SDK : python3-curses-3.7.2-0.armv7hl.rpm.

I've submitted a merge request in SailfishOS to package this again but in a separated rpm. Let see how it will be handled ;)

If accepted, in a later version, curses will only be a pkcon install python3-curses away.

edit flag offensive delete publish link more

Comments

Thank you for yout help!

Cheers.

itsNotMe ( 2019-09-16 10:13:02 +0200 )edit

No problem, let's wait for the review and acceptance (or refusal) of the Jolla team and let's being optimistic in the mean time.

Damien Caliste ( 2019-09-16 11:23:46 +0200 )edit

Hey @damien I don't suppose you'd like to make a python3-curses rpm available to save us the time of building it ourselves? Thanks!

avidscavenger ( 2019-10-24 05:33:37 +0200 )edit

Sure, I can. Next week, I will have time.

Damien Caliste ( 2019-10-25 09:35:17 +0200 )edit
1

@avidscavenger I've built a ncurses package for Python. If you test it, tell me if it's working properly, so I can correct any mistake before MR acceptance.

Damien Caliste ( 2019-10-28 11:18:07 +0200 )edit
1

answered 2019-10-31 02:39:45 +0200

avidscavenger gravatar image

updated 2019-10-31 02:40:43 +0200

Thanks @damien, that seems to work.

I had some problem installing it connected with dependency on libpython3. Even though I had installed libpython3_7m1_0-3.7.2+git8-1.6.1.jolla.armv7hl I received the following output from pkcon:

Fatal error: nothing provides libpython3_7m1_0 = 3.7.2

But if I overrode the dependency using zypper (does pkcon not provide an override option?) then it worked.

edit flag offensive delete publish link more

Comments

Yes, I didn't generate the rpm with the exact same version number and there is a strict equality requirement. But as you've seen, it's a bit artificial since we're sure having compiled from the same code source. Forcing installation by ignoring the dependency is actually the right to do in that case. Thanks for the feedback. Besides a duplication issue in spec definition, I hope Jolla can accept the MR soon.

Damien Caliste ( 2019-10-31 09:11:08 +0200 )edit
Login/Signup to Answer

Question tools

Follow
4 followers

Stats

Asked: 2019-09-12 10:41:51 +0200

Seen: 2,746 times

Last updated: Apr 30 '20