From b6756efc94a89dc7d74e9d88e89995733fc3779a Mon Sep 17 00:00:00 2001 From: Antoine Brodin Date: Wed, 24 Dec 2014 12:26:45 +0000 Subject: Properly support png 1.5 Obtained from: OpenBSD ports --- games/xbubble/Makefile | 4 ++-- games/xbubble/files/patch-src-loadpng.c | 38 +++++++++++++++------------------ 2 files changed, 19 insertions(+), 23 deletions(-) (limited to 'games') diff --git a/games/xbubble/Makefile b/games/xbubble/Makefile index c4317f12efc2..94b578804028 100644 --- a/games/xbubble/Makefile +++ b/games/xbubble/Makefile @@ -13,13 +13,13 @@ COMMENT= Puzzle Bobble clone for Unix/X11 platforms LICENSE= GPLv2 # or later LICENSE_FILE= ${WRKSRC}/COPYING -LIB_DEPENDS= libpng15.so:${PORTSDIR}/graphics/png +LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png USE_XORG= x11 xmu GNU_CONFIGURE= yes USES= gmake -CPPFLAGS+= -I${LOCALBASE}/include/libpng15 +CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib OPTIONS_DEFINE= NLS diff --git a/games/xbubble/files/patch-src-loadpng.c b/games/xbubble/files/patch-src-loadpng.c index 3a0c67cf9712..9fa811b97f32 100644 --- a/games/xbubble/files/patch-src-loadpng.c +++ b/games/xbubble/files/patch-src-loadpng.c @@ -1,28 +1,24 @@ ---- src/loadpng.c.orig 2003-09-30 14:55:20.000000000 +0200 -+++ src/loadpng.c 2012-04-29 13:39:04.000000000 +0200 -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - - #include "gettext.h" - -@@ -55,7 +56,7 @@ - } - /* ensure that we opened a PNG file */ - fread( header, 1, 8, fd ); -- if ( ! png_check_sig( header, 8 ) ) { -+ if ( png_sig_cmp( header, 0, 8 ) ) { - fclose(fd); - fprintf(stderr,_("File %s does not have a valid PNG signature.\n"), file); - return NULL; -@@ -73,7 +74,7 @@ +$OpenBSD: patch-src_loadpng_c,v 1.1 2011/07/08 20:38:01 naddy Exp $ + +Fix build with png-1.5. + +--- src/loadpng.c.orig Wed Jul 6 15:26:00 2011 ++++ src/loadpng.c Wed Jul 6 15:28:42 2011 +@@ -73,7 +73,7 @@ unsigned char * load_png_file( const char *file, return NULL; } /* libpng does a longjmp here when it encounters an error */ - if ( setjmp( png_ptr->jmpbuf ) ) { -+ if ( setjmp( png_jmpbuf(png_ptr) ) ) { ++ if ( setjmp( png_jmpbuf( png_ptr ) ) ) { png_destroy_read_struct( &png_ptr, &info_ptr, NULL); fclose(fd); return NULL; +@@ -95,7 +95,7 @@ unsigned char * load_png_file( const char *file, + png_set_gray_to_rgb(png_ptr); + + /* detect alpha layer */ +- if (( info_ptr->color_type & PNG_COLOR_MASK_ALPHA )|| ++ if (( png_get_color_type ( png_ptr, info_ptr ) & PNG_COLOR_MASK_ALPHA )|| + ( png_get_valid( png_ptr, info_ptr, PNG_INFO_tRNS ))) + *has_alpha = 1; + else -- cgit v1.2.3