14 , gobject-introspection
23 documentation_deps = [
24 (texliveSmall.withPackages (ps: with ps; [ wrapfig gensymb ]))
29 inherit (import ./src.nix { inherit fetchFromGitLab; }) version src sample_documents;
32 python3Packages.buildPythonApplication rec {
37 sample_docs = sample_documents // {
38 # a trick for the update script
39 name = "sample_documents";
40 src = sample_documents;
43 sourceRoot = "${src.name}/paperwork-gtk";
47 patchShebangs ../tools
49 export HOME=$(mktemp -d)
57 # paperwork-shell needs to be re-wrapped with access to paperwork
58 for exe in paperwork-cli paperwork-json; do
59 cp ${python3Packages.paperwork-shell}/bin/.$exe-wrapped $out/bin/$exe
61 # install desktop files and icons
62 XDG_DATA_HOME=$out/share $out/bin/paperwork-gtk install --user
64 # fixes [WARNING] [openpaperwork_core.resources.setuptools] Failed to find
65 # resource file paperwork_gtk.icon.out/paperwork_128.png, tried at path
66 # /nix/store/3n5lz6y8k9yks76f0nar3smc8djan3xr-paperwork-2.0.2/lib/python3.8/site-packages/paperwork_gtk/icon/out/paperwork_128.png.
67 site=$out/${python3Packages.python.sitePackages}/paperwork_gtk
68 for i in $site/data/paperwork_*.png; do
69 ln -s $i $site/icon/out;
72 export XDG_DATA_DIRS=$XDG_DATA_DIRS:${adwaita-icon-theme}/share
73 # build the user manual
74 PATH=$out/bin:$PATH PAPERWORK_TEST_DOCUMENTS=${sample_docs} make data
75 for i in src/paperwork_gtk/model/help/out/*.pdf; do
76 install -Dt $site/model/help/out $i
80 nativeCheckInputs = [ dbus ];
85 python3Packages.setuptools-scm
88 gdk-pixbuf # for the setup hook
89 ] ++ documentation_deps;
102 makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
108 # A few parts of chkdeps need to have a display and a dbus session, so we not
109 # only need to run a virtual X server + dbus but also have a large enough
110 # resolution, because the Cairo test tries to draw a 200x200 window.
111 xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
112 --config-file=${dbus}/share/dbus-1/session.conf \
113 $out/bin/paperwork-gtk chkdeps
115 $out/bin/paperwork-cli chkdeps
116 $out/bin/paperwork-json chkdeps
118 # content of make test, without the dep on make install
119 python -m unittest discover --verbose -s tests
124 propagatedBuildInputs = with python3Packages; [
134 disallowedRequisites = documentation_deps;
136 passthru.updateScript = writeScript "update.sh" ''
137 #!/usr/bin/env nix-shell
138 #!nix-shell -i bash -p curl common-updater-scripts
139 version=$(list-git-tags | sed 's/^v//' | sort -V | tail -n1)
140 update-source-version paperwork "$version" --file=pkgs/applications/office/paperwork/src.nix
141 docs_version="$(curl https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/raw/$version/paperwork-gtk/src/paperwork_gtk/model/help/screenshot.sh | grep TEST_DOCS_TAG= | cut -d'"' -f2)"
142 update-source-version paperwork.sample_docs "$docs_version" --file=pkgs/applications/office/paperwork/src.nix --version-key=rev
146 description = "Personal document manager for scanned documents";
147 homepage = "https://openpaper.work/";
148 license = lib.licenses.gpl3Plus;
149 maintainers = with lib.maintainers; [ aszlig symphorien ];
150 platforms = lib.platforms.linux;