flathub / org.nuspell.Nuspell

https://flathub.org/apps/details/org.nuspell.Nuspell
0 stars 1 forks source link

No dictionaries inside flatpak #4

Closed dimztimz closed 3 years ago

dimztimz commented 4 years ago

There are no dictionaries packaged within the flatpak, and Nuspell has no access to the system dictionaries installed under /usr/share/... because that's how Flatpak works.

PanderMusubi commented 4 years ago

These dictionaries are available the flatpak:

/var/lib/flatpak//runtime/org.freedesktop.Sdk/x86_64/19.08/active/files/share/hunspell/

There are 5 dictionaries, 12 links to those and 102 broken linked.

Can be tested with:

flatpak-builder --run build-dir org.nuspell.Nuspell.json nuspell /etc/os-release
flatpak-builder --run build-dir org.nuspell.Nuspell.json nuspell -d en_US /etc/os-release
flatpak-builder --run build-dir org.nuspell.Nuspell.json nuspell -d en_IE /etc/os-release
flatpak-builder --run build-dir org.nuspell.Nuspell.json nuspell -d es_CU /etc/os-release

But the Sdk is of course not shipped with the flatpak. Like with snap, there is a desire for Hunspell dictionaries package for flatpak but doesn't exist yet. Will look into alternatives or copying the files from the Sdk.

Note that Nuspell lists also dictionaries with broken links. Should that be checked in the finder?

Also /usr is blacklisted for sanbox permission, see https://docs.flatpak.org/en/latest/sandbox-permissions.html#filesystem-access will also look into this more.

PanderMusubi commented 4 years ago

The dictionaries are in flatpak desktop and are available to Nuspell. Try:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install nuspell
flatpak run org.nuspell.Nuspell -D
flatpak run org.nuspell.Nuspell /etc/os-release
flatpak run org.nuspell.Nuspell -d en_GB /etc/os-release
flatpak run org.nuspell.Nuspell -d en_IE /etc/os-release

Hence, shipping dictionaries in Nuspell's flatpak is not needed and all under /usr is blacklisted from exposure. Can this issue be closed?

dimztimz commented 4 years ago

If there are only 5 dicts then no. More should be packaged.

PanderMusubi commented 4 years ago

I think those 100 broken links are fixed when installing the locale flatpak. Will go that direction first.

PanderMusubi commented 4 years ago

https://github.com/flathub/org.nuspell.Nuspell/commit/acd1be210a497a056486704ba9cc1e8383e3c0d0 solves it, only need to minimize config to prevent duplicate paths

PanderMusubi commented 3 years ago

Solved, please double check and close.

dimztimz commented 3 years ago

Seems to work. But the following lines are unnecesary:

https://github.com/flathub/org.nuspell.Nuspell/blob/3b2d66243b24a08b77b2517dbe390bccbdc74e92/org.nuspell.Nuspell.json#L14-L16

Please delete them and test if it works without them.

PanderMusubi commented 3 years ago

I eventually could get rid of only the third part, but the two first parts need to be in there to expose the host dictionaries.

dimztimz commented 3 years ago

The host dictionaries are never available due to the sandbox.

PanderMusubi commented 3 years ago

I got that from https://docs.flatpak.org/en/latest/sandbox-permissions.html#filesystem-access the part on "These directories are mounted under /var/run/host: /etc, /usr"

dimztimz commented 3 years ago

And two sentences above it it says that host's directory /usr is blacklisted, i.e. it is inaccessible.