From 899ee6ec3d77d505405012ec588e8ecc1cec1a01 Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 16 Jan 2025 20:46:36 +0100 Subject: [PATCH] k2pdfopt: disable tesseract --- pkgs/by-name/k2/k2pdfopt/package.nix | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/k2/k2pdfopt/package.nix b/pkgs/by-name/k2/k2pdfopt/package.nix index a7da6638c61b..8f1e5b64e9bd 100644 --- a/pkgs/by-name/k2/k2pdfopt/package.nix +++ b/pkgs/by-name/k2/k2pdfopt/package.nix @@ -21,12 +21,15 @@ mupdf, enableDJVU ? true, djvulibre, - enableGOCR ? false, - gocr, # Disabled by default due to crashes - enableTesseract ? true, + enableGOCR ? false, # Disabled by default due to crashes + gocr, + # Tesseract support is currently broken + # See: https://github.com/NixOS/nixpkgs/issues/368349 + enableTesseract ? false, leptonica, tesseract5, opencl-headers, + fetchDebianPatch, }: # k2pdfopt is a pain to package. It requires modified versions of mupdf, @@ -88,6 +91,20 @@ stdenv.mkDerivation rec { patches = [ ./0001-Fix-CMakeLists.patch + (fetchDebianPatch { + inherit pname; + version = "${version}+ds"; + debianRevision = "3.1"; + patch = "0007-k2pdfoptlib-k2ocr.c-conditionally-enable-tesseract-r.patch"; + hash = "sha256-uJ9Gpyq64n/HKqo0hkQ2dnkSLCKNN4DedItPGzHfqR8="; + }) + (fetchDebianPatch { + inherit pname; + version = "${version}+ds"; + debianRevision = "3.1"; + patch = "0009-willuslib-CMakeLists.txt-conditionally-add-source-fi.patch"; + hash = "sha256-cBSlcuhsw4YgAJtBJkKLW6u8tK5gFwWw7pZEJzVMJDE="; + }) ]; postPatch = ''