diff options
author | timor <timor.dd@googlemail.com> | 2018-02-28 14:32:52 +0100 |
---|---|---|
committer | Robin Gloster <mail@glob.in> | 2018-03-01 23:54:04 +0100 |
commit | 76a01ad9d15e798fcf8e55adaa659c389a4c3fdf (patch) | |
tree | 9bd56bdefc1ecf6d4861c97bbf93cbd45037c3c5 | |
parent | 379317a7787acfb8e3dd072968ac8903ec953a24 (diff) | |
download | nixlib-76a01ad9d15e798fcf8e55adaa659c389a4c3fdf.tar nixlib-76a01ad9d15e798fcf8e55adaa659c389a4c3fdf.tar.gz nixlib-76a01ad9d15e798fcf8e55adaa659c389a4c3fdf.tar.bz2 nixlib-76a01ad9d15e798fcf8e55adaa659c389a4c3fdf.tar.lz nixlib-76a01ad9d15e798fcf8e55adaa659c389a4c3fdf.tar.xz nixlib-76a01ad9d15e798fcf8e55adaa659c389a4c3fdf.tar.zst nixlib-76a01ad9d15e798fcf8e55adaa659c389a4c3fdf.zip |
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.
-rw-r--r-- | pkgs/development/libraries/hunspell/dictionaries.nix | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/pkgs/development/libraries/hunspell/dictionaries.nix b/pkgs/development/libraries/hunspell/dictionaries.nix index 37c00f3e2aa8..f30ec1872bae 100644 --- a/pkgs/development/libraries/hunspell/dictionaries.nix +++ b/pkgs/development/libraries/hunspell/dictionaries.nix @@ -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"; + }; } |