about summary refs log tree commit diff
path: root/pkgs/applications/graphics
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2024-03-02 11:58:50 -0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2024-03-07 22:28:19 -0300
commitc9ba5272c52c65e4484c797e03b3bf2eb4c54024 (patch)
tree8b58d111626e5b0863fc74ee48ba8ea50eacab53 /pkgs/applications/graphics
parentc8cd65298e567e1e604431e4544361e365410f8c (diff)
downloadnixlib-c9ba5272c52c65e4484c797e03b3bf2eb4c54024.tar
nixlib-c9ba5272c52c65e4484c797e03b3bf2eb4c54024.tar.gz
nixlib-c9ba5272c52c65e4484c797e03b3bf2eb4c54024.tar.bz2
nixlib-c9ba5272c52c65e4484c797e03b3bf2eb4c54024.tar.lz
nixlib-c9ba5272c52c65e4484c797e03b3bf2eb4c54024.tar.xz
nixlib-c9ba5272c52c65e4484c797e03b3bf2eb4c54024.tar.zst
nixlib-c9ba5272c52c65e4484c797e03b3bf2eb4c54024.zip
nomacs: refactor
- get rid of libsForQt5.callPackage
- finalAttrs design pattern to get rid of rec
- set src.fetchSubmodules to false (to avoid vendoring)
- split outputs
- sourceRoot
- meta
  - changelog
  - longDescription
  - mainProgram
- add AndersonTorres to maintainers
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r--pkgs/applications/graphics/nomacs/default.nix99
1 files changed, 59 insertions, 40 deletions
diff --git a/pkgs/applications/graphics/nomacs/default.nix b/pkgs/applications/graphics/nomacs/default.nix
index a5898a3ac007..b39b2b2de9f2 100644
--- a/pkgs/applications/graphics/nomacs/default.nix
+++ b/pkgs/applications/graphics/nomacs/default.nix
@@ -1,68 +1,87 @@
 { lib
-, stdenv
-, fetchFromGitHub
 , cmake
-, pkg-config
-, wrapQtAppsHook
-
-, qtbase
-, qttools
-, qtsvg
-, qtimageformats
-
 , exiv2
-, opencv4
+, fetchFromGitHub
 , libraw
+, libsForQt5
 , libtiff
-, quazip
+, opencv4
+, pkg-config
+, stdenv
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "nomacs";
   version = "3.17.2287";
 
   src = fetchFromGitHub {
     owner = "nomacs";
     repo = "nomacs";
-    rev = version;
+    rev = finalAttrs.version;
+    fetchSubmodules = false; # We'll use our own
     hash = "sha256-OwiMB6O4+WuAt87sRbD1Qby3U7igqgCgddiWs3a4j3k=";
   };
 
-  setSourceRoot = ''
-    sourceRoot=$(echo */ImageLounge)
-  '';
+  outputs = [ "out" "man" ];
+
+  sourceRoot = "${finalAttrs.src.name}/ImageLounge";
 
-  nativeBuildInputs = [cmake
-                       pkg-config
-                       wrapQtAppsHook];
+  nativeBuildInputs = [
+    cmake
+    libsForQt5.wrapQtAppsHook
+    pkg-config
+  ];
 
-  buildInputs = [qtbase
-                 qttools
-                 qtsvg
-                 qtimageformats
-                 exiv2
-                 opencv4
-                 libraw
-                 libtiff
-                 quazip];
+  buildInputs = [
+    exiv2
+    libraw
+    libtiff
+    opencv4
+  ] ++ (with libsForQt5; [
+    qtbase
+    qtimageformats
+    qtsvg
+    qttools
+    quazip
+  ]);
 
-  cmakeFlags = ["-DENABLE_OPENCV=ON"
-                "-DENABLE_RAW=ON"
-                "-DENABLE_TIFF=ON"
-                "-DENABLE_QUAZIP=ON"
-                "-DENABLE_TRANSLATIONS=ON"
-                "-DUSE_SYSTEM_QUAZIP=ON"];
+  cmakeFlags = [
+    (lib.cmakeBool "ENABLE_OPENCV" true)
+    (lib.cmakeBool "ENABLE_QUAZIP" true)
+    (lib.cmakeBool "ENABLE_RAW" true)
+    (lib.cmakeBool "ENABLE_TIFF" true)
+    (lib.cmakeBool "ENABLE_TRANSLATIONS" true)
+    (lib.cmakeBool "USE_SYSTEM_QUAZIP" true)
+  ];
 
   postInstall = lib.optionalString stdenv.isDarwin ''
     mkdir -p $out/lib
     mv $out/libnomacsCore.dylib $out/lib/libnomacsCore.dylib
   '';
 
-  meta = with lib; {
+  meta = {
     homepage = "https://nomacs.org";
     description = "Qt-based image viewer";
-    maintainers = with lib.maintainers; [ mindavi ];
-    license = licenses.gpl3Plus;
-    inherit (qtbase.meta) platforms;
+    longDescription = ''
+      nomacs is a free, open source image viewer, which supports multiple
+      platforms. You can use it for viewing all common image formats including
+      RAW and psd images.
+
+      nomacs features semi-transparent widgets that display additional
+      information such as thumbnails, metadata or histogram. It is able to
+      browse images in zip or MS Office files which can be extracted to a
+      directory. Metadata stored with the image can be displayed and you can add
+      notes to images. A thumbnail preview of the current folder is included as
+      well as a file explorer panel which allows switching between
+      folders. Within a directory you can apply a file filter, so that only
+      images are displayed whose filenames have a certain string or match a
+      regular expression. Activating the cache allows for instantly switching
+      between images.
+    '';
+    changelog = "https://github.com/nomacs/nomacs/releases/tag/${finalAttrs.src.rev}";
+    license = with lib.licenses; [ gpl3Plus ];
+    mainProgram = "nomacs";
+    maintainers = with lib.maintainers; [ AndersonTorres mindavi ];
+    inherit (libsForQt5.qtbase.meta) platforms;
   };
-}
+})