GNOME Bugzilla – Bug 742208
libenchant fails to find modules (backend libraries) when used within bundle
Last modified: 2015-01-31 18:39:53 UTC
I'm porting claws-mail to gtk-osx, and it uses libenchant as front-end for spell checking. So when bundled claws-mail is used on another system (i.e. there are no libraries at hardcoded build prefix) it fails to find libenchant_myspell.so (inside the bundle) and other back-end modules since it looks for them either at homedir or a hard-coded installation prefix, the same goes for system-wide default ordering config. See -DENCHANT_GLOBAL_MODULE_DIR=\"$(libdir)/enchant\" -DENCHANT_GLOBAL_ORDERING=\"$(datadir)/enchant\" providing env. variables to recognize additional directories (inside bundle) for backend libraries and default ordering config seems like a convenient way to ship them with bundle so that user won't have to do manual magic installation steps to make spell-checking work except of installing needed dictionaries. As for dictionaries, it's looking for them at /Library/Dictionaries as it's currently built. Dictionaries probably shouldn't be shipped with mail client anyway, but rather installed by user when he/she needs them either at global /Library/Dictionaries or user's home directory.
You need to attach your proposed patch here. I get it. I was misled by "config", which isn't appropriate in this context. That's not your fault, it's on whoever wrote that bit of enchant. For the global ordering part, I'd prefer that you use XDG_DATA_DIRS because it's the more general approach and it's already bound to $bundle_data in the launcher script. It's a PATH-style variable, though, so you'll have to split it on ':', append "enchant" to each, and add it to the list. If that's too much work you can use the special variable as in your original patch, but call it ENCHANT_DATA_PATH instead of ENCHANT_CONFIG_PATH. See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html for why. For finding modules ENCHANT_MODULE_PATH is fine.
Created attachment 294269 [details] [review] make enchant to look for modules/configs in env specified dirs Here is amended patch that uses XDG_DATA_DIRS for ordering config lookup instead of ENCHANT_CONFIG_DIR as suggested.
Comment on attachment 294269 [details] [review] make enchant to look for modules/configs in env specified dirs Committed, thanks.