@@ -13,10 +13,24 @@
1313, gettext
1414, gobject-introspection
1515, gdk-pixbuf
16+, texlive
17+, imagemagick
18+, perlPackages
1619}:
1720
21+let
22+ documentation_deps = [
23+ (texlive.combine {
24+ inherit (texlive) scheme-small wrapfig was;
25+ })
26+ xvfb-run
27+ imagemagick
28+ perlPackages.Po4a
29+ ];
30+in
31+
1832python3Packages.buildPythonApplication rec {
19− inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
33+ inherit (import ./src.nix { inherit fetchFromGitLab; }) version src sample_documents;
2034 pname = "paperwork";
2135
2236 sourceRoot = "source/paperwork-gtk";
@@ -52,9 +66,16 @@ python3Packages.buildPythonApplication rec {
5266 for i in $site/data/paperwork_*.png; do
5367 ln -s $i $site/icon/out;
5468 done
69+
70+ export XDG_DATA_DIRS=$XDG_DATA_DIRS:${gnome.adwaita-icon-theme}/share
71+ # build the user manual
72+ PATH=$out/bin:$PATH PAPERWORK_TEST_DOCUMENTS=${sample_documents} make data
73+ for i in src/paperwork_gtk/model/help/out/*.pdf; do
74+ install -Dt $site/model/help/out $i
75+ done
5576 '';
5677
57− checkInputs = [ xvfb-run dbus.daemon ];
78+ checkInputs = [ dbus.daemon ];
5879
5980 nativeBuildInputs = [
6081 wrapGAppsHook
@@ -62,7 +83,7 @@ python3Packages.buildPythonApplication rec {
6283 (lib.getBin gettext)
6384 which
6485 gdk-pixbuf # for the setup hook
65− ];
86+ ] ++ documentation_deps;
6687
6788 buildInputs = [
6889 gnome.adwaita-icon-theme
@@ -78,13 +99,20 @@ python3Packages.buildPythonApplication rec {
7899 makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
79100 '';
80101
81− # A few parts of chkdeps need to have a display and a dbus session, so we not
82− # only need to run a virtual X server + dbus but also have a large enough
83− # resolution, because the Cairo test tries to draw a 200x200 window.
84− preCheck = ''
102+ checkPhase = ''
103+ runHook preCheck
104+
105+ # A few parts of chkdeps need to have a display and a dbus session, so we not
106+ # only need to run a virtual X server + dbus but also have a large enough
107+ # resolution, because the Cairo test tries to draw a 200x200 window.
85108 xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
86109 --config-file=${dbus.daemon}/share/dbus-1/session.conf \
87110 $out/bin/paperwork-gtk chkdeps
111+
112+ # content of make test, without the dep on make install
113+ python -m unittest discover --verbose -s tests
114+
115+ runHook postCheck
88116 '';
89117
90118 propagatedBuildInputs = with python3Packages; [
@@ -98,6 +126,8 @@ python3Packages.buildPythonApplication rec {
98126 setuptools
99127 ];
100128
129+ disallowedRequisites = documentation_deps;
130+
101131 meta = {
102132 description = "A personal document manager for scanned documents";
103133 homepage = "https://openpaper.work/";