summary refs log tree commit diff
path: root/pkgs/applications/graphics/hdrmerge/default.nix
blob: a8db24c35283fc5741b44d1eaf616fd4297766b4 (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
72
73
74
{ lib
, mkDerivation
, fetchpatch
, fetchFromGitHub
, cmake
, qtbase
, wrapQtAppsHook
, libraw
, exiv2
, zlib
, alglib
, pkg-config
, makeDesktopItem
, copyDesktopItems
}:

mkDerivation rec {
  pname = "hdrmerge";
  version = "unstable-2023-01-04";
  src = fetchFromGitHub {
    owner = "jcelaya";
    repo = "hdrmerge";
    rev = "ca38b54f980564942a7f2b014a5f57a64c1d9019";
    hash = "sha256-DleYgpDXP0NvbmEURXnBfe3OYnT1CaQq+Mw93JQQprE=";
  };

  nativeBuildInputs = [
    cmake
    pkg-config
    wrapQtAppsHook
    copyDesktopItems
  ];

  buildInputs = [ qtbase libraw exiv2 zlib alglib ];

  cmakeFlags = [
    "-DALGLIB_DIR:PATH=${alglib}"
  ];

  patches = [
    # https://github.com/jcelaya/hdrmerge/pull/222
    (fetchpatch {
      name = "exiv2-0.28.patch";
      url = "https://github.com/jcelaya/hdrmerge/commit/377d8e6f3c7cdd1a45b63bce2493ad177dde03fb.patch";
      hash = "sha256-lXHML6zGkVeWKvmY5ECoJL2xjmtZz77XJd5prpgJiZo=";
    })
  ];

  desktopItems = [
    (makeDesktopItem {
      name = "HDRMerge";
      genericName = "HDR raw image merge";
      desktopName = "HDRMerge";
      comment = meta.description;
      icon = "hdrmerge";
      exec = "hdrmerge %F";
      categories = [ "Graphics" ];
      mimeTypes = [ "image/x-dcraw" "image/x-adobe-dng" ];
      terminal = false;
    })
  ];

  postInstall = ''
    install -Dm444 ../data/images/icon.png $out/share/icons/hicolor/128x128/apps/hdrmerge.png
  '';

  meta = with lib; {
    homepage = "https://github.com/jcelaya/hdrmerge";
    description = "Combines two or more raw images into an HDR";
    license = licenses.gpl3Plus;
    platforms = platforms.linux;
    maintainers = [ maintainers.paperdigits ];
  };
}