Merge pull request #257480 from paveloom/mecab

mecab: add support for the UTF-8 charset + refactor
This commit is contained in:
Matthieu Coudron 2023-09-27 00:49:48 +02:00 committed by GitHub
commit 0dd3452970
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 36 deletions

View File

@ -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;
}

View File

@ -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 ];
};
}))

View File

@ -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"}"
];
})

View File

@ -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";
}))