2016-12-19 22:06:48 +01:00
|
|
|
{ lib, python3Packages, fetchFromGitHub, gtk3, cairo
|
|
|
|
, aspellDicts, buildEnv
|
2018-02-25 03:23:58 +01:00
|
|
|
, gnome3, hicolor-icon-theme, librsvg
|
2017-07-15 15:09:53 +02:00
|
|
|
, xvfb_run, dbus, libnotify
|
2016-12-19 22:06:48 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
name = "paperwork-${version}";
|
|
|
|
# Don't forget to also update paperwork-backend when updating this!
|
2017-12-23 07:14:09 +01:00
|
|
|
version = "1.2.2";
|
2016-12-19 22:06:48 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "paperwork";
|
2017-11-09 07:08:56 +01:00
|
|
|
owner = "openpaperwork";
|
2016-12-19 22:06:48 +01:00
|
|
|
rev = version;
|
2017-12-23 07:14:09 +01:00
|
|
|
sha256 = "1nb5sna2s952xb7c89qccg9qp693pyqj8g7xz16ll16ydfqnzsdk";
|
2016-12-19 22:06:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# Patch out a few paths that assume that we're using the FHS:
|
|
|
|
postPatch = ''
|
|
|
|
themeDir="$(echo "${gnome3.defaultIconTheme}/share/icons/"*)"
|
|
|
|
sed -i -e "s,/usr/share/icons/gnome,$themeDir," src/paperwork/deps.py
|
|
|
|
|
|
|
|
sed -i -e 's,sys\.prefix,"",g' \
|
|
|
|
src/paperwork/frontend/aboutdialog/__init__.py \
|
|
|
|
src/paperwork/frontend/mainwindow/__init__.py \
|
|
|
|
setup.py
|
|
|
|
|
|
|
|
sed -i -e '/^UI_FILES_DIRS = \[/,/^\]$/ {
|
|
|
|
c UI_FILES_DIRS = ["'"$out/share/paperwork"'"]
|
|
|
|
}' src/paperwork/frontend/util/__init__.py
|
|
|
|
|
|
|
|
sed -i -e '/^LOCALE_PATHS = \[/,/^\]$/ {
|
2017-02-08 14:48:26 +01:00
|
|
|
c LOCALE_PATHS = ["'"$out/share"'"]
|
2016-12-19 22:06:48 +01:00
|
|
|
}' src/paperwork/paperwork.py
|
|
|
|
|
|
|
|
sed -i -e 's/"icon"/"icon-name"/g' \
|
|
|
|
src/paperwork/frontend/mainwindow/mainwindow.glade
|
|
|
|
|
|
|
|
sed -i -e 's/"logo"/"logo-icon-name"/g' \
|
|
|
|
src/paperwork/frontend/aboutdialog/aboutdialog.glade
|
|
|
|
'';
|
|
|
|
|
|
|
|
ASPELL_CONF = "dict-dir ${buildEnv {
|
|
|
|
name = "aspell-all-dicts";
|
|
|
|
paths = lib.collect lib.isDerivation aspellDicts;
|
|
|
|
}}/lib/aspell";
|
|
|
|
|
|
|
|
checkInputs = [ xvfb_run dbus.daemon ];
|
2017-11-09 07:08:56 +01:00
|
|
|
buildInputs = [
|
2018-02-25 03:23:58 +01:00
|
|
|
gnome3.defaultIconTheme hicolor-icon-theme libnotify librsvg
|
2017-11-09 07:08:56 +01:00
|
|
|
];
|
2016-12-19 22:06:48 +01: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 \
|
|
|
|
paperwork-shell chkdeps paperwork
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2017-07-15 15:09:53 +02:00
|
|
|
paperwork-backend pypillowfight gtk3 cairo pyxdg dateutil
|
2016-12-19 22:06:48 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
makeWrapperArgs = [
|
|
|
|
"--set GI_TYPELIB_PATH \"$GI_TYPELIB_PATH\""
|
2017-11-09 07:08:56 +01:00
|
|
|
"--set GDK_PIXBUF_MODULE_FILE \"$GDK_PIXBUF_MODULE_FILE\""
|
2016-12-19 22:06:48 +01:00
|
|
|
"--prefix XDG_DATA_DIRS : \"$out/share\""
|
|
|
|
"--suffix XDG_DATA_DIRS : \"$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH\""
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A personal document manager for scanned documents";
|
2017-11-09 19:14:12 +01:00
|
|
|
homepage = https://openpaper.work/;
|
2016-12-19 22:06:48 +01:00
|
|
|
license = lib.licenses.gpl3Plus;
|
|
|
|
maintainers = [ lib.maintainers.aszlig ];
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|