diff mbox

[4/5] package/efl/libevas: Switch to giflib

Message ID 1422300260-5361-4-git-send-email-bernd.kuhls@t-online.de
State Accepted
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/efl/libevas/0001-giflib.patch |   91 +++++++++++++++++++++++++++++++++
 package/efl/libevas/Config.in         |    2 +-
 package/efl/libevas/libevas.mk        |    2 +-
 3 files changed, 93 insertions(+), 2 deletions(-)
 create mode 100644 package/efl/libevas/0001-giflib.patch

Comments

Fabio Porcedda March 7, 2015, 4:29 p.m. UTC | #1
On Mon, Jan 26, 2015 at 8:24 PM, Bernd Kuhls <bernd.kuhls@t-online.de> wrote:
>
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
>  package/efl/libevas/0001-giflib.patch |   91 +++++++++++++++++++++++++++++++++
>  package/efl/libevas/Config.in         |    2 +-
>  package/efl/libevas/libevas.mk        |    2 +-
>  3 files changed, 93 insertions(+), 2 deletions(-)
>  create mode 100644 package/efl/libevas/0001-giflib.patch
>
> diff --git a/package/efl/libevas/0001-giflib.patch b/package/efl/libevas/0001-giflib.patch
> new file mode 100644
> index 0000000..1176721
> --- /dev/null
> +++ b/package/efl/libevas/0001-giflib.patch
> @@ -0,0 +1,91 @@
> +Adjust source code to work with giflib 5.1x
> +
> +Downloaded from
> +http://commit.cvs.pld.groups.com.ru/332837-packagesevas_fix_building_with_giflib_51_rel_6
> +
> +Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> +
> +diff -uNr evas-1.7.10.org/src/modules/loaders/gif/evas_image_load_gif.c evas-1.7.10/src/modules/loaders/gif/evas_image_load_gif.c
> +--- evas-1.7.10.org/src/modules/loaders/gif/evas_image_load_gif.c      2013-08-01 17:41:35.000000000 +0200
> ++++ evas-1.7.10/src/modules/loaders/gif/evas_image_load_gif.c  2015-01-26 19:44:20.132955194 +0100
> +@@ -338,7 +338,7 @@
> +
> +    if (!cmap)
> +      {
> +-        DGifCloseFile(gif);
> ++        DGifCloseFile(gif, NULL);
> +         for (i = 0; i < scale_h; i++)
> +           {
> +              free(rows[i]);
> +@@ -725,7 +725,7 @@
> +    if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) ||
> +        IMG_TOO_BIG(w, h))
> +      {
> +-        DGifCloseFile(gif);
> ++        DGifCloseFile(gif, NULL);

IMHO it's cleaner if instead of adding this patch you can add a
post_patch hook that using sed change all "DGifCloseFile(gif)" to
"DGifCloseFile(gif, NULL)".

> +         if (IMG_TOO_BIG(w, h))
> +           *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
> +         else
> +@@ -740,7 +740,7 @@
> +         if (DGifGetRecordType(gif, &rec) == GIF_ERROR)
> +           {
> +              /* PrintGifError(); */
> +-             DGifCloseFile(gif);
> ++             DGifCloseFile(gif, NULL);
> +              *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
> +              return EINA_FALSE;
> +           }
> +@@ -754,7 +754,7 @@
> +              if (DGifGetImageDesc(gif) == GIF_ERROR)
> +                {
> +                   /* PrintGifError(); */
> +-                  DGifCloseFile(gif);
> ++                  DGifCloseFile(gif, NULL);
> +                   *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
> +                   return EINA_FALSE;
> +                }
> +@@ -762,7 +762,7 @@
> +              if (DGifGetCode(gif, &img_code, &img) == GIF_ERROR)
> +                {
> +                   /* PrintGifError(); */
> +-                  DGifCloseFile(gif);
> ++                  DGifCloseFile(gif, NULL);
> +                   *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
> +                   return EINA_FALSE;
> +                }
> +@@ -818,7 +818,7 @@
> +         ie->frames = NULL;
> +      }
> +
> +-   DGifCloseFile(gif);
> ++   DGifCloseFile(gif, NULL);
> +    *error = EVAS_LOAD_ERROR_NONE;
> +    return EINA_TRUE;
> + }
> +@@ -885,7 +885,7 @@
> +      }
> +
> +    ie->frames = eina_list_append(ie->frames, frame);
> +-   DGifCloseFile(gif);
> ++   DGifCloseFile(gif, NULL);
> +    return EINA_TRUE;
> + }
> +
> +@@ -959,7 +959,7 @@
> +                   *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
> +                   return EINA_FALSE;
> +                }
> +-             DGifCloseFile(gif);
> ++             DGifCloseFile(gif, NULL);
> +              *error = EVAS_LOAD_ERROR_NONE;
> +              return EINA_TRUE;
> +           }
> +@@ -1080,7 +1080,7 @@
> +          }
> +      } while (rec != TERMINATE_RECORD_TYPE);
> +
> +-   DGifCloseFile(gif);
> ++   DGifCloseFile(gif, NULL);
> +    return duration;
> + }
> +
> diff --git a/package/efl/libevas/Config.in b/package/efl/libevas/Config.in
> index febc115..fa36e80 100644
> --- a/package/efl/libevas/Config.in
> +++ b/package/efl/libevas/Config.in
> @@ -177,7 +177,7 @@ config BR2_PACKAGE_LIBEVAS_JPEG
>
>  config BR2_PACKAGE_LIBEVAS_GIF
>         bool "libevas gif loader"
> -       select BR2_PACKAGE_LIBUNGIF
> +       select BR2_PACKAGE_GIFLIB
>         help
>           This enables the loader code that loads gif files using
>           libungif.
> diff --git a/package/efl/libevas/libevas.mk b/package/efl/libevas/libevas.mk
> index b5a2d72..9f2e801 100644
> --- a/package/efl/libevas/libevas.mk
> +++ b/package/efl/libevas/libevas.mk
> @@ -167,7 +167,7 @@ endif
>
>  ifeq ($(BR2_PACKAGE_LIBEVAS_GIF),y)
>  LIBEVAS_CONF_OPTS += --enable-image-loader-gif
> -LIBEVAS_DEPENDENCIES += libungif
> +LIBEVAS_DEPENDENCIES += giflib
>  else
>  LIBEVAS_CONF_OPTS += --disable-image-loader-gif
>  endif
> --
> 1.7.10.4
>
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Thomas Petazzoni March 7, 2015, 4:32 p.m. UTC | #2
Dear Fabio Porcedda,

