You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
2.3 KiB
106 lines
2.3 KiB
4 years ago
|
{ lib
|
||
|
, python3Packages
|
||
|
, gtk3
|
||
|
, cairo
|
||
|
, aspellDicts
|
||
|
, buildEnv
|
||
|
, gnome3
|
||
|
, librsvg
|
||
|
, xvfb_run
|
||
|
, dbus
|
||
|
, libnotify
|
||
|
, wrapGAppsHook
|
||
4 years ago
|
, fetchFromGitLab
|
||
|
, which
|
||
|
, gettext
|
||
|
, gobject-introspection
|
||
8 years ago
|
}:
|
||
|
|
||
|
python3Packages.buildPythonApplication rec {
|
||
4 years ago
|
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
|
||
5 years ago
|
pname = "paperwork";
|
||
8 years ago
|
|
||
6 years ago
|
sourceRoot = "source/paperwork-gtk";
|
||
8 years ago
|
|
||
|
# Patch out a few paths that assume that we're using the FHS:
|
||
|
postPatch = ''
|
||
4 years ago
|
chmod a+w -R ..
|
||
|
patchShebangs ../tools
|
||
8 years ago
|
|
||
4 years ago
|
export HOME=$(mktemp -d)
|
||
8 years ago
|
|
||
4 years ago
|
cat - ../AUTHORS.py > src/paperwork_gtk/_version.py <<EOF
|
||
6 years ago
|
# -*- coding: utf-8 -*-
|
||
|
version = "${version}"
|
||
|
authors_code=""
|
||
|
EOF
|
||
8 years ago
|
'';
|
||
|
|
||
4 years ago
|
preBuild = ''
|
||
|
make l10n_compile
|
||
|
'';
|
||
|
|
||
8 years ago
|
ASPELL_CONF = "dict-dir ${buildEnv {
|
||
|
name = "aspell-all-dicts";
|
||
|
paths = lib.collect lib.isDerivation aspellDicts;
|
||
|
}}/lib/aspell";
|
||
|
|
||
4 years ago
|
postInstall = ''
|
||
|
# paperwork-shell needs to be re-wrapped with access to paperwork
|
||
4 years ago
|
cp ${python3Packages.paperwork-shell}/bin/.paperwork-cli-wrapped $out/bin/paperwork-cli
|
||
4 years ago
|
# install desktop files and icons
|
||
4 years ago
|
XDG_DATA_HOME=$out/share $out/bin/paperwork-gtk install --user
|
||
4 years ago
|
'';
|
||
|
|
||
4 years ago
|
checkInputs = [ xvfb_run dbus.daemon ];
|
||
4 years ago
|
|
||
|
nativeBuildInputs = [
|
||
|
wrapGAppsHook
|
||
4 years ago
|
gobject-introspection
|
||
|
(lib.getBin gettext)
|
||
|
which
|
||
4 years ago
|
];
|
||
|
|
||
7 years ago
|
buildInputs = [
|
||
4 years ago
|
gnome3.adwaita-icon-theme
|
||
|
libnotify
|
||
|
librsvg
|
||
4 years ago
|
gtk3
|
||
|
cairo
|
||
7 years ago
|
];
|
||
8 years ago
|
|
||
4 years ago
|
dontWrapGApps = true;
|
||
|
|
||
|
preFixup = ''
|
||
|
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
||
|
'';
|
||
|
|
||
8 years ago
|
# 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 \
|
||
4 years ago
|
$out/bin/paperwork-gtk chkdeps
|
||
8 years ago
|
'';
|
||
|
|
||
|
propagatedBuildInputs = with python3Packages; [
|
||
4 years ago
|
paperwork-backend
|
||
4 years ago
|
paperwork-shell
|
||
|
openpaperwork-gtk
|
||
|
openpaperwork-core
|
||
4 years ago
|
pypillowfight
|
||
|
pyxdg
|
||
|
dateutil
|
||
|
setuptools
|
||
8 years ago
|
];
|
||
|
|
||
|
meta = {
|
||
|
description = "A personal document manager for scanned documents";
|
||
4 years ago
|
homepage = "https://openpaper.work/";
|
||
8 years ago
|
license = lib.licenses.gpl3Plus;
|
||
4 years ago
|
maintainers = with lib.maintainers; [ aszlig symphorien ];
|
||
8 years ago
|
platforms = lib.platforms.linux;
|
||
|
};
|
||
|
}
|