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";
45 env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
49 patchShebangs ../tools
51 export HOME=$(mktemp -d)
59 # paperwork-shell needs to be re-wrapped with access to paperwork
60 for exe in paperwork-cli paperwork-json; do
61 cp ${python3Packages.paperwork-shell}/bin/.$exe-wrapped $out/bin/$exe
63 # install desktop files and icons
64 XDG_DATA_HOME=$out/share $out/bin/paperwork-gtk install --user
66 # fixes [WARNING] [openpaperwork_core.resources.setuptools] Failed to find
67 # resource file paperwork_gtk.icon.out/paperwork_128.png, tried at path
68 # /nix/store/3n5lz6y8k9yks76f0nar3smc8djan3xr-paperwork-2.0.2/lib/python3.8/site-packages/paperwork_gtk/icon/out/paperwork_128.png.
69 site=$out/lib/${python3Packages.python.libPrefix}/site-packages/paperwork_gtk
70 for i in $site/data/paperwork_*.png; do
71 ln -s $i $site/icon/out;
74 export XDG_DATA_DIRS=$XDG_DATA_DIRS:${gnome.adwaita-icon-theme}/share
75 # build the user manual
76 PATH=$out/bin:$PATH PAPERWORK_TEST_DOCUMENTS=${sample_docs} make data
77 for i in src/paperwork_gtk/model/help/out/*.pdf; do
78 install -Dt $site/model/help/out $i
82 nativeCheckInputs = [ dbus ];
87 python3Packages.setuptools-scm
90 gdk-pixbuf # for the setup hook
91 ] ++ documentation_deps;
94 gnome.adwaita-icon-theme
101 dontWrapGApps = true;
104 makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
110 # A few parts of chkdeps need to have a display and a dbus session, so we not
111 # only need to run a virtual X server + dbus but also have a large enough
112 # resolution, because the Cairo test tries to draw a 200x200 window.
113 xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
114 --config-file=${dbus}/share/dbus-1/session.conf \
115 $out/bin/paperwork-gtk chkdeps
117 $out/bin/paperwork-cli chkdeps
118 $out/bin/paperwork-json chkdeps
120 # content of make test, without the dep on make install
121 python -m unittest discover --verbose -s tests
126 propagatedBuildInputs = with python3Packages; [
136 disallowedRequisites = documentation_deps;
138 passthru.updateScript = writeScript "update.sh" ''
139 #!/usr/bin/env nix-shell
140 #!nix-shell -i bash -p curl common-updater-scripts
141 version=$(list-git-tags | sed 's/^v//' | sort -V | tail -n1)
142 update-source-version paperwork "$version" --file=pkgs/applications/office/paperwork/src.nix
143 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)"
144 update-source-version paperwork.sample_docs "$docs_version" --file=pkgs/applications/office/paperwork/src.nix --version-key=rev
148 description = "A personal document manager for scanned documents";
149 homepage = "https://openpaper.work/";
150 license = lib.licenses.gpl3Plus;
151 maintainers = with lib.maintainers; [ aszlig symphorien ];
152 platforms = lib.platforms.linux;