On Sat, 7 Mar 2015 17:29:56 +0100, Fabio Porcedda wrote:

> IMHO it's cleaner if instead of adding this patch you can add a
> post_patch hook that using sed change all "DGifCloseFile(gif)" to
> "DGifCloseFile(gif, NULL)".

I don't agree. Such sed expressions can very easily be overlooked when
bumping the package, and they don't solve a problem that should be
solved by submitting a patch to the upstream project.

Thomas
Fabio Porcedda March 7, 2015, 5:01 p.m. UTC | #3
On Sat, Mar 7, 2015 at 5:32 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Fabio Porcedda,
>
> On Sat, 7 Mar 2015 17:29:56 +0100, Fabio Porcedda wrote:
>
>> IMHO it's cleaner if instead of adding this patch you can add a
>> post_patch hook that using sed change all "DGifCloseFile(gif)" to
>> "DGifCloseFile(gif, NULL)".
>
> I don't agree. Such sed expressions can very easily be overlooked when
> bumping the package, and they don't solve a problem that should be
> solved by submitting a patch to the upstream project.

I don't know exactly but the libevas seems dead, the last change in
the git repository was made 15 months ago.

https://git.enlightenment.org/legacy/evas.git/

I hope there is a chance for the patch to be accepted.

Bernd, have you tried to send the patch upstream?

Could you add a note in patch to justify the change?
Example:
From http://giflib.sourceforge.net/gif_lib.html
GIF file openers and closers - DGifOpenFileName(),
DGifOpenFileHandle(), DGifOpen(), DGifClose(), EGifOpenFileName(),
EGifOpenFileHandle(), EGifOpen(), and EGifClose() - all now take a
final integer address argument. If non-null, this is used to pass back
an error code when the function returns NULL.

With above note added and because the sed option is not available:
Acked-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Tested-by: Fabio Porcedda <fabio.porcedda@gmail.com>
[build fine the following defconfig:
BR2_TOOLCHAIN_EXTERNAL=y
BR2_PACKAGE_EFL=y
BR2_PACKAGE_LIBEVAS=y
BR2_PACKAGE_LIBEVAS_GIF=y]

BR
Thomas Petazzoni March 8, 2015, 7:15 a.m. UTC | #4
Dear Fabio Porcedda,

On Sat, 7 Mar 2015 18:01:41 +0100, Fabio Porcedda wrote:

> I don't know exactly but the libevas seems dead, the last change in
> the git repository was made 15 months ago.

The EFL stuff in Buildroot needs a complete update: most of the
EFL libraries have been merged into one single project/tarball. So many
of the EFL related packages in Buildroot should be removed, and the
main EFL library bumped to a higher version.

> https://git.enlightenment.org/legacy/evas.git/

See the "legacy" in this URL ?

