k2pdfopt: set env var to find OCR language files

This commit is contained in:
Daniel Fullmer 2020-08-28 20:17:13 -07:00
parent 8bdcaa713d
commit 5f29d7e9a5

View File

@ -1,5 +1,5 @@
{ stdenv, runCommand, fetchzip, fetchurl, fetchpatch, fetchFromGitHub
, cmake, pkgconfig, zlib, libpng
, cmake, pkgconfig, zlib, libpng, makeWrapper
, enableGSL ? true, gsl
, enableGhostScript ? true, ghostscript
, enableMuPDF ? true, mupdf
@ -71,7 +71,7 @@ in stdenv.mkDerivation rec {
--replace "<djvu.h>" "<libdjvu/ddjvuapi.h>"
'';
nativeBuildInputs = [ cmake pkgconfig ];
nativeBuildInputs = [ cmake pkgconfig makeWrapper ];
buildInputs =
let
@ -159,6 +159,10 @@ in stdenv.mkDerivation rec {
install -D -m 755 k2pdfopt $out/bin/k2pdfopt
'';
preFixup = optionalString enableTesseract ''
wrapProgram $out/bin/k2pdfopt --set-default TESSDATA_PREFIX ${tesseract4}/share/tessdata
'';
meta = with stdenv.lib; {
description = "Optimizes PDF/DJVU files for mobile e-readers (e.g. the Kindle) and smartphones";
homepage = "http://www.willus.com/k2pdfopt";