summary refs log tree commit diff
path: root/pkgs/applications/graphics/photoqt/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/graphics/photoqt/default.nix')
-rw-r--r--pkgs/applications/graphics/photoqt/default.nix75
1 files changed, 62 insertions, 13 deletions
diff --git a/pkgs/applications/graphics/photoqt/default.nix b/pkgs/applications/graphics/photoqt/default.nix
index 3b17ce8fd4f..9513b92f60a 100644
--- a/pkgs/applications/graphics/photoqt/default.nix
+++ b/pkgs/applications/graphics/photoqt/default.nix
@@ -1,28 +1,75 @@
-{ mkDerivation, lib, fetchurl, cmake, exiv2, graphicsmagick, libraw
-, qtbase, qtdeclarative, qtmultimedia, qtquickcontrols2, qttools, qtgraphicaleffects
-, extra-cmake-modules, poppler, kimageformats, libarchive, pugixml, wrapQtAppsHook}:
+{ lib
+, stdenv
+, fetchurl
+, cmake
+, extra-cmake-modules
+, qttools
+, wrapQtAppsHook
+, exiv2
+, graphicsmagick
+, kimageformats
+, libarchive
+, libraw
+, mpv
+, poppler
+, pugixml
+, qtbase
+, qtdeclarative
+, qtgraphicaleffects
+, qtmultimedia
+, qtquickcontrols
+, qtquickcontrols2
+}:
 
-mkDerivation rec {
+stdenv.mkDerivation rec {
   pname = "photoqt";
-  version = "3.1";
+  version = "3.4";
 
   src = fetchurl {
-    url = "https://${pname}.org/pkgs/${pname}-${version}.tar.gz";
-    hash = "sha256-hihfqE7XIlSAxPg3Kzld3LrYS97wDH//GGqpBpBwFm0=";
+    url = "https://photoqt.org/pkgs/photoqt-${version}.tar.gz";
+    hash = "sha256-kVf9+zI9rtEMmS0N4qrN673T/1fnqfcV3hQPnMXMLas=";
   };
 
-  nativeBuildInputs = [ cmake extra-cmake-modules qttools wrapQtAppsHook ];
+  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 = [
-    qtbase qtquickcontrols2 exiv2 graphicsmagick poppler
-    qtmultimedia qtdeclarative libraw qtgraphicaleffects
-    kimageformats libarchive pugixml
+    exiv2
+    graphicsmagick
+    kimageformats
+    libarchive
+    libraw
+    mpv
+    poppler
+    pugixml
+    qtbase
+    qtdeclarative
+    qtgraphicaleffects
+    qtmultimedia
+    qtquickcontrols
+    qtquickcontrols2
   ];
 
   cmakeFlags = [
-    "-DFREEIMAGE=OFF"
     "-DDEVIL=OFF"
     "-DCHROMECAST=OFF"
+    "-DFREEIMAGE=OFF"
+    "-DIMAGEMAGICK=OFF"
   ];
 
   preConfigure = ''
@@ -30,9 +77,11 @@ mkDerivation rec {
   '';
 
   meta = {
-    homepage = "https://photoqt.org/";
     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;
   };
 }