aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Brodin <antoine@FreeBSD.org>2014-12-24 12:26:45 +0000
committerAntoine Brodin <antoine@FreeBSD.org>2014-12-24 12:26:45 +0000
commitb6756efc94a89dc7d74e9d88e89995733fc3779a (patch)
tree961b4a47b93f39e848f6d51cf4645c31939b34e3
parentb73d34a63c0582e64e78c57a23eb53f75148330b (diff)
downloadports-b6756efc94a89dc7d74e9d88e89995733fc3779a.tar.gz
ports-b6756efc94a89dc7d74e9d88e89995733fc3779a.zip
Properly support png 1.5
Obtained from: OpenBSD ports
Notes
Notes: svn path=/head/; revision=375449
-rw-r--r--games/xbubble/Makefile4
-rw-r--r--games/xbubble/files/patch-src-loadpng.c38
2 files changed, 19 insertions, 23 deletions
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 <stdio.h>
- #include <stdlib.h>
- #include <png.h>
-+#include <pngpriv.h>
-
- #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