diff options
author | Jonathan Glines <auntieNeo@gmail.com> | 2016-06-26 14:47:23 -0600 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2016-06-26 22:47:23 +0200 |
commit | 8199cda762760b6601d5a5c87a7b7debc3ba3e59 (patch) | |
tree | 143e3fc1d709fe00b0a1a24bc8ea533b61b4c4b8 /pkgs/tools/text/mecab | |
parent | 3832ebde8b32b8e2c5929ea955a98a17c43e2cd0 (diff) |
mecab: init at 0.996 (#16175)
Japanese morphological analysis system, used by Anki in particular
Diffstat (limited to 'pkgs/tools/text/mecab')
-rw-r--r-- | pkgs/tools/text/mecab/base.nix | 16 | ||||
-rw-r--r-- | pkgs/tools/text/mecab/default.nix | 20 | ||||
-rw-r--r-- | pkgs/tools/text/mecab/ipadic.nix | 18 | ||||
-rw-r--r-- | pkgs/tools/text/mecab/nodic.nix | 8 |
4 files changed, 62 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}"; +}) |