From 1d2ca7558898bdabb28e14d38654211cf772d0e4 Mon Sep 17 00:00:00 2001 From: Mateusz Sylwestrzak Date: Sun, 16 Mar 2025 14:41:18 +0100 Subject: [PATCH] New package: python3-ocrmypdf-16.10.1 --- .../patches/tesseract_binary_name_fixup.patch | 29 +++++++++++++++++++ .../use_pillow_heif_instead_of_pi_heif.patch | 22 ++++++++++++++ srcpkgs/python3-ocrmypdf/template | 15 ++++++++++ 3 files changed, 66 insertions(+) create mode 100644 srcpkgs/python3-ocrmypdf/patches/tesseract_binary_name_fixup.patch create mode 100644 srcpkgs/python3-ocrmypdf/patches/use_pillow_heif_instead_of_pi_heif.patch create mode 100644 srcpkgs/python3-ocrmypdf/template diff --git a/srcpkgs/python3-ocrmypdf/patches/tesseract_binary_name_fixup.patch b/srcpkgs/python3-ocrmypdf/patches/tesseract_binary_name_fixup.patch new file mode 100644 index 00000000000..daf6f9224c2 --- /dev/null +++ b/srcpkgs/python3-ocrmypdf/patches/tesseract_binary_name_fixup.patch @@ -0,0 +1,29 @@ +--- a/src/ocrmypdf/_exec/tesseract.py 2025-02-27 00:16:18.000000000 +0100 ++++ b/src/ocrmypdf/_exec/tesseract.py 2025-03-17 11:56:25.146770854 +0100 +@@ -95,7 +95,7 @@ + + + def version() -> Version: +- return TesseractVersion(get_version('tesseract', regex=r'tesseract\s(.+)')) ++ return TesseractVersion(get_version('tesseract-ocr', regex=r'tesseract\s(.+)')) + + + def has_thresholding() -> bool: +@@ -113,7 +113,7 @@ + msg += output + return msg + +- args_tess = ['tesseract', '--list-langs'] ++ args_tess = ['tesseract-ocr', '--list-langs'] + try: + proc = run( + args_tess, +@@ -135,7 +135,7 @@ + + + def tess_base_args(langs: list[str], engine_mode: int | None) -> list[str]: +- args = ['tesseract'] ++ args = ['tesseract-ocr'] + if langs: + args.extend(['-l', '+'.join(langs)]) + if engine_mode is not None: diff --git a/srcpkgs/python3-ocrmypdf/patches/use_pillow_heif_instead_of_pi_heif.patch b/srcpkgs/python3-ocrmypdf/patches/use_pillow_heif_instead_of_pi_heif.patch new file mode 100644 index 00000000000..eb2a358f389 --- /dev/null +++ b/srcpkgs/python3-ocrmypdf/patches/use_pillow_heif_instead_of_pi_heif.patch @@ -0,0 +1,22 @@ +--- a/pyproject.toml 2025-02-27 00:16:18.000000000 +0100 ++++ b/pyproject.toml 2025-03-17 15:20:09.011808694 +0100 +@@ -16,7 +16,7 @@ + "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", +--- a/src/ocrmypdf/_pipeline.py 2025-02-27 00:16:18.000000000 +0100 ++++ b/src/ocrmypdf/_pipeline.py 2025-03-17 15:21:10.155848376 +0100 +@@ -42,7 +42,7 @@ + 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(): diff --git a/srcpkgs/python3-ocrmypdf/template b/srcpkgs/python3-ocrmypdf/template new file mode 100644 index 00000000000..c3e4782aff7 --- /dev/null +++ b/srcpkgs/python3-ocrmypdf/template @@ -0,0 +1,15 @@ +# Template file for 'python3-ocrmypdf' +pkgname=python3-ocrmypdf +version=16.10.1 +revision=1 +build_style=python3-pep517 +hostmakedepends="hatchling hatch-vcs" +depends="python3-deprecation img2pdf python3-packaging python3-pdfminer.six + python3-pikepdf python3-Pillow python3-pluggy python3-reportlab python3-rich + python3-pillow_heif tesseract-ocr ghostscript unpaper pngquant jbig2enc qpdf" +short_desc="Add OCR text layer to scanned PDF files" +maintainer="Mateusz Sylwestrzak " +license="MPL-2.0" +homepage="https://github.com/ocrmypdf/OCRmyPDF" +distfiles="${PYPI_SITE}/o/ocrmypdf/ocrmypdf-${version}.tar.gz" +checksum=9f32059fc97e25931aaa0a8a4027b8c9faca7d9e1183089f32e0cba5631449f1