about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/applications/graphics/qimgv/default.nix44
1 files changed, 26 insertions, 18 deletions
diff --git a/pkgs/applications/graphics/qimgv/default.nix b/pkgs/applications/graphics/qimgv/default.nix
index 6402868b9221..2756d659edf3 100644
--- a/pkgs/applications/graphics/qimgv/default.nix
+++ b/pkgs/applications/graphics/qimgv/default.nix
@@ -1,6 +1,15 @@
-{ mkDerivation, fetchFromGitHub, lib
-, pkgconfig, cmake
-, exiv2, qtbase, qtimageformats, qtsvg
+{ mkDerivation
+, lib
+, fetchFromGitHub
+
+, cmake
+, pkgconfig
+
+, exiv2
+, mpv
+, qtbase
+, qtimageformats
+, qtsvg
 }:
 
 mkDerivation rec {
@@ -14,33 +23,32 @@ mkDerivation rec {
     sha256 = "0cmya06j466v0pirhxbzbj1vbz0346y7rbc1gbv4n9xcp6c6bln6";
   };
 
-  cmakeFlags = [
-    # Video support appears to be broken; the following gets printed upon
-    # attempting to view an mp4, webm, or mkv (and probably all video formats):
-    #
-    #   [VideoPlayerInitProxy] Error - could not load player library
-    #   "qimgv_player_mpv"
-    #
-    # GIFs are unaffected. If this ever gets addressed, all that is necessary is
-    # to add `mpv` to the arguments list and to `buildInputs`, and to remove
-    # `cmakeFlags`.
-    "-DVIDEO_SUPPORT=OFF"
-  ];
-
   nativeBuildInputs = [
-    pkgconfig
     cmake
+    pkgconfig
   ];
 
   buildInputs = [
     exiv2
+    mpv
     qtbase
     qtimageformats
     qtsvg
   ];
 
+  postPatch = ''
+    sed -i "s@/usr/bin/mpv@${mpv}/bin/mpv@" \
+      qimgv/settings.cpp
+  '';
+
+  # Wrap the library path so it can see `libqimgv_player_mpv.so`, which is used
+  # to play video files within qimgv itself.
+  qtWrapperArgs = [
+    "--prefix LD_LIBRARY_PATH : ${placeholder "out"}/lib"
+  ];
+
   meta = with lib; {
-    description = "Qt5 image viewer with optional video support";
+    description = "A Qt5 image viewer with optional video support";
     homepage = "https://github.com/easymodo/qimgv";
     license = licenses.gpl3;
     platforms = platforms.linux;