mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
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:
parent
379317a778
commit
76a01ad9d1
@ -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";
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user