media-gfx/swayimg: add 4.2

useflag sway is now wayland as support for Hyprland is included too
disable building of manpages (new with 4.2), use files provided by upstream

Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
This commit is contained in:
Nicolas PARLANT
2025-06-10 21:37:02 +02:00
parent c37d2ed01e
commit c1e9784506
4 changed files with 124 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
DIST swayimg-4.0.tar.gz 768532 BLAKE2B c7121452f02af4b599679f2040233142978184cb1919d1af5d90540f0e1331542ec56c7d96e68f33aacb117083ae20ae3f2aa81833846c37c7868f9551f2d63c SHA512 e13eadab3188b25266caefabe493da95fecc41b7e78c29e836e895d3d68f71405296e330963a44e88a8adbc9ba6c881f952d30033d63fffd14ccf909ec742613
DIST swayimg-4.1.tar.gz 772139 BLAKE2B f20aca21800510f348f0cff3ee9d2c1a176f746b0e75f3b39147d1cee23ef54454ee618120c87d9649fde0bb0565ed2462bdc148b107c6eaf026d94cd8d7f3ad SHA512 0cce9c60bba1daa85776d155a656f7d3988a4e8fd5fa8f461c1bec00c800fdf6a51f6a18212042f61e324d45936434988d60e80bf03f237172d9a159e3e52153
DIST swayimg-4.2.tar.gz 778261 BLAKE2B 58a0fc1b70c7218493d499d224fd32bfcd4083515060ae6d5ec40225f127a0cc9115dff9237f90e12fb46ac66f110d7003edf8ea13218d7b5e631074c8d30f76 SHA512 6496591410ddadd4569c51e12b92d32f83b233b055212a50c861facb30cc7fe5c58c8b4e4955ae862086ed3d06f014fcc657fb8ba112b3bbfb287dc1e3ec3852

View File

@@ -0,0 +1,34 @@
From 7b1dcf98a77b81131f84f1e6bb71ae99be017497 Mon Sep 17 00:00:00 2001
From: Artem Senichev <artemsen@gmail.com>
Date: Tue, 10 Jun 2025 10:32:11 +0300
Subject: [PATCH] Fix position handling in command line
Resolves the error `swayimg: unrecognized option --position`
Signed-off-by: Artem Senichev <artemsen@gmail.com>
---
src/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main.c b/src/main.c
index a1e12fb..51e9bfa 100644
--- a/src/main.c
+++ b/src/main.c
@@ -31,7 +31,7 @@ static const struct cmdarg arguments[] = {
{ 'o', "order", "ORDER", "set sort order for image list" },
{ 's', "scale", "SCALE", "set initial image scale" },
{ 'l', "slideshow", NULL, "activate slideshow mode on startup" },
-#ifdef HAVE_SWAYWM
+#ifdef HAVE_COMPOSITOR
{ 'p', "position", "POS", "(SwayWM only) set window position" },
#endif
{ 'w', "size", "SIZE", "set window size" },
@@ -128,7 +128,7 @@ static int parse_cmdargs(int argc, char* argv[], struct config* cfg)
case 'l':
config_set(cfg, CFG_VIEWER, CFG_VIEW_SSHOW, CFG_YES);
break;
-#ifdef HAVE_SWAYWM
+#ifdef HAVE_COMPOSITOR
case 'p':
config_set(cfg, CFG_GENERAL, CFG_GNRL_POSITION, optarg);
break;

View File

@@ -12,5 +12,6 @@
<flag name="jpegxl">Enable support for JPEG XL image format</flag>
<flag name="sixel">Enable support for Sixel image format</flag>
<flag name="sway">Enable Sway WM integration</flag>
<flag name="wayland">Integration with Wayland compositors (Sway and Hyprland only)</flag>
</use>
</pkgmetadata>

View File

@@ -0,0 +1,88 @@
# Copyright 2023-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit meson xdg
DESCRIPTION="A lightweight image viewer for Wayland display servers"
HOMEPAGE="https://github.com/artemsen/swayimg"
SRC_URI="https://github.com/artemsen/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE="avif bash-completion exif exr gif heif jpeg jpegxl png raw sixel svg test tiff +wayland webp X"
RESTRICT="!test? ( test )"
RDEPEND="
dev-libs/wayland
media-libs/fontconfig
media-libs/freetype
x11-libs/libxkbcommon
avif? ( media-libs/libavif:= )
bash-completion? ( app-shells/bash-completion )
exif? ( media-libs/libexif )
exr? ( media-libs/openexr:= )
gif? ( media-libs/giflib:= )
heif? ( media-libs/libheif:= )
jpeg? ( media-libs/libjpeg-turbo:= )
jpegxl? ( media-libs/libjxl:= )
png? ( media-libs/libpng:= )
raw? ( media-libs/libraw:= )
sixel? ( media-libs/libsixel )
svg? (
dev-libs/glib:2
gnome-base/librsvg:2
x11-libs/cairo[X=]
)
tiff? ( media-libs/tiff:= )
wayland? ( dev-libs/json-c:= )
webp? ( media-libs/libwebp:= )
"
DEPEND="${RDEPEND}
dev-libs/wayland-protocols
svg? ( X? ( x11-base/xorg-proto ) )
"
BDEPEND="
dev-util/wayland-scanner
test? ( dev-cpp/gtest )
"
PATCHES=(
# From upstream, fix `swayimg: unrecognized option --position`
"${FILESDIR}"/${P}-fix_opt_position.patch
)
src_configure() {
local emesonargs=(
$(meson_feature avif)
$(meson_feature exif)
$(meson_feature exr)
$(meson_feature gif)
$(meson_feature heif)
$(meson_feature jpeg)
$(meson_feature jpegxl jxl)
$(meson_feature png)
$(meson_feature raw)
$(meson_feature sixel)
$(meson_feature svg)
$(meson_feature test tests)
$(meson_feature tiff)
$(meson_feature wayland compositor)
$(meson_feature webp)
$(meson_feature bash-completion bash)
-Dversion=${PV}
-Ddesktop=true
# avoid automagic building with scdoc
-Dman=false
-Dzsh=enabled
)
meson_src_configure
}
src_install() {
meson_src_install
doman extra/*.{1,5}
}