Closed dimztimz closed 3 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.
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?
If there are only 5 dicts then no. More should be packaged.
I think those 100 broken links are fixed when installing the locale flatpak. Will go that direction first.
https://github.com/flathub/org.nuspell.Nuspell/commit/acd1be210a497a056486704ba9cc1e8383e3c0d0 solves it, only need to minimize config to prevent duplicate paths
Solved, please double check and close.
Seems to work. But the following lines are unnecesary:
Please delete them and test if it works without them.
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.
The host dictionaries are never available due to the sandbox.
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"
And two sentences above it it says that host's directory /usr
is blacklisted, i.e. it is inaccessible.
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.