diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/tools/text/mecab/base.nix | 23 | ||||
-rw-r--r-- | pkgs/tools/text/mecab/default.nix | 28 | ||||
-rw-r--r-- | pkgs/tools/text/mecab/ipadic.nix | 15 | ||||
-rw-r--r-- | pkgs/tools/text/mecab/nodic.nix | 7 |
4 files changed, 37 insertions, 36 deletions
diff --git a/pkgs/tools/text/mecab/base.nix b/pkgs/tools/text/mecab/base.nix index 181eb405cbd..d52d4e90773 100644 --- a/pkgs/tools/text/mecab/base.nix +++ b/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/pkgs/tools/text/mecab/default.nix b/pkgs/tools/text/mecab/default.nix index 04293d29efb..58396d2aa46 100644 --- a/pkgs/tools/text/mecab/default.nix +++ b/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/pkgs/tools/text/mecab/ipadic.nix b/pkgs/tools/text/mecab/ipadic.nix index 026e385e7c2..61d23f87a8c 100644 --- a/pkgs/tools/text/mecab/ipadic.nix +++ b/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/pkgs/tools/text/mecab/nodic.nix b/pkgs/tools/text/mecab/nodic.nix index be9003623e0..5e33b09db14 100644 --- a/pkgs/tools/text/mecab/nodic.nix +++ b/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"; +})) |