From 9dfbe512437e052b62ba6d6fa6d2e43200e2fbc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 29 Oct 2024 20:45:09 -0700 Subject: [PATCH 1/2] python312Packages.ocrmypdf: 16.5.0 -> 16.6.2 Diff: https://github.com/ocrmypdf/OCRmyPDF/compare/v16.5.0...v16.6.2 Changelog: https://github.com/ocrmypdf/OCRmyPDF/blob/v16.6.2/docs/release_notes.rst --- pkgs/development/python-modules/ocrmypdf/default.nix | 4 ++-- pkgs/development/python-modules/ocrmypdf/paths.patch | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/ocrmypdf/default.nix b/pkgs/development/python-modules/ocrmypdf/default.nix index 4f9149cc72b6d..3cfef7de78fe5 100644 --- a/pkgs/development/python-modules/ocrmypdf/default.nix +++ b/pkgs/development/python-modules/ocrmypdf/default.nix @@ -29,7 +29,7 @@ buildPythonPackage rec { pname = "ocrmypdf"; - version = "16.5.0"; + version = "16.6.2"; disabled = pythonOlder "3.10"; @@ -45,7 +45,7 @@ buildPythonPackage rec { postFetch = '' rm "$out/.git_archival.txt" ''; - hash = "sha256-jqe4BRW0U7gqcf+FtDWjDDvRStAqaEPTuU+B+BrFR5Y="; + hash = "sha256-065PeCsNfAvZTLyWz3toTrE/e944mzfuwRQvKXxdnd0="; }; patches = [ diff --git a/pkgs/development/python-modules/ocrmypdf/paths.patch b/pkgs/development/python-modules/ocrmypdf/paths.patch index 3e2a3a5d507b9..164b7f66a4dcb 100644 --- a/pkgs/development/python-modules/ocrmypdf/paths.patch +++ b/pkgs/development/python-modules/ocrmypdf/paths.patch @@ -96,15 +96,15 @@ index 102bdab8..bfef4400 100644 args.extend(['-l', '+'.join(langs)]) if engine_mode is not None: diff --git a/src/ocrmypdf/_exec/unpaper.py b/src/ocrmypdf/_exec/unpaper.py -index d1165c46..7c732b15 100644 +index a5a92f4c..6cf56eb3 100644 --- a/src/ocrmypdf/_exec/unpaper.py +++ b/src/ocrmypdf/_exec/unpaper.py @@ -48,7 +48,7 @@ class UnpaperImageTooLargeError(Exception): def version() -> Version: -- return Version(get_version('unpaper')) -+ return Version(get_version('@unpaper@')) +- return Version(get_version('unpaper', regex=r'(?m).*?(\d+(\.\d+)(\.\d+)?)')) ++ return Version(get_version('@unpaper@', regex=r'(?m).*?(\d+(\.\d+)(\.\d+)?)')) @contextmanager From 8b81bddc76ddcb6ef510fbfbd816e4678558e499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 22 Nov 2024 15:01:42 -0800 Subject: [PATCH 2/2] paperless-ngx: fix tests with OCRmyPDF 16.6 --- pkgs/by-name/pa/paperless-ngx/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/pa/paperless-ngx/package.nix b/pkgs/by-name/pa/paperless-ngx/package.nix index 144e2b0cefdef..7dee06aac9a05 100644 --- a/pkgs/by-name/pa/paperless-ngx/package.nix +++ b/pkgs/by-name/pa/paperless-ngx/package.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, fetchpatch2 , buildNpmPackage , nixosTests , gettext @@ -141,6 +142,14 @@ python.pkgs.buildPythonApplication rec { inherit version src; + patches = [ + (fetchpatch2 { + name = "ocrmypdf-16.6-compat.patch"; + url = "https://github.com/paperless-ngx/paperless-ngx/commit/d1f255a22ea53712cb9101277ec57ea1976f9c02.patch?full_index=1"; + hash = "sha256-V2nnNeNCcfSrjOttQ5rgDj7gnxpfpBPVeDDnMea0C3U="; + }) + ]; + postPatch = '' # pytest-xdist makes the tests flaky substituteInPlace src/setup.cfg \