Merge pull request #148582 from toastal/hunspell-th-th

Hunspell support for Central Thai (th-TH)

authored by Marek Fajkus and committed by GitHub 4b3a70e4 d4d8d9cb

+53 -28
+53 -28
pkgs/development/libraries/hunspell/dictionaries.nix
··· 5 5 6 6 let 7 7 mkDict = 8 - { pname, readmeFile, dictFileName, ... }@args: 9 - stdenv.mkDerivation ({ 10 - inherit pname; 11 - installPhase = '' 12 - runHook preInstall 13 - # hunspell dicts 14 - install -dm755 "$out/share/hunspell" 15 - install -m644 ${dictFileName}.dic "$out/share/hunspell/" 16 - install -m644 ${dictFileName}.aff "$out/share/hunspell/" 17 - # myspell dicts symlinks 18 - install -dm755 "$out/share/myspell/dicts" 19 - ln -sv "$out/share/hunspell/${dictFileName}.dic" "$out/share/myspell/dicts/" 20 - ln -sv "$out/share/hunspell/${dictFileName}.aff" "$out/share/myspell/dicts/" 21 - # docs 22 - install -dm755 "$out/share/doc" 23 - install -m644 ${readmeFile} $out/share/doc/${pname}.txt 24 - runHook postInstall 25 - ''; 26 - } // args); 8 + { pname, readmeFile, dictFileName, ... }@args: 9 + stdenv.mkDerivation ({ 10 + inherit pname; 11 + installPhase = '' 12 + runHook preInstall 13 + # hunspell dicts 14 + install -dm755 "$out/share/hunspell" 15 + install -m644 ${dictFileName}.dic "$out/share/hunspell/" 16 + install -m644 ${dictFileName}.aff "$out/share/hunspell/" 17 + # myspell dicts symlinks 18 + install -dm755 "$out/share/myspell/dicts" 19 + ln -sv "$out/share/hunspell/${dictFileName}.dic" "$out/share/myspell/dicts/" 20 + ln -sv "$out/share/hunspell/${dictFileName}.aff" "$out/share/myspell/dicts/" 21 + # docs 22 + install -dm755 "$out/share/doc" 23 + install -m644 ${readmeFile} $out/share/doc/${pname}.txt 24 + runHook postInstall 25 + ''; 26 + } // args); 27 27 28 28 mkDictFromRla = 29 29 { shortName, shortDescription, dictFileName }: ··· 79 79 }; 80 80 meta = with lib; { 81 81 longDescription = '' 82 - Svensk ordlista baserad på DSSO (den stora svenska ordlistan) och Göran 83 - Anderssons (goran@init.se) arbete med denna. Ordlistan hämtas från 84 - LibreOffice då dsso.se inte längre verkar vara med oss. 82 + Svensk ordlista baserad på DSSO (den stora svenska ordlistan) och Göran 83 + Anderssons (goran@init.se) arbete med denna. Ordlistan hämtas från 84 + LibreOffice då dsso.se inte längre verkar vara med oss. 85 85 ''; 86 86 description = "Hunspell dictionary for ${shortDescription} from LibreOffice"; 87 87 license = licenses.lgpl3; ··· 90 90 nativeBuildInputs = [ unzip ]; 91 91 sourceRoot = "."; 92 92 unpackCmd = '' 93 - unzip $src dictionaries/${dictFileName}.dic dictionaries/${dictFileName}.aff $readmeFile 93 + unzip $src dictionaries/${dictFileName}.dic dictionaries/${dictFileName}.aff $readmeFile 94 94 ''; 95 95 installPhase = '' 96 96 # hunspell dicts ··· 115 115 pname = "hunspell-dict-${shortName}-dicollecte"; 116 116 readmeFile = "README_dict_fr.txt"; 117 117 src = fetchurl { 118 - url = "http://www.dicollecte.org/download/fr/hunspell-french-dictionaries-v${version}.zip"; 119 - sha256 = "0ca7084jm7zb1ikwzh1frvpb97jn27i7a5d48288h2qlfp068ik0"; 118 + url = "http://www.dicollecte.org/download/fr/hunspell-french-dictionaries-v${version}.zip"; 119 + sha256 = "0ca7084jm7zb1ikwzh1frvpb97jn27i7a5d48288h2qlfp068ik0"; 120 120 }; 121 121 meta = with lib; { 122 122 inherit longDescription; ··· 266 266 , dictFileName 267 267 , license 268 268 , readmeFile ? "README_${dictFileName}.txt" 269 - , sourceRoot ? dictFileName }: 269 + , sourceRoot ? dictFileName 270 + }: 270 271 mkDict rec { 271 272 pname = "hunspell-dict-${shortName}-libreoffice"; 272 273 version = "6.3.0.4"; ··· 289 290 }; 290 291 }; 291 292 292 - in rec { 293 + in 294 + rec { 293 295 294 296 /* ENGLISH */ 295 297 ··· 598 600 /* ITALIAN */ 599 601 600 602 it_IT = it-it; 601 - it-it = mkDictFromLinguistico { 603 + it-it = mkDictFromLinguistico { 602 604 shortName = "it-it"; 603 605 dictFileName = "it_IT"; 604 606 shortDescription = "Hunspell dictionary for 'Italian (Italy)' from Linguistico"; ··· 820 822 shortDescription = "Hebrew (Israel)"; 821 823 readmeFile = "README_he_IL.txt"; 822 824 license = with lib.licenses; [ agpl3Plus ]; 825 + }; 826 + 827 + /* THAI */ 828 + 829 + th_TH = th-th; 830 + th-th = mkDict { 831 + pname = "hunspell-dict-th-th"; 832 + version = "experimental-2021-12-20"; 833 + dictFileName = "th_TH"; 834 + readmeFile = "README.md"; 835 + src = fetchFromGitHub { 836 + owner = "SyafiqHadzir"; 837 + repo = "Hunspell-TH"; 838 + rev = "f119e58e5f6954965d6abd683e7d4c4b9be2684f"; 839 + sha256 = "sha256-hwqKvuLxbtzxfyQ5YhC/sdb3QQwxCfzgDOHeatxDjxM="; 840 + }; 841 + meta = with lib; { 842 + description = "Hunspell dictionary for Central Thai (Thailand)"; 843 + homepage = "https://github.com/SyafiqHadzir/Hunspell-TH"; 844 + license = with licenses; [ gpl3 ]; 845 + maintainers = with maintainers; [ toastal ]; # looking for a native speaker 846 + platforms = platforms.all; 847 + }; 823 848 }; 824 849 }