Merge pull request #84939 from doronbehar/package-ocrfeeder

This commit is contained in:
Doron Behar 2020-12-30 08:49:15 +02:00 committed by GitHub
commit f6188ca545
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 106 additions and 0 deletions

View file

@ -0,0 +1,73 @@
{ stdenv
, 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 {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
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
'';
enginesPath = stdenv.lib.makeBinPath ([
tesseract4
] ++ extraOcrEngines);
preFixup = ''
gappsWrapperArgs+=(--prefix PATH : "${enginesPath}")
'';
meta = with stdenv.lib; {
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;
};
}

View file

@ -0,0 +1,27 @@
{ lib
, buildPythonPackage
, fetchPypi
, saneBackends
}:
buildPythonPackage rec {
pname = "sane";
version = "2.8.2";
src = fetchPypi {
inherit version;
pname = "python-sane";
sha256 = "0sri01h9sld6w7vgfhwp29n5w19g6idz01ba2giwnkd99k1y2iqg";
};
buildInputs = [
saneBackends
];
meta = with lib; {
homepage = "https://github.com/python-pillow/Sane";
description = "Python interface to the SANE scanner and frame grabber ";
license = licenses.mit;
maintainers = with maintainers; [ doronbehar ];
};
}

View file

@ -2515,6 +2515,8 @@ in
ocrmypdf = callPackage ../tools/text/ocrmypdf { };
ocrfeeder = callPackage ../applications/graphics/ocrfeeder { };
onboard = callPackage ../applications/misc/onboard { };
oneshot = callPackage ../tools/networking/oneshot { };

View file

@ -6562,6 +6562,10 @@ in {
salmon-mail = callPackage ../development/python-modules/salmon-mail { };
sane = callPackage ../development/python-modules/sane {
inherit (pkgs) saneBackends;
};
sampledata = callPackage ../development/python-modules/sampledata { };
samplerate = callPackage ../development/python-modules/samplerate { };