Opened 6 weeks ago

Last modified 4 weeks ago

#874 new enhancement

Add Enchant C-library to OSGEO4W

Reported by: Chris York Owned by: osgeo4w-dev@…
Priority: normal Component: Package
Version: Keywords:
Cc:

Description

Further to trying to solve a QGIS issue, I would like to request packaging of Enchant libraries within OSGEO4W so that it is possible to load pyenchant within QGIS.

Currently pyenchant packages the libraries within its Windows version, but it is possible to install the package without the wheel binaries. Enchant looks in the system path if it can't find those binaries, so would presumably load them if included within the QGIS installation?

Current pyenchant libraries conflict with GRASS (using older dlls), so if the packaging was done centrally I assume that this issue would be bypassed?

Please see: https://github.com/qgis/QGIS/issues/59775 and https://github.com/pyenchant/pyenchant/issues/311#issuecomment-1678972867

Pyenchant can be installed using MINGW so I assume it can be packaged so that it does not conflict with other elements: https://pyenchant.github.io/pyenchant/install.html#using-mingw

Happy to help but don't know where to start...

Change History (2)

comment:1 by jef, 6 weeks ago

What needs pyenchant?

Does pyenchant support python 3.12?

It apparently needs libenchant, which needs (also not yet packaged) glib and one or several spellchecking engines + dictionaries?

Last edited 6 weeks ago by jef (previous) (diff)

comment:2 by Chris York, 4 weeks ago

As there is no spell checking capability for QGIS users (editing attributes) I have developed a plug-in, but it cannot work on Windows at present due to conflicts with DLLs used by GRASS.

For pyenchant to work in Windows the following binaries are included (some of these appear to be older versions than those used by QGIS):

libenchant-2.dll libgcc_s_seh-1.dll libglib-2.0-0.dll libgmodule-2.0-0.dll libgobject-2.0-0.dll libhunspell-1.6-0.dll libiconv-2.dll libintl-8.dll libp11-kit-0.dll libpcre-1.dll libpcre16-0.dll libpcre32-0.dll libpcrecpp-0.dll libpcreposix-0.dll libstdc++-6.dll libwinpthread-1.dll

Pyenchant works in python 3.12 (tested in OSGeo4W shell).

The spell checking engine associated is Enchant (which is available in mingw). Dictionaries include Hunspell - in the packaged version only English, but presumably additional dictionaries can be installed (they exist). Other flavours are compatible.

If python bindings for qplaintextedit were exposed it would be possible to integrate the functions of my plug-in with attribute forms seamlessly. Or the class could potentially be ported to the core and then work across QGIS to modify the qplaintext widgets. But none of this can be unlocked without Enchant.

Note: See TracTickets for help on using tickets.