Patchwork libmatchbox: fix build against libpng15

login
register
mail settings
Submitter Marko Lindqvist
Date Dec. 5, 2012, 10:33 p.m.
Message ID <1354746794-24290-1-git-send-email-cazfi74@gmail.com>
Download mbox | patch
Permalink /patch/40527/
State New
Headers show

Comments

Marko Lindqvist - Dec. 5, 2012, 10:33 p.m.
Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 .../libmatchbox/files/libpng15.patch               |   34 ++++++++++++++++++++
 .../libmatchbox/libmatchbox_1.9.bb                 |    6 ++--
 2 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-graphics/libmatchbox/files/libpng15.patch
Ross Burton - Dec. 5, 2012, 10:44 p.m.
Hi Marko,

Is this backwards compatible with libpng12, or should libmatchbox
check it has libpng15?

Ross
Marko Lindqvist - Dec. 6, 2012, 8:30 a.m.
On 6 December 2012 00:44, Burton, Ross <ross.burton@intel.com> wrote:
> Hi Marko,
>
> Is this backwards compatible with libpng12, or should libmatchbox
> check it has libpng15?
>
> Ross

 This is backwards compatible. Those functions exist in libpng12.


 - ML
Tomas Frydrych - Dec. 6, 2012, 3:02 p.m.
On 06/12/12 08:30, Marko Lindqvist wrote:
> On 6 December 2012 00:44, Burton, Ross <ross.burton@intel.com> wrote:
>> Hi Marko,
>>
>> Is this backwards compatible with libpng12, or should libmatchbox
>> check it has libpng15?
>>
>> Ross
> 
>  This is backwards compatible. Those functions exist in libpng12.

This should go directly into matchbox rather than being an OE patch I think.

Tomas
Ross Burton - Dec. 6, 2012, 3:58 p.m.
On 6 December 2012 15:02, Tomas Frydrych <tf+lists.yocto@r-finger.com> wrote:
> This should go directly into matchbox rather than being an OE patch I think.

With my Yocto developer hat on, I agree that all patches should be
considered for upstream first.

With my the-best-you'll-get Matchbox maintainer hat on, I've just
merged this patch (which interestingly didn't apply cleanly) upstream.

We should merge this for now, and when I make a release of libmatchbox
once I've confirmed that all patches we're carrying are upstream.

Ross

Patch

diff --git a/meta/recipes-graphics/libmatchbox/files/libpng15.patch b/meta/recipes-graphics/libmatchbox/files/libpng15.patch
new file mode 100644
index 0000000..a463d9e
--- /dev/null
+++ b/meta/recipes-graphics/libmatchbox/files/libpng15.patch
@@ -0,0 +1,34 @@ 
+diff -Nurd libmatchbox-1.9/libmb/mbpixbuf.c libmatchbox-1.9/libmb/mbpixbuf.c
+--- libmatchbox-1.9/libmb/mbpixbuf.c	2006-07-26 22:12:25.000000000 +0300
++++ libmatchbox-1.9/libmb/mbpixbuf.c	2012-12-06 00:08:28.645988727 +0200
+@@ -224,6 +224,7 @@
+   png_structp png_ptr;
+   png_infop info_ptr;
+   png_bytep *row_pointers;
++  png_byte ct;
+ 
+   if ((fd = fopen( file, "rb" )) == NULL) return NULL;
+ 
+@@ -247,7 +248,7 @@
+     return NULL;
+   }
+ 
+-  if ( setjmp( png_ptr->jmpbuf ) ) {
++  if ( setjmp( png_jmpbuf( png_ptr ) ) ) {
+     png_destroy_read_struct( &png_ptr, &info_ptr, NULL);
+     fclose(fd);
+     return NULL;
+@@ -268,9 +269,11 @@
+   if (( color_type == PNG_COLOR_TYPE_GRAY )||
+       ( color_type == PNG_COLOR_TYPE_GRAY_ALPHA ))
+     png_set_gray_to_rgb(png_ptr);
++
++  ct = png_get_color_type(png_ptr, info_ptr);
+  
+-  if ( info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA 
+-       || info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA
++  if ( ct == PNG_COLOR_TYPE_RGB_ALPHA 
++       || ct == PNG_COLOR_TYPE_GRAY_ALPHA
+        )
+     *has_alpha = 1;
+   else
diff --git a/meta/recipes-graphics/libmatchbox/libmatchbox_1.9.bb b/meta/recipes-graphics/libmatchbox/libmatchbox_1.9.bb
index 2fcd1b0..559f9b5 100644
--- a/meta/recipes-graphics/libmatchbox/libmatchbox_1.9.bb
+++ b/meta/recipes-graphics/libmatchbox/libmatchbox_1.9.bb
@@ -1,12 +1,14 @@ 
 require libmatchbox.inc
 
-PR = "r10"
+PR = "r11"
 
 SRC_URI = "http://downloads.yoctoproject.org/releases/matchbox/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
            file://16bppfixes.patch \
            file://configure_fixes.patch \
            file://check.m4 \
-           file://matchbox-start-fix.patch"
+           file://matchbox-start-fix.patch \
+           file://libpng15.patch \
+"
 
 SRC_URI[md5sum] = "465fa15c43bf0091a3810e7702fe143f"
 SRC_URI[sha256sum] = "f7054f93c57ba6b758d0e4f47d4d2dd96a7fe487e1157eb70a4d642910275aea"