diff options
author | Robert Schütz <nix@dotlambda.de> | 2022-06-20 22:17:20 +0000 |
---|---|---|
committer | Jonathan Ringer <jonringer@users.noreply.github.com> | 2022-06-20 22:43:16 -0700 |
commit | b76e4a37da9b7c549eb01836b73ff14a8b353d44 (patch) | |
tree | 51302daa968dbb97d717021a68fa693431745d0e /pkgs/development/python-modules/ocrmypdf | |
parent | d2b165e6650c1a9c42769c139734e0a429f8d7a0 (diff) |
python310Packages.ocrmypdf: 13.4.7 -> 13.5.0
https://github.com/ocrmypdf/OCRmyPDF/blob/v13.5.0/docs/release_notes.rst
Diffstat (limited to 'pkgs/development/python-modules/ocrmypdf')
-rw-r--r-- | pkgs/development/python-modules/ocrmypdf/default.nix | 4 | ||||
-rw-r--r-- | pkgs/development/python-modules/ocrmypdf/paths.patch | 40 |
2 files changed, 22 insertions, 22 deletions
diff --git a/pkgs/development/python-modules/ocrmypdf/default.nix b/pkgs/development/python-modules/ocrmypdf/default.nix index 89faff436664f..97b0bfd4cbcac 100644 --- a/pkgs/development/python-modules/ocrmypdf/default.nix +++ b/pkgs/development/python-modules/ocrmypdf/default.nix @@ -27,7 +27,7 @@ buildPythonPackage rec { pname = "ocrmypdf"; - version = "13.4.7"; + version = "13.5.0"; src = fetchFromGitHub { owner = "ocrmypdf"; @@ -39,7 +39,7 @@ buildPythonPackage rec { postFetch = '' rm "$out/.git_archival.txt" ''; - hash = "sha256-jCfMCjh8MdH5K76iyJCgtkgPtpxnCxlXlzttTIzINPk="; + hash = "sha256-jGVqH2z8NRnQcm4hv4OufCm26o6Qr8/mBRIScvcUpkE="; }; SETUPTOOLS_SCM_PRETEND_VERSION = version; diff --git a/pkgs/development/python-modules/ocrmypdf/paths.patch b/pkgs/development/python-modules/ocrmypdf/paths.patch index 47521e1033eb4..9b1eed233cbb2 100644 --- a/pkgs/development/python-modules/ocrmypdf/paths.patch +++ b/pkgs/development/python-modules/ocrmypdf/paths.patch @@ -1,20 +1,20 @@ diff --git a/src/ocrmypdf/_exec/ghostscript.py b/src/ocrmypdf/_exec/ghostscript.py -index 1146cc5f..43f3915c 100644 +index 4da65483..af750249 100644 --- a/src/ocrmypdf/_exec/ghostscript.py +++ b/src/ocrmypdf/_exec/ghostscript.py -@@ -40,15 +40,7 @@ For details see: +@@ -35,15 +35,7 @@ log = logging.getLogger(__name__) # Most reliable what to get the bitness of Python interpreter, according to Python docs - _is_64bit = sys.maxsize > 2 ** 32 + _IS_64BIT = sys.maxsize > 2**32 --_gswin = None +-_GSWIN = None -if os.name == 'nt': -- if _is_64bit: -- _gswin = 'gswin64c' +- if _IS_64BIT: +- _GSWIN = 'gswin64c' - else: -- _gswin = 'gswin32c' +- _GSWIN = 'gswin32c' - --GS = _gswin if _gswin else 'gs' --del _gswin +-GS = _GSWIN if _GSWIN else 'gs' +-del _GSWIN +GS = '@gs@' @@ -73,10 +73,10 @@ index ca8a4542..d0544174 100644 '--skip-if-larger', '--quality', diff --git a/src/ocrmypdf/_exec/tesseract.py b/src/ocrmypdf/_exec/tesseract.py -index a3688f65..61f54465 100644 +index 01177cac..665f1145 100644 --- a/src/ocrmypdf/_exec/tesseract.py +++ b/src/ocrmypdf/_exec/tesseract.py -@@ -75,7 +75,7 @@ class TesseractVersion(StrictVersion): +@@ -114,7 +114,7 @@ class TesseractVersion(Version): def version() -> str: @@ -85,7 +85,7 @@ index a3688f65..61f54465 100644 def has_user_words(): -@@ -97,7 +97,7 @@ def get_languages(): +@@ -141,7 +141,7 @@ def get_languages(): msg += output return msg @@ -94,7 +94,7 @@ index a3688f65..61f54465 100644 try: proc = run( args_tess, -@@ -119,7 +119,7 @@ def get_languages(): +@@ -163,7 +163,7 @@ def get_languages(): def tess_base_args(langs: List[str], engine_mode: Optional[int]) -> List[str]: @@ -104,10 +104,10 @@ index a3688f65..61f54465 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 aec365c2..cc5cb7e4 100644 +index 479959ef..cc15fdec 100644 --- a/src/ocrmypdf/_exec/unpaper.py +++ b/src/ocrmypdf/_exec/unpaper.py -@@ -31,7 +31,7 @@ log = logging.getLogger(__name__) +@@ -69,7 +69,7 @@ class UnpaperImageTooLargeError(Exception): def version() -> str: @@ -115,13 +115,13 @@ index aec365c2..cc5cb7e4 100644 + return get_version('@unpaper@') - def _setup_unpaper_io(tmpdir: Path, input_file: Path) -> Tuple[Path, Path]: -@@ -71,7 +71,7 @@ def _setup_unpaper_io(tmpdir: Path, input_file: Path) -> Tuple[Path, Path]: - def run( + SUFFIXES = {'1': '.pbm', 'L': '.pgm', 'RGB': '.ppm'} +@@ -123,7 +123,7 @@ def _setup_unpaper_io(input_file: Path) -> Iterator[Tuple[Path, Path, Path]]: + def run_unpaper( input_file: Path, output_file: Path, *, dpi: DecFloat, mode_args: List[str] ) -> None: - args_unpaper = ['unpaper', '-v', '--dpi', str(round(dpi, 6))] + mode_args + args_unpaper = ['@unpaper@', '-v', '--dpi', str(round(dpi, 6))] + mode_args - with TemporaryDirectory() as tmpdir: - input_pnm, output_pnm = _setup_unpaper_io(Path(tmpdir), input_file) + with _setup_unpaper_io(input_file) as (input_pnm, output_pnm, tmpdir): + # To prevent any shenanigans from accepting arbitrary parameters in |