Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: be25ee9d21be
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a61db03041a7
Choose a head ref
  • 5 commits
  • 2 files changed
  • 2 contributors

Commits on Jan 11, 2020

  1. ocrmypdf: 9.2.0 -> 9.4.0

    dtzWill committed Jan 11, 2020
    Copy the full SHA
    1cab255 View commit details

Commits on Jan 12, 2020

  1. Copy the full SHA
    24c14a8 View commit details

Commits on Jan 22, 2020

  1. Copy the full SHA
    6b19378 View commit details
  2. ocrmypdf: 9.4.0 -> 9.5.0

    dtzWill committed Jan 22, 2020
    Copy the full SHA
    61381b2 View commit details
  3. Merge pull request #77494 from dtzWill/update/ocrmypdf-9.4.0

    ocrmypdf: 9.2.0 -> 9.5.0
    flokli authored Jan 22, 2020
    Copy the full SHA
    a61db03 View commit details
Showing with 22 additions and 7 deletions.
  1. +9 −7 pkgs/tools/text/ocrmypdf/default.nix
  2. +13 −0 pkgs/tools/text/ocrmypdf/liblept.patch
16 changes: 9 additions & 7 deletions pkgs/tools/text/ocrmypdf/default.nix
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
, stdenv
, tesseract4
, unpaper
, substituteAll
}:

let
@@ -28,14 +29,14 @@ let

in buildPythonApplication rec {
pname = "ocrmypdf";
version = "9.2.0";
version = "9.5.0";
disabled = ! python3Packages.isPy3k;

src = fetchFromGitHub {
owner = "jbarlow83";
repo = "OCRmyPDF";
rev = "v${version}";
sha256 = "1mvc6x5nn242z65pxv39ch71vaikgi89bb0sjbfy2jbw91vk41xa";
sha256 = "0rvwxykyscpcvfgm8zzyvjgzl9x9ddi9cxmqyxrc031mxpc0lzyy";
};

nativeBuildInputs = with python3Packages; [
@@ -68,11 +69,12 @@ in buildPythonApplication rec {
setuptools
] ++ runtimeDeps;

postPatch = ''
substituteInPlace src/ocrmypdf/leptonica.py \
--replace "lept = ffi.dlopen(_libpath)" \
'lept = ffi.dlopen("${stdenv.lib.makeLibraryPath [leptonica]}/liblept${stdenv.hostPlatform.extensions.sharedLibrary}")'
'';
patches = [
(substituteAll {
src = ./liblept.patch;
liblept = "${stdenv.lib.getLib leptonica}/lib/liblept${stdenv.hostPlatform.extensions.sharedLibrary}";
})
];

# The tests take potentially 20+ minutes, depending on machine
doCheck = false;
13 changes: 13 additions & 0 deletions pkgs/tools/text/ocrmypdf/liblept.patch
Original file line number Diff line number Diff line change
@@ -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(
"""