diff mbox

[3/5] package/imlib2: Switch to giflib

Message ID 1422300260-5361-3-git-send-email-bernd.kuhls@t-online.de
State Superseded
Headers show

Commit Message

Bernd Kuhls Jan. 26, 2015, 7:24 p.m. UTC
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/imlib2/0001-giflib51.patch |   71 ++++++++++++++++++++++++++++++++++++
 package/imlib2/Config.in           |    2 +-
 package/imlib2/imlib2.mk           |    2 +-
 3 files changed, 73 insertions(+), 2 deletions(-)
 create mode 100644 package/imlib2/0001-giflib51.patch

Comments

Peter Korsgaard Jan. 27, 2015, 3:25 p.m. UTC | #1
>>>>> "Bernd" == Bernd Kuhls <bernd.kuhls@t-online.de> writes:

 > Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
 > ---
 >  package/imlib2/0001-giflib51.patch |   71 ++++++++++++++++++++++++++++++++++++
 >  package/imlib2/Config.in           |    2 +-
 >  package/imlib2/imlib2.mk           |    2 +-
 >  3 files changed, 73 insertions(+), 2 deletions(-)
 >  create mode 100644 package/imlib2/0001-giflib51.patch

How about instead bumping our imlib2 version? I see there is some giflib
support in upstream git:

https://git.enlightenment.org/legacy/imlib2.git/log/
Bernd Kuhls Jan. 29, 2015, 7:13 p.m. UTC | #2
[posted and mailed]

Peter Korsgaard <peter@korsgaard.com> wrote in 
news:8761bsz1n6.fsf@dell.be.48ers.dk:

> How about instead bumping our imlib2 version? I see there is some giflib
> support in upstream git:
> 
> https://git.enlightenment.org/legacy/imlib2.git/log/

Hi,

bumping to 1.4.6 and backporting some giflib related patches or switching 
directly to the upstream git HEAD is an option, but I am not in a position to 
runtime test the packages depending on imlib2, therefore I chose a way to 
support giflib with a minimum of code changes. I can provide v2 of my patch 
with one of my suggestions but fixing build errors later on will be a 
difficult task for me timewise. What do you suggest?

Since imlib2 1.4.6 was released over a year ago I suppose that there is not a 
big audience for this package in the buildroot community, the only reason I 
touched imlib2 is my desire to get rid of libungif in favour of giflib 
because Kodi 15.0 will depend on it ;)

Regards, Bernd
Fabio Porcedda March 7, 2015, 6:09 p.m. UTC | #3
On Thu, Jan 29, 2015 at 8:13 PM, Bernd Kuhls <bernd.kuhls@t-online.de> wrote:
> [posted and mailed]
>
> Peter Korsgaard <peter@korsgaard.com> wrote in
> news:8761bsz1n6.fsf@dell.be.48ers.dk:
>
>> How about instead bumping our imlib2 version? I see there is some giflib
>> support in upstream git:
>>
>> https://git.enlightenment.org/legacy/imlib2.git/log/
>
> Hi,
>
> bumping to 1.4.6 and backporting some giflib related patches or switching
> directly to the upstream git HEAD is an option, but I am not in a position to
> runtime test the packages depending on imlib2, therefore I chose a way to
> support giflib with a minimum of code changes. I can provide v2 of my patch
> with one of my suggestions but fixing build errors later on will be a
> difficult task for me timewise. What do you suggest?
>
> Since imlib2 1.4.6 was released over a year ago I suppose that there is not a
> big audience for this package in the buildroot community, the only reason I
> touched imlib2 is my desire to get rid of libungif in favour of giflib
> because Kodi 15.0 will depend on it ;)

I've made a patch for bumping it to 1.4.6 and back porting few
upstream patches to support giflib:
http://patchwork.ozlabs.org/patch/447618/
http://patchwork.ozlabs.org/patch/447619/

Sorry but I've found your patch only right before sending mine.

BR
diff mbox

Patch

