about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/mo/mokuro/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/mo/mokuro/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/mo/mokuro/package.nix61
1 files changed, 61 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/mo/mokuro/package.nix b/nixpkgs/pkgs/by-name/mo/mokuro/package.nix
new file mode 100644
index 000000000000..95054f371480
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/mo/mokuro/package.nix
@@ -0,0 +1,61 @@
+{
+  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'
+  '';
+
+  nativeBuildInputs = with python3Packages; [ pythonRelaxDepsHook ];
+
+  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 ];
+  };
+}