nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/hunspell-dirs.patch
Maximilian Bosch dee2dab7c6
ibus-engines.typing-booster: init at 2.1.1
This package providesa completion input method for faster typing.
See https://mike-fabian.github.io/ibus-typing-booster

Detailed instructions how to activate this IBus engine on your desktop
can be found in the upstream docs: https://mike-fabian.github.io/ibus-typing-booster/documentation.html

A simple VM with the Gnome3 desktop and activated `ibus' looks like
this:

```nix
{
  emojipicker = { pkgs, ... }: {
    services.xserver = {
      enable = true;
      desktopManager.gnome3.enable = true;
      desktopManager.xterm.enable = false;
    };
    users.extraUsers.vm = {
      password = "vm";
      isNormalUser = true;
    };
    i18n.inputMethod.ibus.engines = [
      pkgs.ibus-engines.typing-booster
    ];
    i18n.inputMethod.enabled = "ibus";
    virtualisation.memorySize = 2048;
  };
}
```

Fixes #38721
2018-09-19 21:27:10 +02:00

31 lines
1.1 KiB
Diff

diff --git a/engine/itb_util.py b/engine/itb_util.py
index ded236a..633525a 100755
--- a/engine/itb_util.py
+++ b/engine/itb_util.py
@@ -1876,14 +1876,18 @@ def find_hunspell_dictionary(language):
If no dictionary can be found for the requested language,
the return value is ('', '').
'''
- dirnames = [
- '/usr/share/hunspell',
- '/usr/share/myspell',
- '/usr/share/myspell/dicts',
- '/usr/local/share/hunspell', # On FreeBSD the dictionaries are here
- '/usr/local/share/myspell',
- '/usr/local/share/myspell/dicts',
- ]
+
+ if "NIX_HUNSPELL_DIRS" in os.environ:
+ dirnames = os.environ["NIX_HUNSPELL_DIRS"].split(":")
+ else: # fallback to the original behavior
+ dirnames = [
+ '/usr/share/hunspell',
+ '/usr/share/myspell',
+ '/usr/share/myspell/dicts',
+ '/usr/local/share/hunspell', # On FreeBSD the dictionaries are here
+ '/usr/local/share/myspell',
+ '/usr/local/share/myspell/dicts',
+ ]
dic_path = ''
aff_path = ''
for language in expand_languages([language]):