flathub / io.github.cudatext.CudaText-Qt

https://flathub.org/apps/details/io.github.cudatext.CudaText-Qt
0 stars 0 forks source link

Python engine cannot be activated in Flatpak version (no libpython3*.so* found) #17

Open Alexey-T opened 6 days ago

Alexey-T commented 6 days ago

User reported it here https://github.com/Alexey-T/CudaText/issues/5738

JordanL2 commented 6 days ago

@Alexey-T I'll try to make the flatpak pre-configure pylib__linux in cudatext/settings/user.json so the flatpak works out of the box, without the user needing to select the python path.

Alexey-T commented 6 days ago

It will be better.

JordanL2 commented 6 days ago

So, I tried changing settings_default/default.json prior to installing it, so that it contains:

"pylib__linux": "/usr/lib/x86_64-linux-gnu/libpython3.so",

Weirdly, this isn't working, on first startup I still need to search for and select the python library. After I do so, settings/user.json contains:

"pylib__linux": "/usr/lib/x86_64-linux-gnu/libpython3.so"

So, I'm at a bit of a loss why it isn't working.

Alexey-T commented 6 days ago

Docs tell that default.json is NOT used, https://wiki.freepascal.org/CudaText#Configuration

if you write value to user.json, Python is found?

JordanL2 commented 6 days ago

Isn't user.json only created after Cudatext is started for the first time, and a setting is changed?

Alexey-T commented 6 days ago

Yes, right. also you can pre-create this file in the distro in the Flatpak.

JordanL2 commented 6 days ago

So, if during installation I create directory $PREFIX/share/cudatext/settings and put user.json inside it, will that be copied to the user's home config directory on first startup?

Alexey-T commented 6 days ago

no, it won't be, pre-copying works only for few folders and 'settings' is not 1 of them.

btw, if you compile from src, then you can assign this value in pas src!

function InitPyLibraryPath: string;  

in proc_globdata.pas. it has simple code to fix it.