commit:     c5efe716a7f47cc30c8d8e03e197811c2c49f6be
Author:     Takuya Wakazono <pastalian46 <AT> gmail <DOT> com>
AuthorDate: Fri Jan 24 14:53:12 2025 +0000
Commit:     Takuya Wakazono <pastalian46 <AT> gmail <DOT> com>
CommitDate: Fri Jan 24 14:53:12 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c5efe716

media-gfx/swayimg: fix build wihout USE=png

Closes: https://bugs.gentoo.org/948480
Signed-off-by: Takuya Wakazono <pastalian46 <AT> gmail.com>

 .../swayimg-3.7-fix-build-without-libpng.patch     | 25 ++++++++++++++++++++++
 media-gfx/swayimg/swayimg-3.7.ebuild               |  7 +++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/media-gfx/swayimg/files/swayimg-3.7-fix-build-without-libpng.patch 
b/media-gfx/swayimg/files/swayimg-3.7-fix-build-without-libpng.patch
new file mode 100644
index 000000000..af3de1be5
--- /dev/null
+++ b/media-gfx/swayimg/files/swayimg-3.7-fix-build-without-libpng.patch
@@ -0,0 +1,25 @@
+https://bugs.gentoo.org/948480
+https://github.com/artemsen/swayimg/pull/243
+Fix build without libpng.
+--- a/src/thumbnail.c
++++ b/src/thumbnail.c
+@@ -378,7 +378,9 @@ const struct thumbnail* thumbnail_get(size_t index)
+ 
+ void thumbnail_remove(size_t index)
+ {
++#ifdef THUMBNAIL_PSTORE
+     pstore_reset(false);
++#endif // THUMBNAIL_PSTORE
+ 
+     list_for_each(ctx.thumbs, struct thumbnail, it) {
+         if (it->image->index == index) {
+@@ -392,7 +394,9 @@ void thumbnail_remove(size_t index)
+ 
+ void thumbnail_clear(size_t min_id, size_t max_id)
+ {
++#ifdef THUMBNAIL_PSTORE
+     pstore_reset(false);
++#endif // THUMBNAIL_PSTORE
+ 
+     if (min_id == IMGLIST_INVALID && max_id == IMGLIST_INVALID) {
+         list_for_each(ctx.thumbs, struct thumbnail, it) {

diff --git a/media-gfx/swayimg/swayimg-3.7.ebuild 
b/media-gfx/swayimg/swayimg-3.7.ebuild
index a6dd8892e..7514f4372 100644
--- a/media-gfx/swayimg/swayimg-3.7.ebuild
+++ b/media-gfx/swayimg/swayimg-3.7.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2023-2024 Gentoo Authors
+# Copyright 2023-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -47,6 +47,11 @@ BDEPEND="
        test? ( dev-cpp/gtest )
 "
 
+PATCHES=(
+       # bug #948480
+       "${FILESDIR}/${P}-fix-build-without-libpng.patch"
+)
+
 src_configure() {
        local emesonargs=(
                $(meson_feature avif)

Reply via email to