summary refs log tree commit diff
path: root/pkgs/development/libraries/hunspell/dictionaries.nix
diff options
context:
space:
mode:
authorUnai Zalakain <unai@gisa-elkartea.org>2017-05-20 20:10:23 +0200
committerUnai Zalakain <unai@gisa-elkartea.org>2017-05-20 20:10:23 +0200
commit337687c3180bff857874db00b5883f295c9c72da (patch)
tree1aa6de13e48c5c988f3765cd4db5a463b0196554 /pkgs/development/libraries/hunspell/dictionaries.nix
parente000fb05dba84ea28dc3edaa3ad664b4a2500f29 (diff)
downloadnixpkgs-337687c3180bff857874db00b5883f295c9c72da.tar
nixpkgs-337687c3180bff857874db00b5883f295c9c72da.tar.gz
nixpkgs-337687c3180bff857874db00b5883f295c9c72da.tar.bz2
nixpkgs-337687c3180bff857874db00b5883f295c9c72da.tar.lz
nixpkgs-337687c3180bff857874db00b5883f295c9c72da.tar.xz
nixpkgs-337687c3180bff857874db00b5883f295c9c72da.tar.zst
nixpkgs-337687c3180bff857874db00b5883f295c9c72da.zip
hunskell: add basque dictionary Xuxen 5
mkDict doesn't easily adapt to dictionaries that have multiple source
files but no readme, so I did not use it. Having a "generic" function
that then has per-language quirks is a bad abstraction.

A small utility function that copies a given file to hunspell's and
myspell's dirs and a separate one that copies a given readme file would
be more useful.
Diffstat (limited to 'pkgs/development/libraries/hunspell/dictionaries.nix')
-rw-r--r--pkgs/development/libraries/hunspell/dictionaries.nix65
1 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/development/libraries/hunspell/dictionaries.nix b/pkgs/development/libraries/hunspell/dictionaries.nix
index e5cb99aa44a..0d21649a9b1 100644
--- a/pkgs/development/libraries/hunspell/dictionaries.nix
+++ b/pkgs/development/libraries/hunspell/dictionaries.nix
@@ -92,6 +92,39 @@ let
       };
     };
 
+  mkDictFromXuxen =
+    { shortName, srcs, shortDescription, longDescription, dictFileName }:
+    stdenv.mkDerivation rec {
+      name = "hunspell-dict-${shortName}-xuxen-${version}";
+      version = "5-2015.11.10";
+
+      inherit srcs;
+
+      phases = ["unpackPhase" "installPhase"];
+      sourceRoot = ".";
+      # Copy files stripping until first dash (path and hash)
+      unpackCmd = "cp $curSrc \${curSrc##*-}";
+      installPhase = ''
+        # hunspell dicts
+        install -dm755 "$out/share/hunspell"
+        install -m644 ${dictFileName}.dic "$out/share/hunspell/"
+        install -m644 ${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 = http://xuxen.eus/;
+        description = shortDescription;
+        longDescription = longDescription;
+        license = licenses.gpl2;
+        maintainers = with maintainers; [ zalakain ];
+        platforms = platforms.all;
+      };
+    };
+
 in {
 
   /* ENGLISH */
@@ -191,4 +224,36 @@ in {
       sha256 = "0m9frz75fx456bczknay5i446gdcp1smm48lc0qfwzhz0j3zcdrd";
     };
   };
+
+  /* BASQUE */
+
+  eu-es = mkDictFromXuxen {
+    shortName = "eu-es";
+    dictFileName = "eu_ES";
+    shortDescription = "Basque (Xuxen 5)";
+    longDescription = ''
+      Itxura berritzeaz gain, testuak zuzentzen laguntzeko zenbait hobekuntza
+      egin dira Xuxen.eus-en. Lexikoari dagokionez, 18645 sarrera berri erantsi
+      ditugu, eta proposamenak egiteko sistema ere aldatu dugu. Esate baterako,
+      gaizki idatzitako hitz baten inguruko proposamenak eskuratzeko, euskaraz
+      idaztean egiten ditugun akats arruntenak hartu dira kontuan. Sistemak
+      ematen dituen proposamenak ordenatzeko, berriz, aipatutako irizpidea
+      erabiltzeaz gain, Internetetik automatikoki eskuratutako euskarazko corpus
+      bateko datuen arabera ordenatu daitezke emaitzak. Erabiltzaileak horrela
+      ordenatu nahi baditu proposamenak, hautatu egin behar du aukera hori
+      testu-kutxaren azpian dituen aukeren artean. Interesgarria da proposamenak
+      ordenatzeko irizpide hori, hala sistemak formarik erabilienak proposatuko
+      baitizkigu gutxiago erabiltzen direnen aurretik.
+    '';
+    srcs = [
+      (fetchurl {
+        url = "http://xuxen.eus/static/hunspell/eu_ES.aff";
+        sha256 = "12w2j6phzas2rdzc7f20jnk93sm59m2zzfdgxv6p8nvcvbrkmc02";
+      })
+      (fetchurl {
+        url = "http://xuxen.eus/static/hunspell/eu_ES.dic";
+        sha256 = "0lw193jr7ldvln5x5z9p21rz1by46h0say9whfcw2kxs9vprd5b3";
+      })
+    ];
+  };
 }