diff --git a/package/imlib2/0001-giflib51.patch b/package/imlib2/0001-giflib51.patch
new file mode 100644
index 0000000..2b46329
--- /dev/null
+++ b/package/imlib2/0001-giflib51.patch
@@ -0,0 +1,71 @@ 
+Adjust source code to work with giflib 5.1x
+
+Downloaded from
+https://projects.archlinux.org/svntogit/packages.git/plain/trunk/imlib2-giflib51.patch?h=packages/imlib2
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+
+diff -ruN imlib2-1.4.6.orig/src/modules/loaders/loader_gif.c imlib2-1.4.6/src/modules/loaders/loader_gif.c
+--- imlib2-1.4.6.orig/src/modules/loaders/loader_gif.c	2013-12-21 10:16:10.000000000 +0000
++++ imlib2-1.4.6/src/modules/loaders/loader_gif.c	2014-05-27 09:52:35.857291512 +0000
+@@ -36,7 +36,7 @@
+ #endif
+    if (fd < 0)
+       return 0;
+-   gif = DGifOpenFileHandle(fd);
++   gif = DGifOpenFileHandle(fd, NULL);
+    if (!gif)
+      {
+         close(fd);
+@@ -60,13 +60,13 @@
+              h = gif->Image.Height;
+              if (!IMAGE_DIMENSIONS_OK(w, h))
+                {
+-                  DGifCloseFile(gif);
++                  DGifCloseFile(gif, NULL);
+                   return 0;
+                }
+              rows = malloc(h * sizeof(GifRowType *));
+              if (!rows)
+                {
+-                  DGifCloseFile(gif);
++                  DGifCloseFile(gif, NULL);
+                   return 0;
+                }
+              for (i = 0; i < h; i++)
+@@ -78,7 +78,7 @@
+                   rows[i] = malloc(w * sizeof(GifPixelType));
+                   if (!rows[i])
+                     {
+-                       DGifCloseFile(gif);
++                       DGifCloseFile(gif, NULL);
+                        for (i = 0; i < h; i++)
+                          {
+                             if (rows[i])
+@@ -150,7 +150,7 @@
+         im->data = (DATA32 *) malloc(sizeof(DATA32) * w * h);
+         if (!im->data)
+           {
+-             DGifCloseFile(gif);
++             DGifCloseFile(gif, NULL);
+              free(rows);
+              return 0;
+           }
+@@ -181,7 +181,7 @@
+                        last_per = (int)per;
+                        if (!(progress(im, (int)per, 0, last_y, w, i)))
+                          {
+-                            DGifCloseFile(gif);
++                            DGifCloseFile(gif, NULL);
+                             for (i = 0; i < h; i++)
+                               {
+                                  free(rows[i]);
+@@ -198,7 +198,7 @@
+      {
+         progress(im, 100, 0, last_y, w, h);
+      }
+-   DGifCloseFile(gif);
++   DGifCloseFile(gif, NULL);
+    for (i = 0; i < h; i++)
+      {
+         free(rows[i]);
diff --git a/package/imlib2/Config.in b/package/imlib2/Config.in
index a323a8d..7aac074 100644
--- a/package/imlib2/Config.in
+++ b/package/imlib2/Config.in
@@ -23,7 +23,7 @@  config BR2_PACKAGE_IMLIB2_PNG
 
 config BR2_PACKAGE_IMLIB2_GIF
 	bool "GIF support"
-	select BR2_PACKAGE_LIBUNGIF
+	select BR2_PACKAGE_GIFLIB
 
 config BR2_PACKAGE_IMLIB2_TIFF
 	bool "TIFF support"
diff --git a/package/imlib2/imlib2.mk b/package/imlib2/imlib2.mk
index 62f3989..d8feeb6 100644
--- a/package/imlib2/imlib2.mk
+++ b/package/imlib2/imlib2.mk
@@ -38,7 +38,7 @@  endif
 
 ifeq ($(BR2_PACKAGE_IMLIB2_GIF),y)
 	IMLIB2_CONF_OPTS += --with-gif
-	IMLIB2_DEPENDENCIES += libungif
+	IMLIB2_DEPENDENCIES += giflib
 else
 	IMLIB2_CONF_OPTS += --without-gif
 endif