Thomas
Fabio Porcedda March 8, 2015, 7:28 a.m. UTC | #5
On Sun, Mar 8, 2015 at 8:15 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Fabio Porcedda,
>
> On Sat, 7 Mar 2015 18:01:41 +0100, Fabio Porcedda wrote:
>
>> I don't know exactly but the libevas seems dead, the last change in
>> the git repository was made 15 months ago.
>
> The EFL stuff in Buildroot needs a complete update: most of the
> EFL libraries have been merged into one single project/tarball. So many
> of the EFL related packages in Buildroot should be removed, and the
> main EFL library bumped to a higher version.
>
>> https://git.enlightenment.org/legacy/evas.git/
>
> See the "legacy" in this URL ?


I understand that is a legacy repository but because you talked about
to send a patch upstream i was trying to understand if there is any
chance that the patch will be accepted.

So when you have talked about to send the patch upstream didn't know
about the legacy status of this repository?

Nevertheless the https://git.enlightenment.org/legacy/imlib2.git/
repository gets updated even if it has the "legacy" word in the
prefix, but it's the only one so maybe it's just an exception.

BR
Thomas Petazzoni March 8, 2015, 7:46 a.m. UTC | #6
Dear Fabio Porcedda,

On Sun, 8 Mar 2015 08:28:44 +0100, Fabio Porcedda wrote:

> I understand that is a legacy repository but because you talked about
> to send a patch upstream i was trying to understand if there is any
> chance that the patch will be accepted.
> 
> So when you have talked about to send the patch upstream didn't know
> about the legacy status of this repository?

Well, when you want to send a patch upstream, then obviously you have
to send the patch based on the latest upstream version. Which generally
involves bumping the Buildroot package to use the latest stable version
from upstream.

In the case of EFL, it indeed involves quite a bit of work, because all
the libraries that used to be split in separate tarballs are now
provided as one single tarball by upstream.

See https://phab.enlightenment.org/phame/live/3/post/efl_1_8/ :

"""
We have merged Ecore, Edje, Eet, Eeze, Efreet, Eina, Eio, Embryo,
Emotion, Ethumb, Evas and Evil into a single EFL package (as you can
see above these are no longer there, but inside the EFL distribution).
We also added in Eldbus, EPhysics, and Escape.
"""

Best regards,

Thomas
Fabio Porcedda March 8, 2015, 7:54 a.m. UTC | #7
On Sun, Mar 8, 2015 at 8:46 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Fabio Porcedda,
>
> On Sun, 8 Mar 2015 08:28:44 +0100, Fabio Porcedda wrote:
>
>> I understand that is a legacy repository but because you talked about
>> to send a patch upstream i was trying to understand if there is any
>> chance that the patch will be accepted.
>>
>> So when you have talked about to send the patch upstream didn't know
>> about the legacy status of this repository?
>
> Well, when you want to send a patch upstream, then obviously you have
> to send the patch based on the latest upstream version. Which generally
> involves bumping the Buildroot package to use the latest stable version
> from upstream.
>
> In the case of EFL, it indeed involves quite a bit of work, because all
> the libraries that used to be split in separate tarballs are now
> provided as one single tarball by upstream.
>
> See https://phab.enlightenment.org/phame/live/3/post/efl_1_8/ :
>
> """
> We have merged Ecore, Edje, Eet, Eeze, Efreet, Eina, Eio, Embryo,
> Emotion, Ethumb, Evas and Evil into a single EFL package (as you can
> see above these are no longer there, but inside the EFL distribution).
> We also added in Eldbus, EPhysics, and Escape.
> """

In the efl project where the evas library was merged, they have
already added support for giflib 5:
https://git.enlightenment.org/core/efl.git/commit/?id=096ae0e86fe306d40d744c8c11960dd9e736c4b4

So maybe we can just back port that commit.

BR
Thomas Petazzoni March 8, 2015, 8:03 a.m. UTC | #8
Dear Fabio Porcedda,

On Sun, 8 Mar 2015 08:54:52 +0100, Fabio Porcedda wrote:

> In the efl project where the evas library was merged, they have
> already added support for giflib 5:
> https://git.enlightenment.org/core/efl.git/commit/?id=096ae0e86fe306d40d744c8c11960dd9e736c4b4
> 
> So maybe we can just back port that commit.

If you bump EFL to the latest version, there's no need to do this,
since the commit is already part of EFL releases.

Thomas
Thomas Petazzoni April 4, 2015, 4:45 p.m. UTC | #9
Dear Bernd Kuhls,

On Mon, 26 Jan 2015 20:24:19 +0100, Bernd Kuhls wrote:
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
>  package/efl/libevas/0001-giflib.patch |   91 +++++++++++++++++++++++++++++++++
>  package/efl/libevas/Config.in         |    2 +-
>  package/efl/libevas/libevas.mk        |    2 +-
>  3 files changed, 93 insertions(+), 2 deletions(-)
>  create mode 100644 package/efl/libevas/0001-giflib.patch

Thanks, applied.

Thomas
diff mbox

Patch

