summary refs log tree commit diff
path: root/pkgs/applications/graphics/scantailor/advanced.nix
blob: 82a4989687285309cc255a9add8242f74a146f35 (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
{ stdenv, fetchFromGitHub, makeDesktopItem
, cmake, libjpeg, libpng, libtiff, boost
, qtbase, qttools }:

stdenv.mkDerivation rec {
  name = "scantailor-advanced-${version}";
  version = "1.0.15";

  src = fetchFromGitHub {
    owner = "4lex4";
    repo = "scantailor-advanced";
    rev = "v${version}";
    sha256 = "031jqk64ig6lmscl5yg5lp116zwn0jl7xs9rlniqf6a8g4wfbjk9";
  };

  nativeBuildInputs = [ cmake qttools ];
  buildInputs = [ libjpeg libpng libtiff boost qtbase ];

  postInstall = ''
    mkdir -p $out/share/icons/hicolor/scalable/apps
    cp $src/resources/appicon.svg $out/share/icons/hicolor/scalable/apps/scantailor.svg

    mkdir -p $out/share/applications
    cp $desktopItem/share/applications/* $out/share/applications/
    for entry in $out/share/applications/*.desktop; do
      substituteAllInPlace $entry
    done
  '';

  desktopItem = makeDesktopItem {
    name = "scantailor-advanced";
    exec = "scantailor %f";
    icon = "scantailor";
    comment = meta.description;
    desktopName = "Scan Tailor Advanced";
    genericName = "Scan Processing Software";
    mimeType = "image/png;image/tif;image/jpeg;";
    categories = "Graphics;";
    startupNotify = "true";
  };

  meta = with stdenv.lib; {
    homepage = https://github.com/4lex4/scantailor-advanced;
    description = "Interactive post-processing tool for scanned pages";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ jfrankenau ];
    platforms = platforms.gnu ++ platforms.linux;
  };
}