Unverified Commit c9aa6027 authored by K900's avatar K900 Committed by GitHub
Browse files

qview: migrate to `Qt6` and add `HEIF` support (#453428)

parents fe89674c b514a9ce
Loading
Loading
Loading
Loading
+26 −17
Original line number Diff line number Diff line
@@ -2,42 +2,51 @@
  lib,
  stdenv,
  fetchFromGitHub,
  libsForQt5,
  qt6,
  nix-update-script,
  kdePackages,
  x11Support ? true,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "qview";
  version = "7.1";

  src = fetchFromGitHub {
    owner = "jurplel";
    repo = "qView";
    rev = version;
    tag = finalAttrs.version;
    hash = "sha256-EcXhwJcgBLdXa/FQ5LuENlzwnLw4Gt2BGlBO1p5U8tI=";
  };

  qmakeFlags = lib.optionals (!x11Support) [ "CONFIG+=NO_X11" ];

  nativeBuildInputs = [
    libsForQt5.qmake
    libsForQt5.wrapQtAppsHook
    qt6.qmake
    qt6.wrapQtAppsHook
  ];

  buildInputs = [
    libsForQt5.qtbase
    libsForQt5.qttools
    libsForQt5.qtimageformats
    libsForQt5.qtsvg
    qt6.qtbase
    qt6.qttools
    qt6.qtimageformats
    qt6.qtsvg
    kdePackages.kimageformats
  ];

  qmakeFlags = [
    # See https://github.com/NixOS/nixpkgs/issues/214765
    "QT_TOOL.lrelease.binary=${lib.getDev qt6.qttools}/bin/lrelease"
  ]
  ++ lib.optionals x11Support [ libsForQt5.qtx11extras ];
  ++ lib.optionals (!x11Support) [ "CONFIG+=NO_X11" ];

  passthru.updateScript = nix-update-script { };

  meta = with lib; {
  meta = {
    description = "Practical and minimal image viewer";
    mainProgram = "qview";
    changelog = "https://github.com/jurplel/qView/releases/tag/${finalAttrs.version}";
    homepage = "https://interversehq.com/qview/";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ acowley ];
    platforms = platforms.all;
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [ acowley ];
    platforms = lib.platforms.all;
  };
}
})