summary refs log tree commit diff
path: root/pkgs/applications/office/paperwork/paperwork-backend.nix
blob: 9e20873adbb4e36b6008cd0fc3a1592e360b15fa (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{ buildPythonPackage
, lib
, fetchFromGitLab
, pyenchant
, scikit-learn
, pypillowfight
, pycountry
, whoosh
, termcolor
, python-Levenshtein
, pygobject3
, pyocr
, natsort
, libinsane
, distro
, openpaperwork-core
, openpaperwork-gtk
, psutil
, gtk3
, poppler_gi
, gettext
, which
, shared-mime-info
, libreoffice
, unittestCheckHook
}:

buildPythonPackage rec {
  pname = "paperwork-backend";
  inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;

  sourceRoot = "source/paperwork-backend";

  patchPhase = ''
    echo 'version = "${version}"' > src/paperwork_backend/_version.py
    chmod a+w -R ..
    patchShebangs ../tools
  '';

  propagatedBuildInputs = [
    distro
    gtk3
    libinsane
    natsort
    openpaperwork-core
    pyenchant
    pycountry
    pygobject3
    pyocr
    pypillowfight
    python-Levenshtein
    poppler_gi
    scikit-learn
    termcolor
    whoosh
  ];

  nativeBuildInputs = [
    gettext
    shared-mime-info
    which
  ];

  preBuild = ''
    make l10n_compile
  '';

  checkInputs = [
    libreoffice
    openpaperwork-gtk
    psutil
    unittestCheckHook
  ];

  preCheck = ''
    export HOME=$TMPDIR
  '';

  meta = with lib; {
    description = "Backend part of Paperwork (Python API, no UI)";
    homepage = "https://openpaper.work";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ aszlig symphorien ];
  };
}