git.iko.soy/typeable/nixpkgs
on master help sign in
ocrfeeder: init at 0.8.3
commitcc7ce7611924425b4f269da7a9bc3ca7d3ac8514 authorDoron Behar <doron.behar@gmail.com> dateSat 5 Dec 2020, 14:14 (6 years ago) parent5d7ef92
2 files changed+75
pkgs/applications/graphics/ocrfeeder/default.nix+73 pkgs/top-level/all-packages.nix+2
pkgs/applications/graphics/ocrfeeder/default.nixnew file+73
@@ -0,0 +1,73 @@
1+{ stdenv
2+, fetchurl
3+, pkg-config
4+, gtk3
5+, gtkspell3
6+, isocodes
7+, goocanvas2
8+, intltool
9+, itstool
10+, libxml2
11+, gnome3
12+, python3
13+, gobject-introspection
14+, wrapGAppsHook
15+, tesseract4
16+, extraOcrEngines ? [] # other supported engines are: ocrad gocr cuneiform
17+}:
18+
19+stdenv.mkDerivation rec {
20+ pname = "ocrfeeder";
21+ version = "0.8.3";
22+
23+ src = fetchurl {
24+ url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
25+ sha256 = "12f5gnq92ffnd5zaj04df7jrnsdz1zn4zcgpbf5p9qnd21i2y529";
26+ };
27+
28+ nativeBuildInputs = [
29+ pkg-config
30+ wrapGAppsHook
31+ intltool
32+ itstool
33+ libxml2
34+ ];
35+
36+ buildInputs = [
37+ gtk3
38+ gobject-introspection
39+ goocanvas2
40+ gtkspell3
41+ isocodes
42+ (python3.withPackages(ps: with ps; [
43+ pyenchant
44+ sane
45+ pillow
46+ reportlab
47+ odfpy
48+ pygobject3
49+ ]))
50+ ];
51+
52+ # https://gitlab.gnome.org/GNOME/ocrfeeder/-/issues/22
53+ postConfigure = ''
54+ substituteInPlace src/ocrfeeder/util/constants.py \
55+ --replace /usr/share/xml/iso-codes ${isocodes}/share/xml/iso-codes
56+ '';
57+
58+ enginesPath = stdenv.lib.makeBinPath ([
59+ tesseract4
60+ ] ++ extraOcrEngines);
61+
62+ preFixup = ''
63+ gappsWrapperArgs+=(--prefix PATH : "${enginesPath}")
64+ '';
65+
66+ meta = with stdenv.lib; {
67+ homepage = "https://wiki.gnome.org/Apps/OCRFeeder";
68+ description = "Complete Optical Character Recognition and Document Analysis and Recognition program";
69+ maintainers = with maintainers; [ doronbehar ];
70+ license = licenses.gpl3Plus;
71+ platforms = platforms.linux;
72+ };
73+}
pkgs/top-level/all-packages.nix+2
@@ -2460,6 +2460,8 @@ in
24602460
24612461 ocrmypdf = callPackage ../tools/text/ocrmypdf { };
24622462
2463+ ocrfeeder = callPackage ../applications/graphics/ocrfeeder { };
2464+
24632465 onboard = callPackage ../applications/misc/onboard { };
24642466
24652467 oneshot = callPackage ../tools/networking/oneshot { };