Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / office / paperwork / paperwork-backend.nix
blob95608b26e2fee583c2e75b1c04088e6e120ff0a4
1 { buildPythonPackage
2 , lib
3 , fetchFromGitLab
4 , pyenchant
5 , scikit-learn
6 , pypillowfight
7 , pycountry
8 , whoosh
9 , termcolor
10 , pygobject3
11 , pyocr
12 , natsort
13 , libinsane
14 , distro
15 , openpaperwork-core
16 , openpaperwork-gtk
17 , psutil
18 , gtk3
19 , poppler_gi
20 , gettext
21 , which
22 , shared-mime-info
23 , libreoffice
24 , unittestCheckHook
25 , setuptools-scm
28 buildPythonPackage rec {
29   pname = "paperwork-backend";
30   inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
31   format = "pyproject";
33   sourceRoot = "${src.name}/paperwork-backend";
35   patches = [
36     # disables a flaky test https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/issues/1035#note_1493700
37     ./flaky_test.patch
38   ];
40   patchFlags = [ "-p2" ];
42   postPatch = ''
43     chmod a+w -R ..
44     patchShebangs ../tools
45   '';
47   env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
49   propagatedBuildInputs = [
50     distro
51     gtk3
52     libinsane
53     natsort
54     openpaperwork-core
55     pyenchant
56     pycountry
57     pygobject3
58     pyocr
59     pypillowfight
60     poppler_gi
61     scikit-learn
62     termcolor
63     whoosh
64   ];
66   nativeBuildInputs = [
67     gettext
68     shared-mime-info
69     which
70     setuptools-scm
71   ];
73   preBuild = ''
74     make l10n_compile
75   '';
77   nativeCheckInputs = [
78     libreoffice
79     openpaperwork-gtk
80     psutil
81     unittestCheckHook
82   ];
84   preCheck = ''
85     export HOME=$TMPDIR
86   '';
88   meta = with lib; {
89     description = "Backend part of Paperwork (Python API, no UI)";
90     homepage = "https://openpaper.work";
91     license = licenses.gpl3Plus;
92     maintainers = with maintainers; [ aszlig symphorien ];
93   };