about summary refs log tree commit diff
path: root/pkgs/by-name/mo/mokuro/package.nix
blob: 1fb6ca5443b43c29605427e3ce8cfe5e85030af0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
  lib,
  python3Packages,
  fetchFromGitHub,
}:

python3Packages.buildPythonApplication rec {
  pname = "mokuro";
  version = "0.1.8";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "kha-white";
    repo = "mokuro";
    rev = "v${version}";
    hash = "sha256-w+hhUt2fTl9zrca4xotK5eNhbfragYNC0u5WDwNGb7k=";
    fetchSubmodules = true;
  };

  postPatch = ''
    substituteInPlace setup.py \
        --replace-fail 'opencv-python' 'opencv'
  '';


  pythonRelaxDeps = [ "torchvision" ];

  build-system = with python3Packages; [ setuptools ];

  dependencies = with python3Packages; [
    fire
    loguru
    manga-ocr
    natsort
    numpy
    opencv4
    pillow
    pyclipper
    requests
    scipy
    shapely
    torch
    torchsummary
    torchvision
    transformers
    tqdm
    yattag
  ];

  # tests try to use the network
  doCheck = false;

  meta = {
    description = "Read Japanese manga inside browser with selectable text";
    homepage = "https://github.com/kha-white/mokuro";
    license = lib.licenses.gpl3Only;
    mainProgram = "mokuro";
    maintainers = with lib.maintainers; [ tomasajt ];
  };
}