diff --git a/package/efl/libevas/0001-giflib.patch b/package/efl/libevas/0001-giflib.patch
new file mode 100644
index 0000000..1176721
--- /dev/null
+++ b/package/efl/libevas/0001-giflib.patch
@@ -0,0 +1,91 @@ 
+Adjust source code to work with giflib 5.1x
+
+Downloaded from
+http://commit.cvs.pld.groups.com.ru/332837-packagesevas_fix_building_with_giflib_51_rel_6
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+
+diff -uNr evas-1.7.10.org/src/modules/loaders/gif/evas_image_load_gif.c evas-1.7.10/src/modules/loaders/gif/evas_image_load_gif.c
+--- evas-1.7.10.org/src/modules/loaders/gif/evas_image_load_gif.c	2013-08-01 17:41:35.000000000 +0200
++++ evas-1.7.10/src/modules/loaders/gif/evas_image_load_gif.c	2015-01-26 19:44:20.132955194 +0100
+@@ -338,7 +338,7 @@
+ 
+    if (!cmap)
+      {
+-        DGifCloseFile(gif);
++        DGifCloseFile(gif, NULL);
+         for (i = 0; i < scale_h; i++)
+           {
+              free(rows[i]);
+@@ -725,7 +725,7 @@
+    if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) ||
+        IMG_TOO_BIG(w, h))
+      {
+-        DGifCloseFile(gif);
++        DGifCloseFile(gif, NULL);
+         if (IMG_TOO_BIG(w, h))
+           *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+         else
+@@ -740,7 +740,7 @@
+         if (DGifGetRecordType(gif, &rec) == GIF_ERROR)
+           {
+              /* PrintGifError(); */
+-             DGifCloseFile(gif);
++             DGifCloseFile(gif, NULL);
+              *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+              return EINA_FALSE;
+           }
+@@ -754,7 +754,7 @@
+              if (DGifGetImageDesc(gif) == GIF_ERROR)
+                {
+                   /* PrintGifError(); */
+-                  DGifCloseFile(gif);
++                  DGifCloseFile(gif, NULL);
+                   *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+                   return EINA_FALSE;
+                }
+@@ -762,7 +762,7 @@
+              if (DGifGetCode(gif, &img_code, &img) == GIF_ERROR)
+                {
+                   /* PrintGifError(); */
+-                  DGifCloseFile(gif);
++                  DGifCloseFile(gif, NULL);
+                   *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+                   return EINA_FALSE;
+                }
+@@ -818,7 +818,7 @@
+         ie->frames = NULL;
+      }
+ 
+-   DGifCloseFile(gif);
++   DGifCloseFile(gif, NULL);
+    *error = EVAS_LOAD_ERROR_NONE;
+    return EINA_TRUE;
+ }
+@@ -885,7 +885,7 @@
+      }
+ 
+    ie->frames = eina_list_append(ie->frames, frame);
+-   DGifCloseFile(gif);
++   DGifCloseFile(gif, NULL);
+    return EINA_TRUE;
+ }
+ 
+@@ -959,7 +959,7 @@
+                   *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+                   return EINA_FALSE;
+                }
+-             DGifCloseFile(gif);
++             DGifCloseFile(gif, NULL);
+              *error = EVAS_LOAD_ERROR_NONE;
+              return EINA_TRUE;
+           }
+@@ -1080,7 +1080,7 @@
+          }
+      } while (rec != TERMINATE_RECORD_TYPE);
+ 
+-   DGifCloseFile(gif);
++   DGifCloseFile(gif, NULL);
+    return duration;
+ }
+ 
diff --git a/package/efl/libevas/Config.in b/package/efl/libevas/Config.in
index febc115..fa36e80 100644
--- a/package/efl/libevas/Config.in
+++ b/package/efl/libevas/Config.in
@@ -177,7 +177,7 @@  config BR2_PACKAGE_LIBEVAS_JPEG
 
 config BR2_PACKAGE_LIBEVAS_GIF
 	bool "libevas gif loader"
-	select BR2_PACKAGE_LIBUNGIF
+	select BR2_PACKAGE_GIFLIB
 	help
 	  This enables the loader code that loads gif files using
 	  libungif.
diff --git a/package/efl/libevas/libevas.mk b/package/efl/libevas/libevas.mk
index b5a2d72..9f2e801 100644
--- a/package/efl/libevas/libevas.mk
+++ b/package/efl/libevas/libevas.mk
@@ -167,7 +167,7 @@  endif
 
 ifeq ($(BR2_PACKAGE_LIBEVAS_GIF),y)
 LIBEVAS_CONF_OPTS += --enable-image-loader-gif
-LIBEVAS_DEPENDENCIES += libungif
+LIBEVAS_DEPENDENCIES += giflib
 else
 LIBEVAS_CONF_OPTS += --disable-image-loader-gif
 endif