From 286a40b27cdd1e220984701361aa07f6a17168ed Mon Sep 17 00:00:00 2001 From: Artturin Date: Sat, 19 Oct 2024 20:09:16 +0300 Subject: [PATCH 1/3] viewnior: switch to a pr which combines other PRs https://www.github.com/hellosiyan/Viewnior/pull/108 https://www.github.com/hellosiyan/Viewnior/pull/130 https://www.github.com/hellosiyan/Viewnior/pull/135 --- .../graphics/viewnior/default.nix | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/pkgs/applications/graphics/viewnior/default.nix b/pkgs/applications/graphics/viewnior/default.nix index bfd707f55132d..70d28b6e5aee6 100644 --- a/pkgs/applications/graphics/viewnior/default.nix +++ b/pkgs/applications/graphics/viewnior/default.nix @@ -1,30 +1,20 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkg-config, desktop-file-utils, gtk2, libpng, exiv2, lcms +{ lib, stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkg-config, desktop-file-utils, gtk3, libpng, exiv2, lcms , intltool, gettext, shared-mime-info, glib, gdk-pixbuf, perl}: stdenv.mkDerivation rec { - pname = "viewnior"; - version = "1.8"; + pname = "viewnior-gtk3"; + version = "1.8-unstable-2023-11-23"; src = fetchFromGitHub { - owner = "hellosiyan"; + #owner = "hellosiyan"; + #repo = "Viewnior"; + owner = "Artturin"; repo = "Viewnior"; - rev = "${pname}-${version}"; - hash = "sha256-LTahMmcAqgqviUxR624kTozJGTniAAGWKo1ZqXjoG5M="; + # https://github.com/hellosiyan/Viewnior/pull/142 + rev = "23ce6e5630b24509d8009f17a833ad9e59b85fab"; + hash = "sha256-+/f0+og1Dd7eJK7P83+q4lf4SjzW2g6qNk8ZTxNAuDA="; }; - patches = [ - (fetchpatch { - name = "viewnior-1.8-change-exiv2-AutoPtr-to-unique_ptr.patch"; - url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/viewnior/files/viewnior-1.8-change-exiv2-AutoPtr-to-unique_ptr.patch?id=002882203ad6a2b08ce035a18b95844a9f4b85d0"; - hash = "sha256-O3/d7qMiOsYJmz7ekoLM6oaHcuYjEbAfPFuDUWSybfE="; - }) - (fetchpatch { - name = "viewnior-1.8-add-support-for-exiv-0.28.0-errors.patch"; - url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/viewnior/files/viewnior-1.8-add-support-for-exiv-0.28.0-errors.patch?id=002882203ad6a2b08ce035a18b95844a9f4b85d0"; - hash = "sha256-Zjc4CIlelAkbyvX2F1yo/qJjUajtAgF4+FoHWFEIPWY="; - }) - ]; - nativeBuildInputs = [ meson ninja @@ -35,7 +25,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ - gtk2 + gtk3 libpng exiv2 lcms From 40a4bd08fe59dd3c24807b28b19cecbcd48d5bc4 Mon Sep 17 00:00:00 2001 From: Artturin Date: Sat, 19 Oct 2024 22:58:55 +0300 Subject: [PATCH 2/3] viewnior: add webp support and fix ``` (viewnior:2739789): Gtk-WARNING **: 23:12:19.403: Could not load a pixbuf from icon theme. This may indicate that pixbuf loaders or the mime database could not be found. ``` --- pkgs/applications/graphics/viewnior/default.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/graphics/viewnior/default.nix b/pkgs/applications/graphics/viewnior/default.nix index 70d28b6e5aee6..8f7b72db2f505 100644 --- a/pkgs/applications/graphics/viewnior/default.nix +++ b/pkgs/applications/graphics/viewnior/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkg-config, desktop-file-utils, gtk3, libpng, exiv2, lcms -, intltool, gettext, shared-mime-info, glib, gdk-pixbuf, perl}: +, intltool, gettext, shared-mime-info, glib, gdk-pixbuf, perl, wrapGAppsHook3, webp-pixbuf-loader, gnome, librsvg}: stdenv.mkDerivation rec { pname = "viewnior-gtk3"; @@ -22,6 +22,7 @@ stdenv.mkDerivation rec { desktop-file-utils intltool gettext + wrapGAppsHook3 ]; buildInputs = [ @@ -35,6 +36,17 @@ stdenv.mkDerivation rec { perl ]; + postInstall = '' + export GDK_PIXBUF_MODULE_FILE="${ + gnome._gdkPixbufCacheBuilder_DO_NOT_USE { + extraLoaders = [ + webp-pixbuf-loader + librsvg + ]; + } + }" + ''; + meta = with lib; { description = "Fast and simple image viewer"; longDescription = From e547a1fe90d236401b1cbd98f1948a46caaab255 Mon Sep 17 00:00:00 2001 From: Artturin Date: Sat, 19 Oct 2024 23:07:20 +0300 Subject: [PATCH 3/3] viewnior: Use x11 --- pkgs/applications/graphics/viewnior/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/applications/graphics/viewnior/default.nix b/pkgs/applications/graphics/viewnior/default.nix index 8f7b72db2f505..a38c247e7f21d 100644 --- a/pkgs/applications/graphics/viewnior/default.nix +++ b/pkgs/applications/graphics/viewnior/default.nix @@ -45,6 +45,12 @@ stdenv.mkDerivation rec { ]; } }" + + # gtk3 viewnior can be launched in wayland mode and does so by default + # but moving around in a zoomed in image doesn't work + gappsWrapperArgs+=( + --set-default GDK_BACKEND x11 + ) ''; meta = with lib; {