1{
2 lib,
3 cmake,
4 exiv2,
5 extra-cmake-modules,
6 fetchFromGitLab,
7 imagemagick,
8 libarchive,
9 libdevil,
10 libraw,
11 mpv,
12 pkg-config,
13 qt6Packages,
14 resvg,
15 stdenv,
16 vips,
17}:
18
19stdenv.mkDerivation (finalAttrs: {
20 pname = "previewqt";
21 version = "4.0";
22
23 src = fetchFromGitLab {
24 owner = "lspies";
25 repo = "previewqt";
26 tag = "v${finalAttrs.version}";
27 hash = "sha256-wzMo5igLTVxUo3E8X2mRbOTuhW3CS4fISgVntgPbZlY=";
28 };
29
30 nativeBuildInputs = [
31 cmake
32 extra-cmake-modules
33 pkg-config
34 qt6Packages.wrapQtAppsHook
35 ];
36
37 buildInputs = [
38 exiv2
39 imagemagick
40 libarchive
41 libdevil
42 libraw
43 mpv
44 resvg
45 vips
46 ]
47 ++ [
48 qt6Packages.poppler
49 qt6Packages.qtmultimedia
50 qt6Packages.qtquick3d
51 qt6Packages.qtsvg
52 qt6Packages.qttools
53 qt6Packages.qtwebengine
54 ];
55
56 strictDeps = true;
57
58 cmakeFlags = [
59 (lib.cmakeBool "WITH_FREEIMAGE" false)
60 ];
61
62 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
63 mkdir -p $out/Applications
64 mv $out/bin/previewqt.app $out/Applications
65 makeWrapper $out/{Applications/previewqt.app/Contents/MacOS,bin}/previewqt
66 '';
67
68 meta = {
69 homepage = "https://previewqt.org/";
70 description = "Qt-based file previewer";
71 longDescription = ''
72 PhotoQt is an image viewer that provides a simple and uncluttered
73 interface. Yet, hidden beneath the surface awaits a large array of
74 features. Here are some of its main features (not an exhaustive
75 list). Suggestions for new features are always welcome.
76
77 - Support of ImageMagick/GraphicsMagick, Libraw, FreeImage, DevIL,
78 libvips, Poppler, libarchive, and video files.
79 - Touchscreen support
80 - Support for Motion Photos and Apple Live Photos
81 - Support for (partial) photo spheres and 360 degree panoramas using
82 equirectangular projection
83 - Explore images on an interactive map according to their embedded GPS
84 location
85 - Chromecast support
86 - Basic image manipulations
87 - Convert images between formats
88 - Keyboard and mouse shortcuts
89 - Upload images directly to imgur.com
90 - Set image as wallpaper directly from inside PhotoQt
91 - Slideshow feature
92 - Display Exif information (including tagging of faces)
93 - Detect and display bar codes and QR codes in images
94 - Thumbnail Cache
95 - System Tray Usage
96 - Command Line Options
97 - Several translations available (help wanted)
98 - and much more...
99 '';
100 changelog = "https://gitlab.com/lspies/previewqt/-/blob/v${finalAttrs.version}/CHANGELOG";
101 license = lib.licenses.gpl2Plus;
102 mainProgram = "previewqt";
103 maintainers = with lib.maintainers; [ wegank ];
104 platforms = lib.platforms.unix;
105 };
106})