Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

viewnior: switch to gtk3 PR #349819

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 29 additions & 21 deletions pkgs/applications/graphics/viewnior/default.nix
Original file line number Diff line number Diff line change
@@ -1,41 +1,32 @@
{ lib, stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkg-config, desktop-file-utils, gtk2, libpng, exiv2, lcms
, intltool, gettext, shared-mime-info, glib, gdk-pixbuf, perl}:
{ lib, stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkg-config, desktop-file-utils, gtk3, libpng, exiv2, lcms
, intltool, gettext, shared-mime-info, glib, gdk-pixbuf, perl, wrapGAppsHook3, webp-pixbuf-loader, gnome, librsvg}:

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
pkg-config
desktop-file-utils
intltool
gettext
wrapGAppsHook3
];

buildInputs = [
gtk2
gtk3
libpng
exiv2
lcms
Expand All @@ -45,6 +36,23 @@ stdenv.mkDerivation rec {
perl
];

postInstall = ''
export GDK_PIXBUF_MODULE_FILE="${
gnome._gdkPixbufCacheBuilder_DO_NOT_USE {
extraLoaders = [
webp-pixbuf-loader
librsvg
];
}
}"

# 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
Artturin marked this conversation as resolved.
Show resolved Hide resolved
)
'';

meta = with lib; {
description = "Fast and simple image viewer";
longDescription =
Expand Down