3
0
Fork 0
forked from mirrors/nixpkgs

paperwork: add an update-script

This commit is contained in:
Guillaume Girol 2022-02-03 12:00:00 +00:00
parent 554d2d8aa2
commit ba9f4f3d31

View file

@ -16,6 +16,7 @@
, texlive
, imagemagick
, perlPackages
, writeScript
}:
let
@ -27,12 +28,19 @@ let
imagemagick
perlPackages.Po4a
];
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src sample_documents;
in
python3Packages.buildPythonApplication rec {
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src sample_documents;
inherit src version;
pname = "paperwork";
sample_docs = sample_documents // {
# a trick for the update script
name = "sample_documents";
src = sample_documents;
};
sourceRoot = "source/paperwork-gtk";
# Patch out a few paths that assume that we're using the FHS:
@ -69,7 +77,7 @@ python3Packages.buildPythonApplication rec {
export XDG_DATA_DIRS=$XDG_DATA_DIRS:${gnome.adwaita-icon-theme}/share
# build the user manual
PATH=$out/bin:$PATH PAPERWORK_TEST_DOCUMENTS=${sample_documents} make data
PATH=$out/bin:$PATH PAPERWORK_TEST_DOCUMENTS=${sample_docs} make data
for i in src/paperwork_gtk/model/help/out/*.pdf; do
install -Dt $site/model/help/out $i
done
@ -128,6 +136,15 @@ python3Packages.buildPythonApplication rec {
disallowedRequisites = documentation_deps;
passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl common-updater-scripts
version=$(list-git-tags https://gitlab.gnome.org/World/OpenPaperwork/paperwork.git | sed 's/^v//' | sort -V | tail -n1)
update-source-version paperwork "$version" --file=pkgs/applications/office/paperwork/src.nix
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)"
update-source-version paperwork.sample_docs "$docs_version" --file=pkgs/applications/office/paperwork/src.nix --version-key=rev
'';
meta = {
description = "A personal document manager for scanned documents";
homepage = "https://openpaper.work/";