python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / applications / graphics / ocrfeeder / default.nix
blob9e516f211069dba9f4a16deff21767dae583ca24
1 { lib, stdenv
2 , fetchurl
3 , pkg-config
4 , gtk3
5 , gtkspell3
6 , isocodes
7 , goocanvas2
8 , intltool
9 , itstool
10 , libxml2
11 , gnome
12 , python3
13 , gobject-introspection
14 , wrapGAppsHook
15 , tesseract4
16 , extraOcrEngines ? [] # other supported engines are: ocrad gocr cuneiform
19 stdenv.mkDerivation rec {
20   pname = "ocrfeeder";
21   version = "0.8.5";
23   src = fetchurl {
24     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
25     sha256 = "sha256-sD0qWUndguJzTw0uy0FIqupFf4OX6dTFvcd+Mz+8Su0=";
26   };
28   nativeBuildInputs = [
29     pkg-config
30     wrapGAppsHook
31     intltool
32     itstool
33     libxml2
34   ];
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   patches = [
52     # Compiles, but doesn't launch without this, see:
53     # https://gitlab.gnome.org/GNOME/ocrfeeder/-/issues/83
54     ./fix-launch.diff
55   ];
57   enginesPath = lib.makeBinPath ([
58     tesseract4
59   ] ++ extraOcrEngines);
61   preFixup = ''
62     gappsWrapperArgs+=(--prefix PATH : "${enginesPath}")
63     gappsWrapperArgs+=(--set ISO_CODES_DIR "${isocodes}/share/xml/iso-codes")
64   '';
66   meta = with 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   };