- fix building with ImageMagick 7 auto/th/fail-2.0.1-10
authorJan Rękorajski <baggins@pld-linux.org>
Mon, 26 Dec 2016 10:24:12 +0000 (11:24 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Mon, 26 Dec 2016 10:24:12 +0000 (11:24 +0100)
- rel 10

fail.spec
imagemagick7.patch [new file with mode: 0644]

index dfdd585..3fc9ac6 100644 (file)
--- a/fail.spec
+++ b/fail.spec
@@ -15,11 +15,12 @@ Summary:    FAIL - First Atari Image Library
 Summary(pl.UTF-8):     FAIL (First Atari Image Library) - biblioteka do obrazów w formatach Atari
 Name:          fail
 Version:       2.0.1
-Release:       9
+Release:       10
 License:       GPL v2+
 Group:         Applications/Graphics
 Source0:       http://downloads.sourceforge.net/fail/%{name}-%{version}.tar.gz
 # Source0-md5: b9362106f9a23a1f99ff7bece94d9aa7
+Patch0:                imagemagick7.patch
 URL:           http://fail.sourceforge.net/
 %{?with_magick:BuildRequires:  ImageMagick-devel >= 1:6.8}
 %{?with_html5:BuildRequires:   asciidoc}
@@ -79,13 +80,14 @@ Koder FAIL dla ImageMagicka, czytający formaty Atari.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %{__make} all fail-mime.xml \
        CC="%{__cc}" \
        CFLAGS="%{rpmcflags} -Wall" \
 %if %{with magick}
-       MAGICK_INCLUDE_PATH=/usr/include/ImageMagick-6/private \
+       MAGICK_INCLUDE_PATH=/usr/include/ImageMagick-7/private \
        CAN_INSTALL_MAGICK=1
 %endif
 
diff --git a/imagemagick7.patch b/imagemagick7.patch
new file mode 100644 (file)
index 0000000..6d6f6fb
--- /dev/null
@@ -0,0 +1,101 @@
+diff -ur fail-2.0.1/failmagick.c fail-2.0.1-im7/failmagick.c
+--- fail-2.0.1/failmagick.c    2013-03-20 10:14:11.000000000 +0100
++++ fail-2.0.1-im7/failmagick.c        2016-12-26 11:22:35.114121922 +0100
+@@ -23,23 +23,24 @@
+ #include "fail.h"
+-#include "magick/studio.h"
+-#include "magick/blob.h"
+-#include "magick/blob-private.h"
+-#include "magick/colorspace.h"
+-#include "magick/exception.h"
+-#include "magick/exception-private.h"
+-#include "magick/image.h"
+-#include "magick/image-private.h"
+-#include "magick/list.h"
+-#include "magick/magick.h"
+-#include "magick/memory_.h"
+-#include "magick/monitor.h"
+-#include "magick/monitor-private.h"
+-#include "magick/quantum-private.h"
+-#include "magick/static.h"
+-#include "magick/string_.h"
+-#include "magick/module.h"
++#include "MagickCore/studio.h"
++#include "MagickCore/blob.h"
++#include "MagickCore/blob-private.h"
++#include "MagickCore/colorspace.h"
++#include "MagickCore/exception.h"
++#include "MagickCore/exception-private.h"
++#include "MagickCore/image.h"
++#include "MagickCore/image-private.h"
++#include "MagickCore/list.h"
++#include "MagickCore/magick.h"
++#include "MagickCore/memory_.h"
++#include "MagickCore/monitor.h"
++#include "MagickCore/monitor-private.h"
++#include "MagickCore/pixel-accessor.h"
++#include "MagickCore/quantum-private.h"
++#include "MagickCore/static.h"
++#include "MagickCore/string_.h"
++#include "MagickCore/module.h"
+ static MagickBooleanType IsFAIL(const unsigned char *magick, const size_t length)
+ {
+@@ -53,18 +54,18 @@
+       int content_len;
+       FAIL *fail;
+       Image *image;
+-      PixelPacket *q;
++      Quantum *q;
+       const int *pixels;
+       int num_pixels;
+       int i;
+       assert(image_info != NULL);
+-      assert(image_info->signature == MagickSignature);
++      assert(image_info->signature == MagickCoreSignature);
+       if (image_info->debug)
+               LogMagickEvent(TraceEvent, GetMagickModule(), "%s", image_info->filename);
+       assert(exception != NULL);
+-      assert(exception->signature == MagickSignature);
+-      image = AcquireImage(image_info);
++      assert(exception->signature == MagickCoreSignature);
++      image = AcquireImage(image_info, exception);
+       if (!OpenBlob(image_info, image, ReadBinaryBlobMode, exception)) {
+               (void) DestroyImageList(image);
+               return NULL;
+@@ -82,8 +83,7 @@
+       }
+       image->depth = 8;
+-      if (!SetImageExtent(image, FAIL_GetWidth(fail), FAIL_GetHeight(fail))) {
+-              InheritException(exception, &image->exception);
++      if (!SetImageExtent(image, FAIL_GetWidth(fail), FAIL_GetHeight(fail), exception)) {
+               FAIL_Delete(fail);
+               (void) DestroyImageList(image);
+               return NULL;
+@@ -100,9 +100,10 @@
+       num_pixels = image->columns * image->rows;
+       for (i = 0; i < num_pixels; i++) {
+               int rgb = pixels[i];
+-              q[i].red = ScaleCharToQuantum((unsigned char) (rgb >> 16));
+-              q[i].green = ScaleCharToQuantum((unsigned char) (rgb >> 8));
+-              q[i].blue = ScaleCharToQuantum((unsigned char) rgb);
++              SetPixelRed(image, ScaleCharToQuantum((unsigned char) (rgb >> 16)), q);
++              SetPixelGreen(image, ScaleCharToQuantum((unsigned char) (rgb >> 8)), q);
++              SetPixelBlue(image, ScaleCharToQuantum((unsigned char) rgb), q);
++              q += GetPixelChannels(image);
+       }
+       FAIL_Delete(fail);
+       SyncAuthenticPixels(image, exception);
+@@ -250,7 +251,7 @@
+       const struct Format *pf;
+       MagickInfo *entry;
+       for (pf = formats; pf < formats + sizeof(formats) / sizeof(formats[0]); pf++) {
+-              entry = SetMagickInfo(pf->name);
++              entry = AcquireMagickInfo(ConstantString("FAIL"), pf->name, pf->description);
+               entry->decoder = ReadFAILImage;
+               entry->magick = IsFAIL;
+               entry->description = ConstantString(pf->description);
This page took 0.09915 seconds and 4 git commands to generate.