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.

authored by timor and committed by Robin Gloster 76a01ad9 379317a7

+57 -1
+57 -1
pkgs/development/libraries/hunspell/dictionaries.nix
··· 1 1 /* hunspell dictionaries */ 2 2 3 - { stdenv, fetchurl, fetchFromGitHub, unzip, coreutils, bash, which, zip }: 3 + { stdenv, fetchurl, fetchFromGitHub, unzip, coreutils, bash, which, zip, ispell, perl, hunspell }: 4 4 5 5 6 6 let ··· 164 164 longDescription = longDescription; 165 165 license = licenses.gpl2; 166 166 maintainers = with maintainers; [ zalakain ]; 167 + platforms = platforms.all; 168 + }; 169 + }; 170 + 171 + mkDictFromJ3e = 172 + { shortName, shortDescription, dictFileName }: 173 + stdenv.mkDerivation rec { 174 + name = "hunspell-dict-${shortName}-j3e-${version}"; 175 + version = "20161207"; 176 + 177 + src = fetchurl { 178 + url = "https://j3e.de/ispell/igerman98/dict/igerman98-${version}.tar.bz2"; 179 + sha256 = "1a3055hp2bc4q4nlg3gmg0147p3a1zlfnc65xiv2v9pyql1nya8p"; 180 + }; 181 + 182 + buildInputs = [ ispell perl hunspell ]; 183 + 184 + phases = ["unpackPhase" "installPhase"]; 185 + installPhase = '' 186 + patchShebangs bin 187 + make hunspell/${dictFileName}.aff hunspell/${dictFileName}.dic 188 + # hunspell dicts 189 + install -dm755 "$out/share/hunspell" 190 + install -m644 hunspell/${dictFileName}.dic "$out/share/hunspell/" 191 + install -m644 hunspell/${dictFileName}.aff "$out/share/hunspell/" 192 + # myspell dicts symlinks 193 + install -dm755 "$out/share/myspell/dicts" 194 + ln -sv "$out/share/hunspell/${dictFileName}.dic" "$out/share/myspell/dicts/" 195 + ln -sv "$out/share/hunspell/${dictFileName}.aff" "$out/share/myspell/dicts/" 196 + ''; 197 + 198 + meta = with stdenv.lib; { 199 + homepage = https://www.j3e.de/ispell/igerman98/index_en.html; 200 + description = shortDescription; 201 + license = with licenses; [ gpl2 gpl3 ]; 202 + maintainers = with maintainers; [ timor ]; 167 203 platforms = platforms.all; 168 204 }; 169 205 }; ··· 426 462 sha256 = "0lw193jr7ldvln5x5z9p21rz1by46h0say9whfcw2kxs9vprd5b3"; 427 463 }) 428 464 ]; 465 + }; 466 + 467 + /* GERMAN */ 468 + 469 + de-de = mkDictFromJ3e { 470 + shortName = "de-de"; 471 + shortDescription = "German (Germany)"; 472 + dictFileName = "de_DE"; 473 + }; 474 + 475 + de-at = mkDictFromJ3e { 476 + shortName = "de-at"; 477 + shortDescription = "German (Austria)"; 478 + dictFileName = "de_AT"; 479 + }; 480 + 481 + de-ch = mkDictFromJ3e { 482 + shortName = "de-ch"; 483 + shortDescription = "German (Switzerland)"; 484 + dictFileName = "de_CH"; 429 485 }; 430 486 }