mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-15 01:53:25 -04:00
media-gfx/swayimg: add 4.0
Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
DIST swayimg-3.8.tar.gz 754719 BLAKE2B c41b22912499db8bbc0de5b778280d84826b4cfc974d036a8ba7c6bc2a1b54ed87667c7ae11eb4c9ddccc56f753a0ce1256d0c4516e2a3cd72f28a40551759a3 SHA512 3075eb4f48d11708ff0610a7551c38a0b09d65210c56b267410e688f595711ee5357d27a48ce4a8c3e0fe9a4204881f30363579e5686f0979ce59d0277185303
|
||||
DIST swayimg-3.9.tar.gz 756909 BLAKE2B 09dccc87a07ef154db792a441d5e8265b0d04432f70c2510eb64df8d0f971aa2b012915e2520c52336eb111ef60d333b7fdf24b8b578ea54e93de4ba27e74c2d SHA512 66d97c6695eb030d1013f28bc4fdbb210d26fe602f178fe32e20084f84d8b8e1934012d93e6239234dadbcb2715e61762eadb2350fb6725788b8e70acbea0b11
|
||||
DIST swayimg-4.0.tar.gz 768532 BLAKE2B c7121452f02af4b599679f2040233142978184cb1919d1af5d90540f0e1331542ec56c7d96e68f33aacb117083ae20ae3f2aa81833846c37c7868f9551f2d63c SHA512 e13eadab3188b25266caefabe493da95fecc41b7e78c29e836e895d3d68f71405296e330963a44e88a8adbc9ba6c881f952d30033d63fffd14ccf909ec742613
|
||||
|
||||
52
media-gfx/swayimg/files/swayimg-4.0-fix_memlk.patch
Normal file
52
media-gfx/swayimg/files/swayimg-4.0-fix_memlk.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From eff7ca90fb6db8ca214384f8660709fdaff405f6 Mon Sep 17 00:00:00 2001
|
||||
From: Artem Senichev <artemsen@gmail.com>
|
||||
Date: Sat, 17 May 2025 11:47:36 +0300
|
||||
Subject: [PATCH] Fix potential memory leak
|
||||
|
||||
Signed-off-by: Artem Senichev <artemsen@gmail.com>
|
||||
---
|
||||
src/image.c | 18 ++++++++++--------
|
||||
1 file changed, 10 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/image.c b/src/image.c
|
||||
index cbb28e6..fbdef8d 100644
|
||||
--- a/src/image.c
|
||||
+++ b/src/image.c
|
||||
@@ -36,14 +36,7 @@ bool image_clear(struct image* img, size_t mask)
|
||||
bool all_free;
|
||||
|
||||
if ((mask & IMGDATA_FRAMES) && image_has_frames(img)) {
|
||||
- struct imgdec* decoder = &img->data->decoder;
|
||||
struct array* frames = img->data->frames;
|
||||
-
|
||||
- if (decoder->data) {
|
||||
- decoder->free(img->data);
|
||||
- }
|
||||
- memset(decoder, 0, sizeof(*decoder));
|
||||
-
|
||||
for (size_t i = 0; i < frames->size; ++i) {
|
||||
struct imgframe* frame = arr_nth(frames, i);
|
||||
pixmap_free(&frame->pm);
|
||||
@@ -52,12 +45,21 @@ bool image_clear(struct image* img, size_t mask)
|
||||
img->data->frames = NULL;
|
||||
}
|
||||
|
||||
+ // automatically free decoder if there are no frames
|
||||
+ if (!image_has_frames(img)) {
|
||||
+ struct imgdec* decoder = &img->data->decoder;
|
||||
+ if (decoder->data) {
|
||||
+ decoder->free(img->data);
|
||||
+ }
|
||||
+ memset(decoder, 0, sizeof(*decoder));
|
||||
+ }
|
||||
+
|
||||
if ((mask & IMGDATA_THUMB) && image_has_thumb(img)) {
|
||||
pixmap_free(&img->data->thumbnail);
|
||||
img->data->thumbnail.data = NULL;
|
||||
}
|
||||
|
||||
- // automatically free if there are no frames or thumbnail
|
||||
+ // automatically free info if there are no frames or thumbnail
|
||||
if (!image_has_frames(img) && !image_has_thumb(img)) {
|
||||
mask |= IMGDATA_INFO;
|
||||
}
|
||||
@@ -11,5 +11,6 @@
|
||||
<flag name="exr">Enable support for EXR image format</flag>
|
||||
<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>
|
||||
</use>
|
||||
</pkgmetadata>
|
||||
|
||||
80
media-gfx/swayimg/swayimg-4.0.ebuild
Normal file
80
media-gfx/swayimg/swayimg-4.0.ebuild
Normal file
@@ -0,0 +1,80 @@
|
||||
# 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 +sway test tiff 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=]
|
||||
)
|
||||
sway? ( dev-libs/json-c:= )
|
||||
tiff? ( media-libs/tiff:= )
|
||||
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 potential memory leak
|
||||
"${FILESDIR}"/${P}-fix_memlk.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 sway)
|
||||
$(meson_feature test tests)
|
||||
$(meson_feature tiff)
|
||||
$(meson_feature webp)
|
||||
$(meson_feature bash-completion bash)
|
||||
-Dversion=${PV}
|
||||
-Ddesktop=true
|
||||
-Dman=true
|
||||
-Dzsh=enabled
|
||||
)
|
||||
meson_src_configure
|
||||
}
|
||||
Reference in New Issue
Block a user