Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / graphics / photoqt / default.nix
blob9513b92f60ac59cc379ffd591f620454b1351c83
1 { lib
2 , stdenv
3 , fetchurl
4 , cmake
5 , extra-cmake-modules
6 , qttools
7 , wrapQtAppsHook
8 , exiv2
9 , graphicsmagick
10 , kimageformats
11 , libarchive
12 , libraw
13 , mpv
14 , poppler
15 , pugixml
16 , qtbase
17 , qtdeclarative
18 , qtgraphicaleffects
19 , qtmultimedia
20 , qtquickcontrols
21 , qtquickcontrols2
24 stdenv.mkDerivation rec {
25   pname = "photoqt";
26   version = "3.4";
28   src = fetchurl {
29     url = "https://photoqt.org/pkgs/photoqt-${version}.tar.gz";
30     hash = "sha256-kVf9+zI9rtEMmS0N4qrN673T/1fnqfcV3hQPnMXMLas=";
31   };
33   postPatch = ''
34     # exiv2 0.28.1
35     substituteInPlace CMakeLists.txt \
36       --replace "exiv2lib" "exiv2"
37   ''
38   # error: no member named 'setlocale' in namespace 'std'; did you mean simply 'setlocale'?
39   + lib.optionalString stdenv.isDarwin ''
40     substituteInPlace cplusplus/main.cpp \
41       --replace "std::setlocale" "setlocale"
42   '';
44   nativeBuildInputs = [
45     cmake
46     extra-cmake-modules
47     qttools
48     wrapQtAppsHook
49   ];
51   buildInputs = [
52     exiv2
53     graphicsmagick
54     kimageformats
55     libarchive
56     libraw
57     mpv
58     poppler
59     pugixml
60     qtbase
61     qtdeclarative
62     qtgraphicaleffects
63     qtmultimedia
64     qtquickcontrols
65     qtquickcontrols2
66   ];
68   cmakeFlags = [
69     "-DDEVIL=OFF"
70     "-DCHROMECAST=OFF"
71     "-DFREEIMAGE=OFF"
72     "-DIMAGEMAGICK=OFF"
73   ];
75   preConfigure = ''
76     export MAGICK_LOCATION="${graphicsmagick}/include/GraphicsMagick"
77   '';
79   meta = {
80     description = "Simple, yet powerful and good looking image viewer";
81     homepage = "https://photoqt.org/";
82     license = lib.licenses.gpl2Plus;
83     mainProgram = "photoqt";
84     maintainers = with lib.maintainers; [ wegank ];
85     platforms = lib.platforms.unix;
86   };