[dcraw] build against the currently maintained version of lcms (2.x)
Nils Philippsen
nphilipp at fedoraproject.org
Fri Sep 13 15:29:31 UTC 2013
commit 347b04ea149cbff6194cac5797d1396c5a323783
Author: Nils Philippsen <nils at redhat.com>
Date: Fri Sep 13 17:29:03 2013 +0200
build against the currently maintained version of lcms (2.x)
dcraw-9.19-lcms2.patch | 59 ++++++++++++++++++++++++++++++++++++++++++++++++
dcraw.spec | 15 +++++++++--
2 files changed, 71 insertions(+), 3 deletions(-)
---
diff --git a/dcraw-9.19-lcms2.patch b/dcraw-9.19-lcms2.patch
new file mode 100644
index 0000000..9d0556e
--- /dev/null
+++ b/dcraw-9.19-lcms2.patch
@@ -0,0 +1,59 @@
+From 789b763bff1701ef31bd077ae49671dfe1c82a51 Mon Sep 17 00:00:00 2001
+From: Nils Philippsen <nils at redhat.com>
+Date: Wed, 4 Sep 2013 17:13:49 +0200
+Subject: [PATCH] Add support for LCMS version 2.x.
+
+---
+ dcraw.c | 21 ++++++++++++++++++++-
+ 1 file changed, 20 insertions(+), 1 deletion(-)
+
+diff --git a/dcraw.c b/dcraw.c
+index 96e3d1f..4b280b5 100644
+--- a/dcraw.c
++++ b/dcraw.c
+@@ -80,7 +80,13 @@ typedef unsigned long long UINT64;
+ #include <jpeglib.h> /* Decode compressed Kodak DC120 photos */
+ #endif /* and Adobe Lossy DNGs */
+ #ifndef NO_LCMS
+-#include <lcms.h> /* Support color profiles */
++#ifdef USE_LCMS2
++#include <lcms2.h> /* Support color profiles */
++#else
++#undef USE_LCMS1
++#define USE_LCMS1
++#include <lcms.h>
++#endif
+ #endif
+ #ifdef LOCALEDIR
+ #include <libintl.h>
+@@ -8581,6 +8587,15 @@ notraw:
+ }
+
+ #ifndef NO_LCMS
++#ifdef USE_LCMS2
++static void lcms2_error_show_handler (cmsContext ContextID,
++ cmsUInt32Number ErrorCode,
++ const char *Text)
++{
++ fprintf (stderr, "lcms2: Error #%d; %s\n", ErrorCode, Text);
++}
++#endif
++
+ void CLASS apply_profile (const char *input, const char *output)
+ {
+ char *prof;
+@@ -8589,7 +8604,11 @@ void CLASS apply_profile (const char *input, const char *output)
+ FILE *fp;
+ unsigned size;
+
++#ifdef USE_LCMS2
++ cmsSetLogErrorHandler (lcms2_error_show_handler);
++#else
+ cmsErrorAction (LCMS_ERROR_SHOW);
++#endif
+ if (strcmp (input, "embed"))
+ hInProfile = cmsOpenProfileFromFile (input, "r");
+ else if (profile_length) {
+--
+1.8.3.1
+
diff --git a/dcraw.spec b/dcraw.spec
index 5863000..69d69b5 100644
--- a/dcraw.spec
+++ b/dcraw.spec
@@ -1,14 +1,15 @@
Summary: Tool for decoding raw image data from digital cameras
Name: dcraw
Version: 9.19
-Release: 2%{?dist}
+Release: 3%{?dist}
Group: Applications/Multimedia
License: GPLv2+
URL: http://cybercom.net/~dcoffin/dcraw
Source0: http://cybercom.net/~dcoffin/dcraw/archive/dcraw-%{version}.tar.gz
+Patch0: dcraw-9.19-lcms2.patch
BuildRequires: gettext
BuildRequires: libjpeg-devel
-BuildRequires: lcms-devel
+BuildRequires: lcms2-devel
BuildRequires: jasper-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%__id_u -n)
@@ -18,9 +19,14 @@ downloaded from digital cameras.
%prep
%setup -q -n dcraw
+%patch0 -p1 -b .lcms2
%build
-gcc %optflags -lm -ljpeg -llcms -ljasper -DLOCALEDIR="\"%{_datadir}/locale\"" -o dcraw dcraw.c
+gcc %optflags \
+ -lm -ljpeg -llcms2 -ljasper \
+ -DUSE_LCMS2 \
+ -DLOCALEDIR="\"%{_datadir}/locale\"" \
+ -o dcraw dcraw.c
# build language catalogs
for catsrc in dcraw_*.po; do
lang="${catsrc%.po}"
@@ -65,6 +71,9 @@ rm -rf %buildroot
%{_mandir}/man1/*
%changelog
+* Fri Sep 13 2013 Nils Philippsen <nils at redhat.com> - 9.19-3
+- build against the currently maintained version of lcms (2.x)
+
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 9.19-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
More information about the scm-commits
mailing list