commit: 47a73a9de1391eac2c7c2d16daff3bd4a8fd3531 Author: NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com> AuthorDate: Sun Nov 23 09:48:44 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Mon Nov 24 13:28:01 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47a73a9d
media-gfx/pqiv: add 2.13.3 With upstreamed patch to fix scaling in montage mode Bug: https://bugs.gentoo.org/934225 Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com> Part-of: https://github.com/gentoo/gentoo/pull/44739 Signed-off-by: Sam James <sam <AT> gentoo.org> media-gfx/pqiv/Manifest | 1 + .../files/pqiv-2.13.3-scale-montage-view.patch | 93 ++++++++++++++++++++++ media-gfx/pqiv/pqiv-2.13.3.ebuild | 66 +++++++++++++++ 3 files changed, 160 insertions(+) diff --git a/media-gfx/pqiv/Manifest b/media-gfx/pqiv/Manifest index 014fe35dcaad..cc8faa89c95d 100644 --- a/media-gfx/pqiv/Manifest +++ b/media-gfx/pqiv/Manifest @@ -1 +1,2 @@ DIST pqiv-2.12.tar.gz 141927 BLAKE2B b33f14c78422dc53f9d97eb6277da0ad51ae5d9ecd60497a879ab6057206c7cd695d6242e76f33856467c7821beac3e6d13ea3dda7aa4d4142e7682384ee8d63 SHA512 f921d7949c9d229536188e9652cc687dcc55127875f329d0a64e6e2a55ea1a6827c0df6925685ae923ba1a000fbf2d2dc1dd825e67a12815a49b2cb703ea2e2f +DIST pqiv-2.13.3.tar.gz 143776 BLAKE2B 8d5fef8d6b8768bc35cc5e62e85726b15f2a3109d417991734de30fc8c7c41d0e27d35333bc2d28fe90e70aad52327edcd6a99087b63554b5ab29b791e777798 SHA512 adb091667b44b2219ac89954c89e0c7ca8e6e082a447adc961824b2deba89b39498acac80e2762b24336fd1f77e1b6238920604cb4694fc7db8959ff0aa91883 diff --git a/media-gfx/pqiv/files/pqiv-2.13.3-scale-montage-view.patch b/media-gfx/pqiv/files/pqiv-2.13.3-scale-montage-view.patch new file mode 100644 index 000000000000..c553a6ea09de --- /dev/null +++ b/media-gfx/pqiv/files/pqiv-2.13.3-scale-montage-view.patch @@ -0,0 +1,93 @@ +Upstream patch: +https://github.com/phillipberndt/pqiv/commit/4000533e84387816fd59c0bc6a346e9742a6232c +From 4000533e84387816fd59c0bc6a346e9742a6232c Mon Sep 17 00:00:00 2001 +From: NHOrus <[email protected]> +Date: Fri, 21 Nov 2025 18:13:52 +0300 +Subject: [PATCH] Introduce scaling factor to montage view. + +Fixes #236 +--- + pqiv.c | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +diff --git a/pqiv.c b/pqiv.c +index 27e667b..f746d8f 100644 +--- a/pqiv.c ++++ b/pqiv.c +@@ -4414,8 +4414,8 @@ void calculate_base_draw_pos_and_size(int *image_transform_width, int *image_tra + }/*}}}*/ + #ifndef CONFIGURED_WITHOUT_MONTAGE_MODE + void montage_window_set_cursor(int pos_x, int pos_y) {/*{{{*/ +- const unsigned n_thumbs_x = main_window_width / (option_thumbnails.width + 10); +- const unsigned n_thumbs_y = main_window_height / (option_thumbnails.height + 10); ++ const unsigned n_thumbs_x = main_window_width / (option_thumbnails.width + 10) / screen_scale_factor; ++ const unsigned n_thumbs_y = main_window_height / (option_thumbnails.height + 10) / screen_scale_factor; + const size_t number_of_images = (ptrdiff_t)bostree_node_count(file_tree); + + if(!montage_window_control.selected_node) { +@@ -4465,8 +4465,8 @@ gboolean montage_window_get_move_cursor_target(int pos_x, int pos_y, int move_y_ + scrolling + */ + +- const int n_thumbs_x = main_window_width / (option_thumbnails.width + 10); +- const int n_thumbs_y = main_window_height / (option_thumbnails.height + 10); ++ const int n_thumbs_x = main_window_width / (option_thumbnails.width + 10) / screen_scale_factor; ++ const int n_thumbs_y = main_window_height / (option_thumbnails.height + 10) / screen_scale_factor; + const ptrdiff_t number_of_images = (ptrdiff_t)bostree_node_count(file_tree); + const int n_rows_total = (number_of_images + n_thumbs_x - 1) / n_thumbs_x; + const int last_row_n_thumbs = (number_of_images % n_thumbs_x == 0) ? n_thumbs_x : number_of_images % n_thumbs_x; +@@ -4577,8 +4577,8 @@ gboolean montage_window_get_move_cursor_target(int pos_x, int pos_y, int move_y_ + }/*}}}*/ + void montage_window_move_cursor(int move_x, int move_y, int move_y_pages) {/*{{{*/ + // Must be called with an active lock. +- const int n_thumbs_x = main_window_width / (option_thumbnails.width + 10); +- const int n_thumbs_y = main_window_height / (option_thumbnails.height + 10); ++ const int n_thumbs_x = main_window_width / (option_thumbnails.width + 10) / screen_scale_factor; ++ const int n_thumbs_y = main_window_height / (option_thumbnails.height + 10) / screen_scale_factor; + + if(n_thumbs_x == 0 || n_thumbs_y == 0) { + return; +@@ -4654,8 +4654,8 @@ struct window_draw_thumbnail_montage_show_binding_overlays_data { + char *active_prefix; + }; + void window_draw_thumbnail_montage_show_binding_overlays_looper(gpointer key, gpointer value, gpointer user_data) {/*{{{*/ +- const int n_thumbs_x = main_window_width / (option_thumbnails.width + 10); +- const int n_thumbs_y = main_window_height / (option_thumbnails.height + 10); ++ const int n_thumbs_x = main_window_width / (option_thumbnails.width + 10) / screen_scale_factor; ++ const int n_thumbs_y = main_window_height / (option_thumbnails.height + 10) / screen_scale_factor; + const ptrdiff_t number_of_images = (ptrdiff_t)bostree_node_count(file_tree); + const int n_rows_total = (number_of_images + n_thumbs_x - 1) / n_thumbs_x; + const int last_row_n_thumbs = (number_of_images % n_thumbs_x == 0) ? n_thumbs_x : number_of_images % n_thumbs_x; +@@ -4806,8 +4806,8 @@ gboolean window_draw_thumbnail_montage(cairo_t *cr_arg) {/*{{{*/ + cairo_restore(cr_arg); + + // Calculate how many thumbnails to draw +- const unsigned n_thumbs_x = main_window_width / (option_thumbnails.width + 10); +- const unsigned n_thumbs_y = main_window_height / (option_thumbnails.height + 10); ++ const unsigned n_thumbs_x = main_window_width / (option_thumbnails.width + 10) / screen_scale_factor; ++ const unsigned n_thumbs_y = main_window_height / (option_thumbnails.height + 10) / screen_scale_factor; + size_t top_left_id = montage_window_control.scroll_y * n_thumbs_x; + + BOSNode *selected_node = bostree_node_weak_unref(file_tree, bostree_node_weak_ref(montage_window_control.selected_node)); +@@ -4851,8 +4851,8 @@ gboolean window_draw_thumbnail_montage(cairo_t *cr_arg) {/*{{{*/ + if(thumb_file->thumbnail) { + cairo_save(cr_arg); + cairo_translate(cr_arg, +- (main_window_width - n_thumbs_x * (option_thumbnails.width + 10)) / 2 + (draw_now % n_thumbs_x) * (option_thumbnails.width + 10) + (option_thumbnails.width + 10 - cairo_image_surface_get_width(thumb_file->thumbnail))/2, +- (main_window_height - n_thumbs_y * (option_thumbnails.height + 10)) / 2 + (draw_now / n_thumbs_x) * (option_thumbnails.height + 10) + (option_thumbnails.height + 10 - cairo_image_surface_get_height(thumb_file->thumbnail))/2 ++ (main_window_width / screen_scale_factor - n_thumbs_x * (option_thumbnails.width + 10)) / 2 + (draw_now % n_thumbs_x) * (option_thumbnails.width + 10) + (option_thumbnails.width + 10 - cairo_image_surface_get_width(thumb_file->thumbnail))/2, ++ (main_window_height / screen_scale_factor - n_thumbs_y * (option_thumbnails.height + 10)) / 2 + (draw_now / n_thumbs_x) * (option_thumbnails.height + 10) + (option_thumbnails.height + 10 - cairo_image_surface_get_height(thumb_file->thumbnail))/2 + ); + cairo_set_source_surface(cr_arg, thumb_file->thumbnail, 0, 0); + cairo_new_path(cr_arg); +@@ -4888,8 +4888,8 @@ gboolean window_draw_thumbnail_montage(cairo_t *cr_arg) {/*{{{*/ + else if(top_left_id + draw_now == selection_rank) { + cairo_save(cr_arg); + cairo_translate(cr_arg, +- (main_window_width - n_thumbs_x * (option_thumbnails.width + 10)) / 2 + (draw_now % n_thumbs_x) * (option_thumbnails.width + 10) + (option_thumbnails.width - 5)/2, +- (main_window_height - n_thumbs_y * (option_thumbnails.height + 10)) / 2 + (draw_now / n_thumbs_x) * (option_thumbnails.height + 10) + (option_thumbnails.height - 5)/2 ++ (main_window_width / screen_scale_factor - n_thumbs_x * (option_thumbnails.width + 10)) / 2 + (draw_now % n_thumbs_x) * (option_thumbnails.width + 10) + (option_thumbnails.width - 5)/2, ++ (main_window_height / screen_scale_factor - n_thumbs_y * (option_thumbnails.height + 10)) / 2 + (draw_now / n_thumbs_x) * (option_thumbnails.height + 10) + (option_thumbnails.height - 5)/2 + ); + cairo_rectangle(cr_arg, 0, 0, 5, 5); + cairo_set_source_rgb(cr_arg, option_box_colors.bg_red, option_box_colors.bg_green, option_box_colors.bg_blue); diff --git a/media-gfx/pqiv/pqiv-2.13.3.ebuild b/media-gfx/pqiv/pqiv-2.13.3.ebuild new file mode 100644 index 000000000000..0f6ddc8325bc --- /dev/null +++ b/media-gfx/pqiv/pqiv-2.13.3.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit edo flag-o-matic linux-info toolchain-funcs xdg + +DESCRIPTION="A powerful GTK 3 based command-line image viewer with a minimal UI" +HOMEPAGE="https://github.com/phillipberndt/pqiv https://www.pberndt.com/Programme/Linux/pqiv/" +SRC_URI="https://github.com/phillipberndt/pqiv/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86" +IUSE="archive ffmpeg imagemagick pdf postscript webp" + +RDEPEND=" + >=dev-libs/glib-2.32:2 + >=x11-libs/cairo-1.6 + >=x11-libs/gdk-pixbuf-2.2:2 + x11-libs/gtk+:3 + >=x11-libs/pango-1.10 + X? ( x11-libs/libX11 ) + archive? ( app-arch/libarchive:0= ) + ffmpeg? ( media-video/ffmpeg:0= ) + imagemagick? ( media-gfx/imagemagick:0= ) + pdf? ( app-text/poppler:0=[cairo] ) + postscript? ( app-text/libspectre:0= ) + webp? ( media-libs/libwebp:0= ) +" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES="${FILESDIR}/${P}-scale-montage-view.patch" + +pkg_setup() { + if use kernel_linux; then + CONFIG_CHECK="~INOTIFY_USER" + linux-info_pkg_setup + fi +} + +src_configure() { + local backends=( + "gdkpixbuf" + $(usev archive "archive") + $(usev archive "archive_cbx") + $(usev ffmpeg "libav") + $(usev imagemagick "wand") + $(usev pdf "poppler") + $(usev postscript "spectre") + $(usev webp "webp") + ) + local myconf=( + --backends-build=shared + --backends=$(printf "%s," "${backends[@]}") + --prefix="${EPREFIX}/usr" + --libdir="${EPREFIX}/usr/$(get_libdir)" + ) + edo ./configure "${myconf[@]}" +} + +src_compile() { + tc-export CC + emake VERBOSE=1 CFLAGS="${CFLAGS}" +}
