Merge pull request #62780 from abbradar/mystem

Add mystem package
This commit is contained in:
Nikolay Amiantov 2019-06-06 21:36:31 +03:00 committed by GitHub
commit 718a937118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,26 @@
{stdenv, fetchurl }:
stdenv.mkDerivation rec {
name = "mystem-${version}";
version = "3.1";
src = fetchurl {
url = "http://download.cdn.yandex.net/mystem/${name}-linux-64bit.tar.gz";
sha256 = "0q3vxvyj5bqllqnlivy5llss39z7j0bgpn6kv8mrc54vjdhppx10";
};
buildCommand = ''
tar -xaf "$src"
mkdir -p $out/bin
install -Dm755 mystem $out/bin/mystem
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) $out/bin/mystem
'';
meta = with stdenv.lib; {
description = "Morphological analysis of Russian text";
homepage = https://yandex.ru/dev/mystem/;
license = licenses.unfreeRedistributable;
maintainers = with maintainers; [ abbradar ];
platforms = [ "x86_64-linux" ];
};
}

View File

@ -0,0 +1,33 @@
{ lib
, fetchPypi
, buildPythonPackage
, requests
, flake8
, mock
, pytest
, mystem
}:
buildPythonPackage rec {
pname = "pymystem3";
version = "0.2.0";
src = fetchPypi {
inherit pname version;
sha256 = "15gv78m17g958gfka6rr3rg230g6b5ssgk8bfpsp7k2iajhxdbhs";
};
propagatedBuildInputs = [ requests ];
checkInputs = [ flake8 mock pytest ];
postPatch = ''
sed -i 's#^_mystem_info = .*#_mystem_info = ["${mystem}/bin", "${mystem}/bin/mystem"]#' pymystem3/constants.py
'';
meta = with lib; {
description = "Python wrapper for the Yandex MyStem 3.1 morpholocial analyzer of the Russian language";
homepage = https://github.com/nlpub/pymystem3;
license = licenses.mit;
maintainers = with maintainers; [ abbradar ];
};
}

View File

@ -19294,6 +19294,8 @@ in
mupdf = callPackage ../applications/misc/mupdf { };
mystem = callPackage ../applications/misc/mystem { };
diffpdf = libsForQt5.callPackage ../applications/misc/diffpdf { };
diff-pdf = callPackage ../applications/misc/diff-pdf { wxGTK = wxGTK31; };

View File

@ -637,6 +637,8 @@ in {
pure-python-adb-homeassistant = callPackage ../development/python-modules/pure-python-adb-homeassistant { };
pymystem3 = callPackage ../development/python-modules/pymystem3 { };
pymysql = callPackage ../development/python-modules/pymysql { };
Pmw = callPackage ../development/python-modules/Pmw { };