media-gfx/gthumb: Fix building with lcms2 disabled

Thanks-to: Maxim Britov
Closes: https://bugs.gentoo.org/967501
Signed-off-by: Pacho Ramos <pacho@gentoo.org>
This commit is contained in:
Pacho Ramos
2025-12-22 12:29:43 +01:00
parent 83bc28d639
commit 71c44ac569
2 changed files with 60 additions and 0 deletions
@@ -0,0 +1,56 @@
From a871dd868dce5204e19602263fbf89311c16a54b Mon Sep 17 00:00:00 2001
From: Paolo Bacchilega <paobac@src.gnome.org>
Date: Sun, 21 Dec 2025 08:14:15 +0100
Subject: [PATCH] Fixed compilation when lcms2 is disabled
Fixes https://gitlab.gnome.org/GNOME/gthumb/-/issues/376
---
extensions/cairo_io/cairo-image-surface-tiff.c | 2 ++
gthumb/gth-image.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/extensions/cairo_io/cairo-image-surface-tiff.c b/extensions/cairo_io/cairo-image-surface-tiff.c
index d948ff6d..60c7fdf8 100644
--- a/extensions/cairo_io/cairo-image-surface-tiff.c
+++ b/extensions/cairo_io/cairo-image-surface-tiff.c
@@ -259,6 +259,7 @@ _cairo_image_surface_create_from_tiff (GInputStream *istream,
orientation = exif_orientation;
}
+#if HAVE_LCMS2
uint16_t colorspace;
if ((profile == NULL) && (TIFFGetField (tif, EXIFTAG_COLORSPACE, &colorspace) == 1)) {
//g_print ("> colorspace: %u\n", colorspace);
@@ -266,6 +267,7 @@ _cairo_image_surface_create_from_tiff (GInputStream *istream,
profile = gth_icc_profile_new_srgb ();
}
}
+#endif
}
}
diff --git a/gthumb/gth-image.c b/gthumb/gth-image.c
index 49e3a7fe..860f0991 100644
--- a/gthumb/gth-image.c
+++ b/gthumb/gth-image.c
@@ -481,6 +481,8 @@ gth_image_get_original_profile_name (GthImage *image)
/* -- gth_image_apply_icc_profile -- */
+#if HAVE_LCMS2
+
static gboolean
gth_image_apply_tranform (GthImage *image,
GthICCTransform *transform,
@@ -513,6 +515,8 @@ gth_image_apply_tranform (GthImage *image,
return applied;
}
+#endif
+
gboolean
gth_image_apply_icc_profile (GthImage *image,
--
GitLab
+4
View File
@@ -59,6 +59,10 @@ BDEPEND="
>=sys-devel/gettext-0.19.8
virtual/pkgconfig
"
PATCHES=(
# https://gitlab.gnome.org/GNOME/gthumb/-/issues/376
"${FILESDIR}/${P}-disabled-lcms2.patch"
)
src_configure() {
use X || append-cflags -DGENTOO_GTK_HIDE_X11