Merge pull request #77494 from dtzWill/update/ocrmypdf-9.4.0
ocrmypdf: 9.2.0 -> 9.5.0
This commit is contained in:
commit
a61db03041
@ -10,6 +10,7 @@
|
|||||||
, stdenv
|
, stdenv
|
||||||
, tesseract4
|
, tesseract4
|
||||||
, unpaper
|
, unpaper
|
||||||
|
, substituteAll
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -28,14 +29,14 @@ let
|
|||||||
|
|
||||||
in buildPythonApplication rec {
|
in buildPythonApplication rec {
|
||||||
pname = "ocrmypdf";
|
pname = "ocrmypdf";
|
||||||
version = "9.2.0";
|
version = "9.5.0";
|
||||||
disabled = ! python3Packages.isPy3k;
|
disabled = ! python3Packages.isPy3k;
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "jbarlow83";
|
owner = "jbarlow83";
|
||||||
repo = "OCRmyPDF";
|
repo = "OCRmyPDF";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "1mvc6x5nn242z65pxv39ch71vaikgi89bb0sjbfy2jbw91vk41xa";
|
sha256 = "0rvwxykyscpcvfgm8zzyvjgzl9x9ddi9cxmqyxrc031mxpc0lzyy";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = with python3Packages; [
|
nativeBuildInputs = with python3Packages; [
|
||||||
@ -68,11 +69,12 @@ in buildPythonApplication rec {
|
|||||||
setuptools
|
setuptools
|
||||||
] ++ runtimeDeps;
|
] ++ runtimeDeps;
|
||||||
|
|
||||||
postPatch = ''
|
patches = [
|
||||||
substituteInPlace src/ocrmypdf/leptonica.py \
|
(substituteAll {
|
||||||
--replace "lept = ffi.dlopen(_libpath)" \
|
src = ./liblept.patch;
|
||||||
'lept = ffi.dlopen("${stdenv.lib.makeLibraryPath [leptonica]}/liblept${stdenv.hostPlatform.extensions.sharedLibrary}")'
|
liblept = "${stdenv.lib.getLib leptonica}/lib/liblept${stdenv.hostPlatform.extensions.sharedLibrary}";
|
||||||
'';
|
})
|
||||||
|
];
|
||||||
|
|
||||||
# The tests take potentially 20+ minutes, depending on machine
|
# The tests take potentially 20+ minutes, depending on machine
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
13
pkgs/tools/text/ocrmypdf/liblept.patch
Normal file
13
pkgs/tools/text/ocrmypdf/liblept.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/src/ocrmypdf/leptonica.py b/src/ocrmypdf/leptonica.py
|
||||||
|
index 328b063..b993cc9 100644
|
||||||
|
--- a/src/ocrmypdf/leptonica.py
|
||||||
|
+++ b/src/ocrmypdf/leptonica.py
|
||||||
|
@@ -46,7 +46,7 @@ if os.name == 'nt':
|
||||||
|
os.environ['PATH'] = shim_paths_with_program_files()
|
||||||
|
else:
|
||||||
|
libname = 'lept'
|
||||||
|
-_libpath = find_library(libname)
|
||||||
|
+_libpath = '@liblept@'
|
||||||
|
if not _libpath:
|
||||||
|
raise MissingDependencyError(
|
||||||
|
"""
|
Loading…
x
Reference in New Issue
Block a user