2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-12-05 12:14:20 +00:00
|
|
|
, fetchurl
|
|
|
|
, pkg-config
|
2023-09-21 08:31:17 +00:00
|
|
|
, wrapGAppsHook
|
2020-12-05 12:14:20 +00:00
|
|
|
, intltool
|
|
|
|
, itstool
|
|
|
|
, libxml2
|
2023-09-21 08:31:17 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, gtk3
|
|
|
|
, goocanvas2
|
|
|
|
, gtkspell3
|
|
|
|
, isocodes
|
2021-05-07 21:18:14 +00:00
|
|
|
, gnome
|
2020-12-05 12:14:20 +00:00
|
|
|
, python3
|
|
|
|
, tesseract4
|
|
|
|
, extraOcrEngines ? [] # other supported engines are: ocrad gocr cuneiform
|
|
|
|
}:
|
|
|
|
|
2023-09-21 08:31:17 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-12-05 12:14:20 +00:00
|
|
|
pname = "ocrfeeder";
|
2022-04-01 05:45:47 +00:00
|
|
|
version = "0.8.5";
|
2020-12-05 12:14:20 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-09-21 08:31:17 +00:00
|
|
|
url = "mirror://gnome/sources/${finalAttrs.pname}/${lib.versions.majorMinor finalAttrs.version}/${finalAttrs.pname}-${finalAttrs.version}.tar.xz";
|
2022-04-01 05:45:47 +00:00
|
|
|
sha256 = "sha256-sD0qWUndguJzTw0uy0FIqupFf4OX6dTFvcd+Mz+8Su0=";
|
2020-12-05 12:14:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
wrapGAppsHook
|
|
|
|
intltool
|
|
|
|
itstool
|
|
|
|
libxml2
|
2023-06-22 11:49:31 +00:00
|
|
|
gobject-introspection
|
2020-12-05 12:14:20 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gtk3
|
|
|
|
goocanvas2
|
|
|
|
gtkspell3
|
|
|
|
isocodes
|
|
|
|
(python3.withPackages(ps: with ps; [
|
|
|
|
pyenchant
|
|
|
|
sane
|
|
|
|
pillow
|
|
|
|
reportlab
|
|
|
|
odfpy
|
|
|
|
pygobject3
|
|
|
|
]))
|
|
|
|
];
|
2022-07-01 15:21:36 +00:00
|
|
|
patches = [
|
|
|
|
# Compiles, but doesn't launch without this, see:
|
|
|
|
# https://gitlab.gnome.org/GNOME/ocrfeeder/-/issues/83
|
|
|
|
./fix-launch.diff
|
|
|
|
];
|
2020-12-05 12:14:20 +00:00
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
enginesPath = lib.makeBinPath ([
|
2020-12-05 12:14:20 +00:00
|
|
|
tesseract4
|
|
|
|
] ++ extraOcrEngines);
|
|
|
|
|
|
|
|
preFixup = ''
|
2023-09-21 08:31:17 +00:00
|
|
|
gappsWrapperArgs+=(--prefix PATH : "${finalAttrs.enginesPath}")
|
2022-04-01 05:45:47 +00:00
|
|
|
gappsWrapperArgs+=(--set ISO_CODES_DIR "${isocodes}/share/xml/iso-codes")
|
2020-12-05 12:14:20 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
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;
|
|
|
|
};
|
2023-09-21 08:31:17 +00:00
|
|
|
})
|