[geeqie] Add LCMS2 patch from Geeqie-devel list, fix HAVE_LCMS and build with

Michael Schwendt mschwendt at fedoraproject.org
Mon Dec 9 22:15:56 UTC 2013


commit d6dc5cd7b2dd61cca7fc8bb6fbc1c7a599851419
Author: Michael Schwendt <mschwendt at fedoraproject.org>
Date:   Mon Dec 9 23:15:55 2013 +0100

    Add LCMS2 patch from Geeqie-devel list, fix HAVE_LCMS and build with
    
      lcms2-devel instead of lcms-devel.

 geeqie-1.1-lcms2.patch |  106 ++++++++++++++++++++++++++++++++++++++++++++++++
 geeqie.spec            |   19 ++++++++-
 2 files changed, 123 insertions(+), 2 deletions(-)
---
diff --git a/geeqie-1.1-lcms2.patch b/geeqie-1.1-lcms2.patch
new file mode 100644
index 0000000..3eb34a3
--- /dev/null
+++ b/geeqie-1.1-lcms2.patch
@@ -0,0 +1,106 @@
+diff -Nurb --strip-trailing-cr geeqie-1.1-orig/configure.in geeqie-1.1/configure.in
+--- geeqie-1.1-orig/configure.in	2012-08-12 22:13:40.000000000 +0200
++++ geeqie-1.1/configure.in	2013-12-09 18:34:25.367495538 +0100
+@@ -275,6 +275,13 @@
+     [liblcms=$enableval], [liblcms=auto])
+ 
+ if test "x${liblcms}" != "xno"; then
++  PKG_CHECK_MODULES(LCMS, [lcms2 >= 2.0],
++    [
++      HAVE_LCMS=yes
++      AC_DEFINE(HAVE_LCMS2, 1, [lcms2 is used])
++      AC_DEFINE(HAVE_LCMS, 1, [enable LCMS])
++    ],
++    [
+   PKG_CHECK_MODULES(LCMS, [lcms >= 1.14],
+     [
+       HAVE_LCMS=yes
+@@ -284,6 +291,7 @@
+       HAVE_LCMS=no
+       AC_MSG_WARN([$LCMS_PKG_ERRORS])
+     ])
++    ])
+ else
+   HAVE_LCMS=disabled
+ fi
+diff -Nurb --strip-trailing-cr geeqie-1.1-orig/src/color-man.c geeqie-1.1/src/color-man.c
+--- geeqie-1.1-orig/src/color-man.c	2012-08-12 22:13:41.000000000 +0200
++++ geeqie-1.1/src/color-man.c	2013-12-09 18:34:07.441461661 +0100
+@@ -21,7 +21,11 @@
+ #ifdef HAVE_LCMS
+ /*** color support enabled ***/
+ 
++#ifdef HAVE_LCMS2
++#include <lcms2.h>
++#else
+ #include <lcms.h>
++#endif
+ 
+ 
+ typedef struct _ColorManCache ColorManCache;
+@@ -52,7 +56,9 @@
+ 	if (init_done) return;
+ 	init_done = TRUE;
+ 
++#ifndef HAVE_LCMS2
+ 	cmsErrorAction(LCMS_ERROR_IGNORE);
++#endif
+ }
+ 
+ static cmsHPROFILE color_man_create_adobe_comp(void)
+@@ -425,7 +431,14 @@
+ 		case COLOR_PROFILE_FILE:
+ 			if (profile)
+ 				{
++#ifdef HAVE_LCMS2
++				cmsUInt8Number profileID[17];
++				profileID[16] = '\0';
++				cmsGetHeaderProfileID(profile, profileID);
++				return g_strdup(profileID);
++#else
+ 				return g_strdup(cmsTakeProductName(profile));
++#endif
+ 				}
+ 			return g_strdup(_("Custom profile"));
+ 			break;
+diff -Nurb --strip-trailing-cr geeqie-1.1-orig/src/exif-common.c geeqie-1.1/src/exif-common.c
+--- geeqie-1.1-orig/src/exif-common.c	2012-08-12 22:13:41.000000000 +0200
++++ geeqie-1.1/src/exif-common.c	2013-12-09 18:34:07.442461606 +0100
+@@ -23,10 +23,10 @@
+ #ifdef HAVE_LCMS
+ /*** color support enabled ***/
+ 
+-#ifdef HAVE_LCMS_LCMS_H
+-  #include <lcms/lcms.h>
++#ifdef HAVE_LCMS2
++#include <lcms2.h>
+ #else
+-  #include <lcms.h>
++#include <lcms.h>
+ #endif
+ #endif
+ 
+@@ -413,6 +413,9 @@
+ 
+ static gchar *exif_build_formatted_ColorProfile(ExifData *exif)
+ {
++#ifdef HAVE_LCMS2
++	cmsUInt8Number profileID[17];
++#endif
+ 	const gchar *name = "";
+ 	const gchar *source = "";
+ 	guchar *profile_data;
+@@ -452,7 +455,13 @@
+ 			profile = cmsOpenProfileFromMem(profile_data, profile_len);
+ 			if (profile)
+ 				{
++#ifdef HAVE_LCMS2
++				profileID[16] = '\0';
++				cmsGetHeaderProfileID(profile, profileID);
++				name = profileID;
++#else
+ 				name = cmsTakeProductName(profile);
++#endif
+ 				cmsCloseProfile(profile);
+ 				}
+ 			g_free(profile_data);
diff --git a/geeqie.spec b/geeqie.spec
index 9454e7a..1f0ccb2 100644
--- a/geeqie.spec
+++ b/geeqie.spec
@@ -1,3 +1,5 @@
+%bcond_with lcms1
+
 %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
 
 %define upstreamversion 1.1
@@ -6,7 +8,7 @@
 Summary: Image browser and viewer
 Name: geeqie
 Version: 1.1
-Release: 15%{?dist}
+Release: 16%{?dist}
 License: GPLv2+
 Group: User Interface/X
 Source: http://downloads.sf.net/sourceforge/geeqie/%{name}-%{upstreamversion}.tar.gz
@@ -31,9 +33,15 @@ Patch6: geeqie-1.1-filedata-avoid-history-abort.patch
 # reported upstream
 # https://sourceforge.net/tracker/?func=detail&aid=3605406&group_id=222125&atid=1054682
 Patch7: geeqie-1.1-large-files.patch
+# LCMS2 patch from Geeqie-devel mailing-list
+Patch8: geeqie-1.1-lcms2.patch
 
 BuildRequires: gtk2-devel
+%if %{with lcms1}
 BuildRequires: lcms-devel
+%else
+BuildRequires: lcms2-devel
+%endif
 BuildRequires: exiv2-devel
 BuildRequires: lirc-devel
 BuildRequires: libjpeg-devel
@@ -82,7 +90,10 @@ done
 %patch5 -p1 -b .filedata-notification
 %patch6 -p1 -b .filedata-avoid-history-abort
 %patch7 -p1 -b .large-files
-
+%if ! %{with lcms1}
+%patch8 -p1
+autoreconf -f
+%endif
 
 %build
 %configure --enable-lirc --disable-tiff \
@@ -132,6 +143,10 @@ update-desktop-database &> /dev/null || :
 
 
 %changelog
+* Mon Dec  9 2013 Michael Schwendt <mschwendt at fedoraproject.org> - 1.1-16
+- Add LCMS2 patch from Geeqie-devel list, fix HAVE_LCMS and build with
+  lcms2-devel instead of lcms-devel.
+
 * Tue Dec 03 2013 Rex Dieter <rdieter at fedoraproject.org> - 1.1-15
 - rebuild (exiv2)
 


More information about the scm-commits mailing list