3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix
danbst 0f8596ab3f mass replace "flip map -> forEach"
See `forEach`-introduction commit.
```
rg 'flip map ' --files-with-matches | xargs sed -i 's/flip map /forEach /g'
```
2019-08-05 14:03:38 +03:00

31 lines
830 B
Nix

{ typing-booster, symlinkJoin, hunspellDicts, lib, makeWrapper
, langs ? [ "de-de" "en-us" "es-es" "fr-moderne" "it-it" "sv-se" "sv-fi" ]
}:
let
hunspellDirs = with lib; makeSearchPath ":" (flatten (forEach langs (lang: [
"${hunspellDicts.${lang}}/share/hunspell"
"${hunspellDicts.${lang}}/share/myspell"
"${hunspellDicts.${lang}}/share/myspell/dicts"
])));
in
symlinkJoin {
name = "${typing-booster.name}-with-hunspell";
paths = [ typing-booster ];
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
for i in bin/emoji-picker libexec/ibus-{setup,engine}-typing-booster; do
wrapProgram "$out/$i" \
--prefix NIX_HUNSPELL_DIRS : ${hunspellDirs}
done
sed -i -e "s,${typing-booster},$out," $out/share/ibus/component/typing-booster.xml
'';
inherit (typing-booster) meta;
}