opentabletdriver: 0.6.5.0 -> 0.6.5.1 (#379384)
[NixPkgs.git] / pkgs / by-name / vo / voicevox-engine / pyopenjtalk.nix
blob01ef7ec6ee8400d4dbe9788129c209e0fc15944a
2   lib,
3   python,
4   buildPythonPackage,
5   fetchFromGitHub,
6   fetchzip,
7   setuptools,
8   cython_0,
9   cmake,
10   numpy,
11   oldest-supported-numpy,
12   six,
13   tqdm,
16 let
17   dic-dirname = "open_jtalk_dic_utf_8-1.11";
18   dic-src = fetchzip {
19     url = "https://github.com/r9y9/open_jtalk/releases/download/v1.11.1/${dic-dirname}.tar.gz";
20     hash = "sha256-+6cHKujNEzmJbpN9Uan6kZKsPdwxRRzT3ZazDnCNi3s=";
21   };
23 buildPythonPackage {
24   pname = "pyopenjtalk";
25   version = "0-unstable-2023-09-08";
26   pyproject = true;
28   src = fetchFromGitHub {
29     owner = "VOICEVOX";
30     repo = "pyopenjtalk";
31     rev = "b35fc89fe42948a28e33aed886ea145a51113f88";
32     hash = "sha256-DbZkCMdirI6wSRUQSJrkojyjGmViqGeQPO0kSKiw2gE=";
33     fetchSubmodules = true;
34   };
36   patches = [
37     # this patch fixes the darwin build
38     # open_jtalk uses mecab, which uses the register keyword and std::binary_function, which are not allowed in c++17
39     # this patch removes them
40     ./mecab-remove-deprecated.patch
41   ];
43   postPatch = ''
44     substituteInPlace pyproject.toml \
45         --replace-fail 'setuptools<v60.0' 'setuptools'
46   '';
48   build-system = [
49     setuptools
50     cython_0
51     cmake
52     numpy
53     oldest-supported-numpy
54   ];
56   dontUseCmakeConfigure = true;
58   dependencies = [
59     setuptools # imports pkg_resources at runtime
60     numpy
61     six
62     tqdm
63   ];
65   postInstall = ''
66     ln -s ${dic-src} $out/${python.sitePackages}/pyopenjtalk/${dic-dirname}
67   '';
69   meta = {
70     description = "VOICEVOX's fork of the pyopenjtalk text-to-speech library";
71     homepage = "https://github.com/VOICEVOX/pyopenjtalk";
72     license = lib.licenses.mit;
73     maintainers = with lib.maintainers; [ tomasajt ];
74   };