2020-03-07 12:20:42 +00:00
|
|
|
{ lib
|
|
|
|
, python3Packages
|
|
|
|
, gtk3
|
|
|
|
, cairo
|
|
|
|
, aspellDicts
|
|
|
|
, buildEnv
|
|
|
|
, gnome3
|
|
|
|
, librsvg
|
|
|
|
, xvfb_run
|
|
|
|
, dbus
|
|
|
|
, libnotify
|
|
|
|
, wrapGAppsHook
|
2020-10-31 12:00:00 +00:00
|
|
|
, fetchFromGitLab
|
|
|
|
, which
|
|
|
|
, gettext
|
|
|
|
, gobject-introspection
|
2016-12-19 21:06:48 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
2020-10-31 12:00:00 +00:00
|
|
|
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
|
2019-02-15 09:08:27 +00:00
|
|
|
pname = "paperwork";
|
2016-12-19 21:06:48 +00:00
|
|
|
|
2018-09-14 13:32:02 +01:00
|
|
|
sourceRoot = "source/paperwork-gtk";
|
2016-12-19 21:06:48 +00:00
|
|
|
|
|
|
|
# Patch out a few paths that assume that we're using the FHS:
|
|
|
|
postPatch = ''
|
2020-10-31 12:00:00 +00:00
|
|
|
chmod a+w -R ..
|
|
|
|
patchShebangs ../tools
|
2016-12-19 21:06:48 +00:00
|
|
|
|
2020-10-31 12:00:00 +00:00
|
|
|
export HOME=$(mktemp -d)
|
2016-12-19 21:06:48 +00:00
|
|
|
|
2020-10-31 12:00:00 +00:00
|
|
|
cat - ../AUTHORS.py > src/paperwork_gtk/_version.py <<EOF
|
2018-09-14 13:32:02 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
version = "${version}"
|
|
|
|
authors_code=""
|
|
|
|
EOF
|
2016-12-19 21:06:48 +00:00
|
|
|
'';
|
|
|
|
|
2020-10-31 12:00:00 +00:00
|
|
|
preBuild = ''
|
|
|
|
make l10n_compile
|
|
|
|
'';
|
|
|
|
|
2016-12-19 21:06:48 +00:00
|
|
|
ASPELL_CONF = "dict-dir ${buildEnv {
|
|
|
|
name = "aspell-all-dicts";
|
|
|
|
paths = lib.collect lib.isDerivation aspellDicts;
|
|
|
|
}}/lib/aspell";
|
|
|
|
|
2020-03-07 12:20:42 +00:00
|
|
|
postInstall = ''
|
|
|
|
# paperwork-shell needs to be re-wrapped with access to paperwork
|
2020-10-31 12:00:00 +00:00
|
|
|
cp ${python3Packages.paperwork-shell}/bin/.paperwork-cli-wrapped $out/bin/paperwork-cli
|
2020-03-07 12:20:42 +00:00
|
|
|
# install desktop files and icons
|
2020-10-31 12:00:00 +00:00
|
|
|
XDG_DATA_HOME=$out/share $out/bin/paperwork-gtk install --user
|
2020-03-07 12:20:42 +00:00
|
|
|
'';
|
|
|
|
|
2020-10-31 12:00:00 +00:00
|
|
|
checkInputs = [ xvfb_run dbus.daemon ];
|
2020-03-07 12:20:42 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapGAppsHook
|
2020-10-31 12:00:00 +00:00
|
|
|
gobject-introspection
|
|
|
|
(lib.getBin gettext)
|
|
|
|
which
|
2020-03-07 12:20:42 +00:00
|
|
|
];
|
|
|
|
|
2017-11-09 06:08:56 +00:00
|
|
|
buildInputs = [
|
2020-03-07 12:20:42 +00:00
|
|
|
gnome3.adwaita-icon-theme
|
|
|
|
libnotify
|
|
|
|
librsvg
|
2020-10-31 12:00:00 +00:00
|
|
|
gtk3
|
|
|
|
cairo
|
2017-11-09 06:08:56 +00:00
|
|
|
];
|
2016-12-19 21:06:48 +00:00
|
|
|
|
2020-10-31 12:00:00 +00:00
|
|
|
dontWrapGApps = true;
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
|
|
|
'';
|
|
|
|
|
2016-12-19 21:06:48 +00:00
|
|
|
# A few parts of chkdeps need to have a display and a dbus session, so we not
|
|
|
|
# only need to run a virtual X server + dbus but also have a large enough
|
|
|
|
# resolution, because the Cairo test tries to draw a 200x200 window.
|
|
|
|
preCheck = ''
|
|
|
|
xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
|
|
|
|
--config-file=${dbus.daemon}/share/dbus-1/session.conf \
|
2020-10-31 12:00:00 +00:00
|
|
|
$out/bin/paperwork-gtk chkdeps
|
2016-12-19 21:06:48 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2020-03-07 12:20:42 +00:00
|
|
|
paperwork-backend
|
2020-10-31 12:00:00 +00:00
|
|
|
paperwork-shell
|
|
|
|
openpaperwork-gtk
|
|
|
|
openpaperwork-core
|
2020-03-07 12:20:42 +00:00
|
|
|
pypillowfight
|
|
|
|
pyxdg
|
|
|
|
dateutil
|
|
|
|
setuptools
|
2016-12-19 21:06:48 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A personal document manager for scanned documents";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://openpaper.work/";
|
2016-12-19 21:06:48 +00:00
|
|
|
license = lib.licenses.gpl3Plus;
|
2020-03-07 12:20:42 +00:00
|
|
|
maintainers = with lib.maintainers; [ aszlig symphorien ];
|
2016-12-19 21:06:48 +00:00
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|