nixpkgs/pkgs/applications/graphics/ocrfeeder/default.nix

74 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, stdenv
2020-12-05 12:14:20 +00:00
, fetchurl
, pkg-config
, gtk3
, gtkspell3
, isocodes
, goocanvas2
, intltool
, itstool
, libxml2
, gnome3
, python3
, gobject-introspection
, wrapGAppsHook
, tesseract4
, extraOcrEngines ? [] # other supported engines are: ocrad gocr cuneiform
}:
stdenv.mkDerivation rec {
pname = "ocrfeeder";
version = "0.8.3";
src = fetchurl {
2021-01-15 13:21:58 +00:00
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
2020-12-05 12:14:20 +00:00
sha256 = "12f5gnq92ffnd5zaj04df7jrnsdz1zn4zcgpbf5p9qnd21i2y529";
};
nativeBuildInputs = [
pkg-config
wrapGAppsHook
intltool
itstool
libxml2
];
buildInputs = [
gtk3
gobject-introspection
goocanvas2
gtkspell3
isocodes
(python3.withPackages(ps: with ps; [
pyenchant
sane
pillow
reportlab
odfpy
pygobject3
]))
];
# https://gitlab.gnome.org/GNOME/ocrfeeder/-/issues/22
postConfigure = ''
substituteInPlace src/ocrfeeder/util/constants.py \
--replace /usr/share/xml/iso-codes ${isocodes}/share/xml/iso-codes
'';
2021-01-15 13:21:58 +00:00
enginesPath = lib.makeBinPath ([
2020-12-05 12:14:20 +00:00
tesseract4
] ++ extraOcrEngines);
preFixup = ''
gappsWrapperArgs+=(--prefix PATH : "${enginesPath}")
'';
meta = with lib; {
2020-12-05 12:14:20 +00:00
homepage = "https://wiki.gnome.org/Apps/OCRFeeder";
description = "Complete Optical Character Recognition and Document Analysis and Recognition program";
maintainers = with maintainers; [ doronbehar ];
license = licenses.gpl3Plus;
platforms = platforms.linux;
};
}