hunspell-dicts: add support for german dictionary

Note that this relies on ispell as a dependency.  Also, perl and hunspell itself
are used during building the dictionary.
This commit is contained in:
timor 2018-02-28 14:32:52 +01:00 committed by Robin Gloster
parent 379317a778
commit 76a01ad9d1

View file

@ -1,6 +1,6 @@
/* hunspell dictionaries */
{ stdenv, fetchurl, fetchFromGitHub, unzip, coreutils, bash, which, zip }:
{ stdenv, fetchurl, fetchFromGitHub, unzip, coreutils, bash, which, zip, ispell, perl, hunspell }:
let
@ -168,6 +168,42 @@ let
};
};
mkDictFromJ3e =
{ shortName, shortDescription, dictFileName }:
stdenv.mkDerivation rec {
name = "hunspell-dict-${shortName}-j3e-${version}";
version = "20161207";
src = fetchurl {
url = "https://j3e.de/ispell/igerman98/dict/igerman98-${version}.tar.bz2";
sha256 = "1a3055hp2bc4q4nlg3gmg0147p3a1zlfnc65xiv2v9pyql1nya8p";
};
buildInputs = [ ispell perl hunspell ];
phases = ["unpackPhase" "installPhase"];
installPhase = ''
patchShebangs bin
make hunspell/${dictFileName}.aff hunspell/${dictFileName}.dic
# hunspell dicts
install -dm755 "$out/share/hunspell"
install -m644 hunspell/${dictFileName}.dic "$out/share/hunspell/"
install -m644 hunspell/${dictFileName}.aff "$out/share/hunspell/"
# myspell dicts symlinks
install -dm755 "$out/share/myspell/dicts"
ln -sv "$out/share/hunspell/${dictFileName}.dic" "$out/share/myspell/dicts/"
ln -sv "$out/share/hunspell/${dictFileName}.aff" "$out/share/myspell/dicts/"
'';
meta = with stdenv.lib; {
homepage = https://www.j3e.de/ispell/igerman98/index_en.html;
description = shortDescription;
license = with licenses; [ gpl2 gpl3 ];
maintainers = with maintainers; [ timor ];
platforms = platforms.all;
};
};
in {
/* ENGLISH */
@ -427,4 +463,24 @@ in {
})
];
};
/* GERMAN */
de-de = mkDictFromJ3e {
shortName = "de-de";
shortDescription = "German (Germany)";
dictFileName = "de_DE";
};
de-at = mkDictFromJ3e {
shortName = "de-at";
shortDescription = "German (Austria)";
dictFileName = "de_AT";
};
de-ch = mkDictFromJ3e {
shortName = "de-ch";
shortDescription = "German (Switzerland)";
dictFileName = "de_CH";
};
}