Skip to contentSkip to conversation

libmatchbox: fix build against libpng15

PATCH In review Marko Lindqvist 3 participants 5 messages Dec 5, 2012 – Dec 6, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libmatchbox: fix build against libpng15

---
 .../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
meta/recipes-graphics/libmatchbox/files/libpng15.patch new file +34 -0
new file mode 100644
index 0000000..a463d9e
@@ -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
meta/recipes-graphics/libmatchbox/libmatchbox_1.9.bb +4 -2
index 2fcd1b0..559f9b5 100644
@@ -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"
Signature · 1 line
1.7.10.4
#1 lore raw

Hi Marko,

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

Ross

#2 lore raw
Quoted 6 lines · Ross

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

#3 lore raw
Quoted 9 lines · Marko Lindqvist
Quoted 6 lines · Ross

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

Signature · 1 line
http://sleepfive.com
#4 lore raw
Quoted 1 line · Tomas Frydrych

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