summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJonathan Glines <auntieNeo@gmail.com>2016-06-26 14:47:23 -0600
committerFranz Pletz <fpletz@fnordicwalking.de>2016-06-26 22:47:23 +0200
commit8199cda762760b6601d5a5c87a7b7debc3ba3e59 (patch)
tree143e3fc1d709fe00b0a1a24bc8ea533b61b4c4b8 /pkgs
parent3832ebde8b32b8e2c5929ea955a98a17c43e2cd0 (diff)
downloadnixlib-8199cda762760b6601d5a5c87a7b7debc3ba3e59.tar
nixlib-8199cda762760b6601d5a5c87a7b7debc3ba3e59.tar.gz
nixlib-8199cda762760b6601d5a5c87a7b7debc3ba3e59.tar.bz2
nixlib-8199cda762760b6601d5a5c87a7b7debc3ba3e59.tar.lz
nixlib-8199cda762760b6601d5a5c87a7b7debc3ba3e59.tar.xz
nixlib-8199cda762760b6601d5a5c87a7b7debc3ba3e59.tar.zst
nixlib-8199cda762760b6601d5a5c87a7b7debc3ba3e59.zip
mecab: init at 0.996 (#16175)
Japanese morphological analysis system, used by Anki in particular
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/text/mecab/base.nix16
-rw-r--r--pkgs/tools/text/mecab/default.nix20
-rw-r--r--pkgs/tools/text/mecab/ipadic.nix18
-rw-r--r--pkgs/tools/text/mecab/nodic.nix8
-rw-r--r--pkgs/top-level/all-packages.nix10
5 files changed, 72 insertions, 0 deletions
diff --git a/pkgs/tools/text/mecab/base.nix b/pkgs/tools/text/mecab/base.nix
new file mode 100644
index 000000000000..7509f3e9c483
--- /dev/null
+++ b/pkgs/tools/text/mecab/base.nix
@@ -0,0 +1,16 @@
+{ fetchurl }:
+
+rec {
+    version = "0.996";
+
+    src = fetchurl {
+      url = https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7cENtOXlicTFaRUE;
+      name = "mecab-0.996.tar.gz";
+      sha256 = "0ncwlqxl1hdn1x4v4kr2sn1sbbcgnhdphp0lcvk74nqkhdbk4wz0";
+    };
+
+    buildPhase = ''
+      make
+      make check
+    '';
+}
diff --git a/pkgs/tools/text/mecab/default.nix b/pkgs/tools/text/mecab/default.nix
new file mode 100644
index 000000000000..0b7e7e86df1b
--- /dev/null
+++ b/pkgs/tools/text/mecab/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, mecab-ipadic }:
+
+let
+  mecab-base = import ./base.nix { inherit fetchurl; };
+in
+stdenv.mkDerivation (mecab-base // {
+    name = "mecab-${mecab-base.version}";
+
+    postInstall = ''
+      sed -i 's|^dicdir = .*$|dicdir = ${mecab-ipadic}|' "$out/etc/mecabrc"
+    '';
+
+    meta = with stdenv.lib; {
+      description = "Japanese morphological analysis system";
+      homepage = http://taku910.github.io/mecab/;
+      license = licenses.bsd3;
+      platforms = platforms.unix;
+      maintainers = with maintainers; [ auntie ];
+    };
+})
diff --git a/pkgs/tools/text/mecab/ipadic.nix b/pkgs/tools/text/mecab/ipadic.nix
new file mode 100644
index 000000000000..9896b365a6a2
--- /dev/null
+++ b/pkgs/tools/text/mecab/ipadic.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl, mecab-nodic }:
+
+stdenv.mkDerivation rec {
+  name = "mecab-ipadic-${version}";
+  version = "2.7.0-20070801";
+
+  src = fetchurl {
+    url = https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7MWVlSDBCSXZMTXM;
+    name = "mecab-ipadic-2.7.0-20070801.tar.gz";
+    sha256 = "08rmkvj0f0x6jq0axrjw2y5nam0mavv6x77dp9v4al0wi1ym4bxn";
+  };
+
+  buildInputs = [ mecab-nodic ];
+
+  configurePhase = ''
+    ./configure --with-dicdir="$out"
+  '';
+}
diff --git a/pkgs/tools/text/mecab/nodic.nix b/pkgs/tools/text/mecab/nodic.nix
new file mode 100644
index 000000000000..1cbc31be4ee1
--- /dev/null
+++ b/pkgs/tools/text/mecab/nodic.nix
@@ -0,0 +1,8 @@
+{ stdenv, fetchurl }:
+
+let
+  mecab-base = import ./base.nix { inherit fetchurl; };
+in
+stdenv.mkDerivation (mecab-base // {
+    name = "mecab-nodic-${mecab-base.version}";
+})
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 00f4e0f85db2..df8d3abc7a74 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2426,6 +2426,16 @@ in
 
   mbuffer = callPackage ../tools/misc/mbuffer { };
 
+  mecab =
+    let
+      mecab-nodic = callPackage ../tools/text/mecab/nodic.nix { };
+    in
+    callPackage ../tools/text/mecab {
+      mecab-ipadic = callPackage ../tools/text/mecab/ipadic.nix {
+        inherit mecab-nodic;
+      };
+    };
+
   memtest86 = callPackage ../tools/misc/memtest86 { };
 
   memtest86plus = callPackage ../tools/misc/memtest86+ { };