From a9d67d54b03e76e19236f9ed45da51a219c35feb Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 21 Sep 2018 21:28:45 +0200 Subject: [PATCH 1/2] 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 --- nixos/doc/manual/release-notes/rl-1909.xml | 6 ++++++ pkgs/development/libraries/hunspell/dictionaries.nix | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/nixos/doc/manual/release-notes/rl-1909.xml b/nixos/doc/manual/release-notes/rl-1909.xml index b78c3e08b79..60b4a3bc17b 100644 --- a/nixos/doc/manual/release-notes/rl-1909.xml +++ b/nixos/doc/manual/release-notes/rl-1909.xml @@ -156,6 +156,12 @@ + + + The hunspellDicts.fr-any dictionary now ships with fr_FR.{aff,dic} + which is linked to fr-toutesvariantes.{aff,dic}. + + 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 { From 77d8f5c040db8ebcdd98c0a8af0f534b9bf0c7a4 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 21 Sep 2018 21:37:09 +0200 Subject: [PATCH 2/2] ibus-engines.typing-booster: support french by default This has been postponed[1] because of an unclear state of the french dictionary provided by hunspell[2]. [1] https://github.com/NixOS/nixpkgs/pull/46779#issuecomment-422764601 [2] https://github.com/NixOS/nixpkgs/issues/46940#issuecomment-423288963 --- doc/package-notes.xml | 2 +- .../inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/package-notes.xml b/doc/package-notes.xml index d3cffab3307..29b6b2420b5 100644 --- a/doc/package-notes.xml +++ b/doc/package-notes.xml @@ -494,7 +494,7 @@ stdenv.mkDerivation { The IBus engine is based on hunspell to support completion in many languages. By default the dictionaries - de-de, en-us, + de-de, en-us, fr-moderne es-es, it-it, sv-se and sv-fi are in use. To add another dictionary, the package can be overridden like this: diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix index e6505f3cc46..1115e4e232f 100644 --- a/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix +++ b/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix @@ -1,5 +1,5 @@ { typing-booster, symlinkJoin, hunspellDicts, lib, makeWrapper -, langs ? [ "de-de" "en-us" "es-es" "it-it" "sv-se" "sv-fi" ] +, langs ? [ "de-de" "en-us" "es-es" "fr-moderne" "it-it" "sv-se" "sv-fi" ] }: let