summary refs log tree commit diff
path: root/pkgs/development/libraries/hunspell
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2018-09-21 21:28:45 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2019-05-23 15:53:50 +0200
commita9d67d54b03e76e19236f9ed45da51a219c35feb (patch)
tree77ef915ed41e73b4e198f0cff48b04a75b3401c5 /pkgs/development/libraries/hunspell
parentde9c022ba0474b1e92fd21ca7728d97044e8e8b2 (diff)
downloadnixpkgs-a9d67d54b03e76e19236f9ed45da51a219c35feb.tar
nixpkgs-a9d67d54b03e76e19236f9ed45da51a219c35feb.tar.gz
nixpkgs-a9d67d54b03e76e19236f9ed45da51a219c35feb.tar.bz2
nixpkgs-a9d67d54b03e76e19236f9ed45da51a219c35feb.tar.lz
nixpkgs-a9d67d54b03e76e19236f9ed45da51a219c35feb.tar.xz
nixpkgs-a9d67d54b03e76e19236f9ed45da51a219c35feb.tar.zst
nixpkgs-a9d67d54b03e76e19236f9ed45da51a219c35feb.zip
hunspellDicts.fr-any: link fr-moderne to fr_FR
Some packages like `ibus-engines.typing-booster` require the dictionary
`fr_FR.dic` to provide proper support for the french language.

Until now the hunspell package set of nixpkgs didn't provide this
dictionary. It has been recommended to use `fr-moderne` as base and link
`fr_FR.dic` from it as done by other distros such as ArchLinux.

See https://github.com/NixOS/nixpkgs/issues/46940#issuecomment-423684570

Fixes #46940
Diffstat (limited to 'pkgs/development/libraries/hunspell')
-rw-r--r--pkgs/development/libraries/hunspell/dictionaries.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/development/libraries/hunspell/dictionaries.nix b/pkgs/development/libraries/hunspell/dictionaries.nix
index 08ef667b24e..b8de133f502 100644
--- a/pkgs/development/libraries/hunspell/dictionaries.nix
+++ b/pkgs/development/libraries/hunspell/dictionaries.nix
@@ -20,6 +20,7 @@ let
       # docs
       install -dm755 "$out/share/doc"
       install -m644 ${readmeFile} $out/share/doc/${name}.txt
+      runHook postInstall
     '';
   } // args);
 
@@ -107,7 +108,7 @@ let
     };
 
   mkDictFromDicollecte =
-    { shortName, shortDescription, longDescription, dictFileName }:
+    { shortName, shortDescription, longDescription, dictFileName, isDefault ? false }:
     mkDict rec {
       inherit dictFileName;
       version = "5.3";
@@ -131,6 +132,12 @@ let
       unpackCmd = ''
         unzip $src ${dictFileName}.dic ${dictFileName}.aff ${readmeFile}
       '';
+      postInstall = stdenv.lib.optionalString isDefault ''
+        for ext in aff dic; do
+          ln -sv $out/share/hunspell/${dictFileName}.$ext $out/share/hunspell/fr_FR.$ext
+          ln -sv $out/share/myspell/dicts/${dictFileName}.$ext $out/share/myspell/dicts/fr_FR.$ext
+        done
+      '';
     };
 
   mkDictFromWordlist =
@@ -483,6 +490,7 @@ in {
       réformées, suivant la lente évolution de l’orthographe actuelle. Ce
       dictionnaire contient les graphies les moins polémiques de la réforme.
     '';
+    isDefault = true;
   };
 
   fr-reforme1990 = mkDictFromDicollecte {