summary refs log tree commit diff
path: root/pkgs/applications/misc/gImageReader/default.nix
blob: 16693cfbf09c36b283746a0a2658d1192c0afa1e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{ stdenv, fetchFromGitHub, cmake, pkgconfig, libuuid
, sane-backends, podofo, libjpeg, djvulibre, libxmlxx3, libzip, tesseract
, enchant, intltool, poppler, json-glib
, ninja
, python3

# Gtk deps
# upstream gImagereader supports Qt too
, gtk3, gobjectIntrospection, wrapGAppsHook
, gnome3, gtkspell3, gtkspellmm, cairomm
}:

let
  variant = "gtk";
  pythonEnv = python3.withPackages( ps: with ps;[ pygobject3 ] );
in
stdenv.mkDerivation rec {
  name = "gImageReader-${version}";
  version = "3.2.99";

  src = fetchFromGitHub {
    owner= "manisandro";
    repo = "gImageReader";
    rev = "v${version}";
    sha256 = "19dbxq83j77lbvi10a8x0xxgw5hbsqyc852c196zzvmwk3km6pnc";
  };

  nativeBuildInputs = [
    cmake ninja
    intltool
    pkgconfig
    pythonEnv

    # Gtk specific
    wrapGAppsHook
    gobjectIntrospection
  ];

  buildInputs = [
    enchant
    libxmlxx3
    libzip
    libuuid
    sane-backends
    podofo
    libjpeg
    djvulibre
    tesseract
    poppler

    # Gtk specific
    gnome3.gtkmm
    gtkspell3
    gtkspellmm
    gnome3.gtksourceview
    gnome3.gtksourceviewmm
    cairomm
    json-glib
  ];

  # interface type can be where <type> is either gtk, qt5, qt4
  cmakeFlags = [ "-DINTERFACE_TYPE=${variant}" ];

  meta = with stdenv.lib; {
    description = "A simple Gtk/Qt front-end to tesseract-ocr";
    homepage = https://github.com/manisandro/gImageReader;
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [teto];
    platforms = platforms.linux;
  };
}