about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/graphics/photoqt/default.nix
blob: 9513b92f60ac59cc379ffd591f620454b1351c83 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
{ lib
, stdenv
, fetchurl
, cmake
, extra-cmake-modules
, qttools
, wrapQtAppsHook
, exiv2
, graphicsmagick
, kimageformats
, libarchive
, libraw
, mpv
, poppler
, pugixml
, qtbase
, qtdeclarative
, qtgraphicaleffects
, qtmultimedia
, qtquickcontrols
, qtquickcontrols2
}:

stdenv.mkDerivation rec {
  pname = "photoqt";
  version = "3.4";

  src = fetchurl {
    url = "https://photoqt.org/pkgs/photoqt-${version}.tar.gz";
    hash = "sha256-kVf9+zI9rtEMmS0N4qrN673T/1fnqfcV3hQPnMXMLas=";
  };

  postPatch = ''
    # exiv2 0.28.1
    substituteInPlace CMakeLists.txt \
      --replace "exiv2lib" "exiv2"
  ''
  # error: no member named 'setlocale' in namespace 'std'; did you mean simply 'setlocale'?
  + lib.optionalString stdenv.isDarwin ''
    substituteInPlace cplusplus/main.cpp \
      --replace "std::setlocale" "setlocale"
  '';

  nativeBuildInputs = [
    cmake
    extra-cmake-modules
    qttools
    wrapQtAppsHook
  ];

  buildInputs = [
    exiv2
    graphicsmagick
    kimageformats
    libarchive
    libraw
    mpv
    poppler
    pugixml
    qtbase
    qtdeclarative
    qtgraphicaleffects
    qtmultimedia
    qtquickcontrols
    qtquickcontrols2
  ];

  cmakeFlags = [
    "-DDEVIL=OFF"
    "-DCHROMECAST=OFF"
    "-DFREEIMAGE=OFF"
    "-DIMAGEMAGICK=OFF"
  ];

  preConfigure = ''
    export MAGICK_LOCATION="${graphicsmagick}/include/GraphicsMagick"
  '';

  meta = {
    description = "Simple, yet powerful and good looking image viewer";
    homepage = "https://photoqt.org/";
    license = lib.licenses.gpl2Plus;
    mainProgram = "photoqt";
    maintainers = with lib.maintainers; [ wegank ];
    platforms = lib.platforms.unix;
  };
}