about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/text/mecab
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/text/mecab')
-rw-r--r--nixpkgs/pkgs/tools/text/mecab/base.nix23
-rw-r--r--nixpkgs/pkgs/tools/text/mecab/default.nix28
-rw-r--r--nixpkgs/pkgs/tools/text/mecab/ipadic.nix15
-rw-r--r--nixpkgs/pkgs/tools/text/mecab/nodic.nix7
4 files changed, 37 insertions, 36 deletions
diff --git a/nixpkgs/pkgs/tools/text/mecab/base.nix b/nixpkgs/pkgs/tools/text/mecab/base.nix
index 181eb405cbd7..d52d4e907730 100644
--- a/nixpkgs/pkgs/tools/text/mecab/base.nix
+++ b/nixpkgs/pkgs/tools/text/mecab/base.nix
@@ -1,16 +1,17 @@
 { fetchurl }:
 
-{
-    version = "0.996";
+finalAttrs: {
+  version = "0.996";
 
-    src = fetchurl {
-      url = "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7cENtOXlicTFaRUE";
-      name = "mecab-0.996.tar.gz";
-      sha256 = "0ncwlqxl1hdn1x4v4kr2sn1sbbcgnhdphp0lcvk74nqkhdbk4wz0";
-    };
+  src = fetchurl {
+    url = "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7cENtOXlicTFaRUE";
+    name = "mecab-${finalAttrs.version}.tar.gz";
+    hash = "sha256-4HMyV4MTW3LmZhRceBu0j62lg9UiT7JJD7bBQDumnFk=";
+  };
 
-    buildPhase = ''
-      make
-      make check
-    '';
+  configureFlags = [
+    "--with-charset=utf8"
+  ];
+
+  doCheck = true;
 }
diff --git a/nixpkgs/pkgs/tools/text/mecab/default.nix b/nixpkgs/pkgs/tools/text/mecab/default.nix
index 04293d29efb2..58396d2aa462 100644
--- a/nixpkgs/pkgs/tools/text/mecab/default.nix
+++ b/nixpkgs/pkgs/tools/text/mecab/default.nix
@@ -3,19 +3,19 @@
 let
   mecab-base = import ./base.nix { inherit fetchurl; };
 in
-stdenv.mkDerivation (mecab-base // {
-    pname = "mecab";
-    version = mecab-base.version;
+stdenv.mkDerivation (finalAttrs: ((mecab-base finalAttrs) // {
+  pname = "mecab";
 
-    postInstall = ''
-      sed -i 's|^dicdir = .*$|dicdir = ${mecab-ipadic}|' "$out/etc/mecabrc"
-    '';
+  postInstall = ''
+    sed -i 's|^dicdir = .*$|dicdir = ${mecab-ipadic}|' "$out/etc/mecabrc"
+  '';
 
-    meta = with lib; {
-      description = "Japanese morphological analysis system";
-      homepage = "http://taku910.github.io/mecab/";
-      license = licenses.bsd3;
-      platforms = platforms.unix;
-      maintainers = with maintainers; [ auntie ];
-    };
-})
+  meta = with lib; {
+    description = "Japanese morphological analysis system";
+    homepage = "http://taku910.github.io/mecab";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    mainProgram = "mecab";
+    maintainers = with maintainers; [ auntie paveloom ];
+  };
+}))
diff --git a/nixpkgs/pkgs/tools/text/mecab/ipadic.nix b/nixpkgs/pkgs/tools/text/mecab/ipadic.nix
index 026e385e7c2b..61d23f87a8ce 100644
--- a/nixpkgs/pkgs/tools/text/mecab/ipadic.nix
+++ b/nixpkgs/pkgs/tools/text/mecab/ipadic.nix
@@ -1,18 +1,19 @@
 { stdenv, fetchurl, mecab-nodic }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation (finalAttrs: {
   pname = "mecab-ipadic";
   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";
+    name = "mecab-ipadic-${finalAttrs.version}.tar.gz";
+    hash = "sha256-ti9SfYgcUEV2uu2cbvZWFVRlixdc5q4AlqYDB+SeNSM=";
   };
 
   buildInputs = [ mecab-nodic ];
 
-  configurePhase = ''
-    ./configure --with-dicdir="$out"
-  '';
-}
+  configureFlags = [
+    "--with-charset=utf8"
+    "--with-dicdir=${placeholder "out"}"
+  ];
+})
diff --git a/nixpkgs/pkgs/tools/text/mecab/nodic.nix b/nixpkgs/pkgs/tools/text/mecab/nodic.nix
index be9003623e05..5e33b09db145 100644
--- a/nixpkgs/pkgs/tools/text/mecab/nodic.nix
+++ b/nixpkgs/pkgs/tools/text/mecab/nodic.nix
@@ -3,7 +3,6 @@
 let
   mecab-base = import ./base.nix { inherit fetchurl; };
 in
-stdenv.mkDerivation (mecab-base // {
-    pname = "mecab-nodic";
-    version = mecab-base.version;
-})
+stdenv.mkDerivation (finalAttrs: ((mecab-base finalAttrs) // {
+  pname = "mecab-nodic";
+}))