From 8cb6569074bcd091fa9b03f498f0d63514282f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 20 Apr 2024 13:03:26 -0700 Subject: [PATCH 1/2] python311Packages.pillow-heif: don't skip test_full_build --- pkgs/development/python-modules/pillow-heif/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pillow-heif/default.nix b/pkgs/development/python-modules/pillow-heif/default.nix index 6560c63ac283..d91408fc864d 100644 --- a/pkgs/development/python-modules/pillow-heif/default.nix +++ b/pkgs/development/python-modules/pillow-heif/default.nix @@ -57,8 +57,12 @@ buildPythonPackage rec { x265 ]; - # clang-16: error: argument unused during compilation: '-fno-strict-overflow' [-Werror,-Wunused-command-line-argument] - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument"; + env = { + # clang-16: error: argument unused during compilation: '-fno-strict-overflow' + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument"; + + RELEASE_FULL_FLAG = 1; + }; propagatedBuildInputs = [ pillow From 4ab4ab0e2ac85d4a4c8afaa47715c257bc47ed8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 20 Apr 2024 12:33:00 -0700 Subject: [PATCH 2/2] python311Packages.ocrmypdf: 16.1.2 -> 16.2.0 Diff: https://github.com/ocrmypdf/OCRmyPDF/compare/v16.1.2...v16.2.0 Changelog: https://github.com/ocrmypdf/OCRmyPDF/blob/v16.2.0/docs/release_notes.rst --- .../python-modules/ocrmypdf/default.nix | 21 ++++++++------- .../ocrmypdf/use-pillow-heif.patch | 26 +++++++++++++++++++ 2 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 pkgs/development/python-modules/ocrmypdf/use-pillow-heif.patch diff --git a/pkgs/development/python-modules/ocrmypdf/default.nix b/pkgs/development/python-modules/ocrmypdf/default.nix index 3f880f9d5f90..eb5cf1ecfed2 100644 --- a/pkgs/development/python-modules/ocrmypdf/default.nix +++ b/pkgs/development/python-modules/ocrmypdf/default.nix @@ -9,6 +9,7 @@ , jbig2enc , packaging , pdfminer-six +, pillow-heif , pikepdf , pillow , pluggy @@ -18,19 +19,17 @@ , pythonOlder , rich , reportlab -, setuptools , setuptools-scm , substituteAll , tesseract , tqdm -, typing-extensions , unpaper , installShellFiles }: buildPythonPackage rec { pname = "ocrmypdf"; - version = "16.1.2"; + version = "16.2.0"; disabled = pythonOlder "3.10"; @@ -46,10 +45,11 @@ buildPythonPackage rec { postFetch = '' rm "$out/.git_archival.txt" ''; - hash = "sha256-nZvfkfO5u3iuN0g/KITWbhYCRAJngEOKCW48z6IEPMI="; + hash = "sha256-sqhuQ+no6UymxbVtDtWiYQK8kKpO1y37NxLDmRT1LEQ="; }; patches = [ + ./use-pillow-heif.patch (substituteAll { src = ./paths.patch; gs = lib.getExe ghostscript; @@ -60,30 +60,31 @@ buildPythonPackage rec { }) ]; - nativeBuildInputs = [ - setuptools + build-system = [ setuptools-scm + ]; + + nativeBuildInputs = [ installShellFiles ]; - propagatedBuildInputs = [ + dependencies = [ deprecation img2pdf packaging pdfminer-six + pillow-heif pikepdf pillow pluggy - reportlab rich - ] ++ lib.optionals (pythonOlder "3.10") [ - typing-extensions ]; nativeCheckInputs = [ hypothesis pytest-xdist pytestCheckHook + reportlab ]; pythonImportsCheck = [ diff --git a/pkgs/development/python-modules/ocrmypdf/use-pillow-heif.patch b/pkgs/development/python-modules/ocrmypdf/use-pillow-heif.patch new file mode 100644 index 000000000000..fc464cf71b66 --- /dev/null +++ b/pkgs/development/python-modules/ocrmypdf/use-pillow-heif.patch @@ -0,0 +1,26 @@ +diff --git a/pyproject.toml b/pyproject.toml +index d045458f..efa9161d 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -16,7 +16,7 @@ dependencies = [ + "img2pdf>=0.5", + "packaging>=20", + "pdfminer.six>=20220319", +- "pi-heif", # Heif image format - maintainers: if this is removed, it will NOT break ++ "pillow-heif", # Heif image format - maintainers: if this is removed, it will NOT break + "pikepdf>=8.10.1", + "Pillow>=10.0.1", + "pluggy>=1", +diff --git a/src/ocrmypdf/_pipeline.py b/src/ocrmypdf/_pipeline.py +index 043a78a0..522197b1 100644 +--- a/src/ocrmypdf/_pipeline.py ++++ b/src/ocrmypdf/_pipeline.py +@@ -42,7 +42,7 @@ from ocrmypdf.pdfinfo import Colorspace, Encoding, PageInfo, PdfInfo + from ocrmypdf.pluginspec import OrientationConfidence + + try: +- from pi_heif import register_heif_opener ++ from pillow_heif import register_heif_opener + except ImportError: + + def register_heif_opener():