summary refs log tree commit diff
path: root/pkgs/applications/graphics/normcap/default.nix
blob: 820ca990339471b78a2c4e1f9b806aaef4c61c88 (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
# From NUR https://github.com/nix-community/nur-combined/blob/6bddae47680482383b5769dd3aa7d82b88e6cbc8/repos/renesat/pkgs/normcap/default.nix

{
  lib,
  stdenv,
  python3,
  fetchFromGitHub,
  tesseract4,
  leptonica,
  wl-clipboard
}:
python3.pkgs.buildPythonApplication rec {
  pname = "normcap";
  version = "0.4.4";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "dynobo";
    repo = "normcap";
    rev = "v${version}";
    hash = "sha256-dShtmoqS9TC3PHuwq24OEOhYfBHGhDCma8Du8QCkFuI=";
  };

  buildInputs = [
    wl-clipboard
  ];

  nativeBuildInputs = with python3.pkgs; [
    poetry-core
  ];

  propagatedBuildInputs = with python3.pkgs; [
    tesseract4
    leptonica
    pyside6

    # Test
    toml
    pytest-qt
  ];

  postPatch = ''
    substituteInPlace pyproject.toml --replace 'PySide6-Essentials = "6.5.1"' ""
  '';

  meta = with lib; {
    description = "OCR powered screen-capture tool to capture information instead of images";
    homepage = "https://dynobo.github.io/normcap/";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ cafkafk ];
  };
}