Merge pull request #255734 from symphorien/paperwork-2.2

paperwork: 2.1.2 -> 2.2.1
This commit is contained in:
Guillaume Girol 2023-10-24 18:53:32 +02:00 committed by GitHub
commit 8b37bb122a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 57 additions and 32 deletions

View File

@ -363,6 +363,8 @@
- `services.outline` can now be configured to use local filesystem storage instead of S3 storage using [services.outline.storage.storageType](#opt-services.outline.storage.storageType). - `services.outline` can now be configured to use local filesystem storage instead of S3 storage using [services.outline.storage.storageType](#opt-services.outline.storage.storageType).
- `paperwork` was updated to version 2.2. Documents scanned with this version will not be visible to previous versions if you downgrade. See the [upstream announcement](https://forum.openpaper.work/t/paperwork-2-2-testing-phase/316#important-switch-from-jpeg-to-png-for-new-pages-2) for details and workarounds.
- `buildGoModule` `go-modules` attrs have been renamed to `goModules`. - `buildGoModule` `go-modules` attrs have been renamed to `goModules`.
- The `fonts.fonts` and `fonts.enableDefaultFonts` options have been renamed to `fonts.packages` and `fonts.enableDefaultPackages` respectively. - The `fonts.fonts` and `fonts.enableDefaultFonts` options have been renamed to `fonts.packages` and `fonts.enableDefaultPackages` respectively.

View File

@ -1,8 +1,15 @@
{ buildPythonPackage, lib, fetchFromGitLab { buildPythonPackage
, lib
, fetchFromGitLab
, isPy3k, isPyPy , isPy3k
, isPyPy
, distro, setuptools, psutil , distro
, setuptools
, psutil
, certifi
, setuptools-scm
, pkgs , pkgs
}: }:
@ -10,6 +17,7 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "openpaperwork-core"; pname = "openpaperwork-core";
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src; inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
format = "pyproject";
sourceRoot = "${src.name}/openpaperwork-core"; sourceRoot = "${src.name}/openpaperwork-core";
@ -17,23 +25,33 @@ buildPythonPackage rec {
disabled = !isPy3k && !isPyPy; disabled = !isPy3k && !isPyPy;
patchPhase = '' patchPhase = ''
echo 'version = "${version}"' > src/openpaperwork_core/_version.py
chmod a+w -R .. chmod a+w -R ..
patchShebangs ../tools patchShebangs ../tools
''; '';
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
propagatedBuildInputs = [ propagatedBuildInputs = [
distro distro
setuptools setuptools
psutil psutil
certifi
]; ];
nativeBuildInputs = [ pkgs.gettext pkgs.which ]; nativeBuildInputs = [
pkgs.gettext
pkgs.which
setuptools-scm
];
preBuild = '' preBuild = ''
make l10n_compile make l10n_compile
''; '';
preCheck = ''
export HOME=$(mktemp -d)
'';
meta = { meta = {
description = "Backend part of Paperwork (Python API, no UI)"; description = "Backend part of Paperwork (Python API, no UI)";
homepage = "https://openpaper.work/"; homepage = "https://openpaper.work/";

View File

@ -9,6 +9,7 @@
, pillow , pillow
, pygobject3 , pygobject3
, distro , distro
, setuptools-scm
, pkgs , pkgs
}: }:
@ -16,6 +17,7 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "openpaperwork-gtk"; pname = "openpaperwork-gtk";
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src; inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
format = "pyproject";
sourceRoot = "${src.name}/openpaperwork-gtk"; sourceRoot = "${src.name}/openpaperwork-gtk";
@ -23,12 +25,18 @@ buildPythonPackage rec {
disabled = !isPy3k && !isPyPy; disabled = !isPy3k && !isPyPy;
patchPhase = '' patchPhase = ''
echo 'version = "${version}"' > src/openpaperwork_gtk/_version.py
chmod a+w -R .. chmod a+w -R ..
patchShebangs ../tools patchShebangs ../tools
''; '';
nativeBuildInputs = [ pkgs.gettext pkgs.which ]; env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = [
pkgs.gettext
pkgs.which
setuptools-scm
];
preBuild = '' preBuild = ''
make l10n_compile make l10n_compile
''; '';

View File

@ -1,6 +1,5 @@
{ buildPythonPackage { buildPythonPackage
, lib , lib
, fetchpatch
, fetchFromGitLab , fetchFromGitLab
, pyenchant , pyenchant
, scikit-learn , scikit-learn
@ -8,7 +7,6 @@
, pycountry , pycountry
, whoosh , whoosh
, termcolor , termcolor
, levenshtein
, pygobject3 , pygobject3
, pyocr , pyocr
, natsort , natsort
@ -24,34 +22,30 @@
, shared-mime-info , shared-mime-info
, libreoffice , libreoffice
, unittestCheckHook , unittestCheckHook
, setuptools-scm
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "paperwork-backend"; pname = "paperwork-backend";
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src; inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
format = "pyproject";
sourceRoot = "${src.name}/paperwork-backend"; sourceRoot = "${src.name}/paperwork-backend";
patches = [ patches = [
# disables a flaky test https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/issues/1035#note_1493700 # disables a flaky test https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/issues/1035#note_1493700
./flaky_test.patch ./flaky_test.patch
(fetchpatch {
url = "https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/commit/0f5cf0fe7ef223000e02c28e4c7576f74a778fe6.patch";
hash = "sha256-NIK3j2TdydfeK3/udS/Pc+tJa/pPkfAmSPPeaYuaCq4=";
})
]; ];
patchFlags = [ "-p2" ]; patchFlags = [ "-p2" ];
postPatch = '' postPatch = ''
substituteInPlace setup.py \
--replace python-Levenshtein Levenshtein
echo 'version = "${version}"' > src/paperwork_backend/_version.py
chmod a+w -R .. chmod a+w -R ..
patchShebangs ../tools patchShebangs ../tools
''; '';
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
propagatedBuildInputs = [ propagatedBuildInputs = [
distro distro
gtk3 gtk3
@ -63,7 +57,6 @@ buildPythonPackage rec {
pygobject3 pygobject3
pyocr pyocr
pypillowfight pypillowfight
levenshtein
poppler_gi poppler_gi
scikit-learn scikit-learn
termcolor termcolor
@ -74,6 +67,7 @@ buildPythonPackage rec {
gettext gettext
shared-mime-info shared-mime-info
which which
setuptools-scm
]; ];
preBuild = '' preBuild = ''

View File

@ -34,6 +34,7 @@ in
python3Packages.buildPythonApplication rec { python3Packages.buildPythonApplication rec {
inherit src version; inherit src version;
pname = "paperwork"; pname = "paperwork";
format = "pyproject";
sample_docs = sample_documents // { sample_docs = sample_documents // {
# a trick for the update script # a trick for the update script
@ -43,21 +44,13 @@ python3Packages.buildPythonApplication rec {
sourceRoot = "${src.name}/paperwork-gtk"; sourceRoot = "${src.name}/paperwork-gtk";
# Patch out a few paths that assume that we're using the FHS: env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
postPatch = ''
substituteInPlace setup.py \
--replace python-Levenshtein Levenshtein
postPatch = ''
chmod a+w -R .. chmod a+w -R ..
patchShebangs ../tools patchShebangs ../tools
export HOME=$(mktemp -d) export HOME=$(mktemp -d)
cat - ../AUTHORS.py > src/paperwork_gtk/_version.py <<EOF
# -*- coding: utf-8 -*-
version = "${version}"
authors_code=""
EOF
''; '';
preBuild = '' preBuild = ''
@ -93,6 +86,7 @@ python3Packages.buildPythonApplication rec {
nativeBuildInputs = [ nativeBuildInputs = [
wrapGAppsHook wrapGAppsHook
gobject-introspection gobject-introspection
python3Packages.setuptools-scm
(lib.getBin gettext) (lib.getBin gettext)
which which
gdk-pixbuf # for the setup hook gdk-pixbuf # for the setup hook

View File

@ -9,9 +9,11 @@
, openpaperwork-gtk , openpaperwork-gtk
, paperwork-backend , paperwork-backend
, fabulous , fabulous
, rich
, getkey , getkey
, psutil , psutil
, shared-mime-info , shared-mime-info
, setuptools-scm
, pkgs , pkgs
}: }:
@ -19,6 +21,7 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "paperwork-shell"; pname = "paperwork-shell";
inherit (import ./src.nix { inherit fetchFromGitLab; }) version src; inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
format = "pyproject";
sourceRoot = "${src.name}/paperwork-shell"; sourceRoot = "${src.name}/paperwork-shell";
@ -26,10 +29,10 @@ buildPythonPackage rec {
disabled = !isPy3k && !isPyPy; disabled = !isPy3k && !isPyPy;
patchPhase = '' patchPhase = ''
echo 'version = "${version}"' > src/paperwork_shell/_version.py
chmod a+w -R .. chmod a+w -R ..
patchShebangs ../tools patchShebangs ../tools
''; '';
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
propagatedBuildInputs = [ propagatedBuildInputs = [
openpaperwork-core openpaperwork-core
@ -37,6 +40,7 @@ buildPythonPackage rec {
fabulous fabulous
getkey getkey
psutil psutil
rich
]; ];
nativeCheckInputs = [ nativeCheckInputs = [
@ -44,7 +48,12 @@ buildPythonPackage rec {
openpaperwork-gtk openpaperwork-gtk
]; ];
nativeBuildInputs = [ pkgs.gettext pkgs.which ]; nativeBuildInputs = [
pkgs.gettext
pkgs.which
setuptools-scm
];
preBuild = '' preBuild = ''
make l10n_compile make l10n_compile
''; '';

View File

@ -1,13 +1,13 @@
{fetchFromGitLab}: {fetchFromGitLab}:
rec { rec {
version = "2.1.2"; version = "2.2.1";
src = fetchFromGitLab { src = fetchFromGitLab {
domain = "gitlab.gnome.org"; domain = "gitlab.gnome.org";
repo = "paperwork"; repo = "paperwork";
group = "World"; group = "World";
owner = "OpenPaperwork"; owner = "OpenPaperwork";
rev = version; rev = version;
sha256 = "/5k+zUtTE+Dr879xbHDCAYrqlEJLsbkcRSG3GbA/PCg="; sha256 = "sha256-OFVj9INDiOpGd5N3ziMBWt3/IdmpInc+jEAxW3GcvOA=";
}; };
sample_documents = fetchFromGitLab { sample_documents = fetchFromGitLab {
domain = "gitlab.gnome.org"; domain = "gitlab.gnome.org";