diff options
author | antoine <antoine@FreeBSD.org> | 2014-12-24 21:24:01 +0800 |
---|---|---|
committer | antoine <antoine@FreeBSD.org> | 2014-12-24 21:24:01 +0800 |
commit | f24606eab0da4b6d7f40d8670c0c87bc4f17ed16 (patch) | |
tree | 47fb11f1a7ff5cffabea3350422cc0088e1aa9b2 /games | |
parent | 47e471827fafd7fed737b7e00132041031af03e1 (diff) | |
download | freebsd-ports-gnome-f24606eab0da4b6d7f40d8670c0c87bc4f17ed16.tar.gz freebsd-ports-gnome-f24606eab0da4b6d7f40d8670c0c87bc4f17ed16.tar.zst freebsd-ports-gnome-f24606eab0da4b6d7f40d8670c0c87bc4f17ed16.zip |
Properly support png 1.5
Obtained from: Gentoo
Diffstat (limited to 'games')
-rw-r--r-- | games/wargus/Makefile | 4 | ||||
-rw-r--r-- | games/wargus/files/patch-wartool.c | 30 |
2 files changed, 25 insertions, 9 deletions
diff --git a/games/wargus/Makefile b/games/wargus/Makefile index 7913add16d40..4c033a2edb89 100644 --- a/games/wargus/Makefile +++ b/games/wargus/Makefile @@ -15,7 +15,7 @@ COMMENT= Warcraft 2 mod that allows you to play Warcraft 2 with Stratagus LICENSE= GPLv2 # or later LICENSE_FILE= ${WRKSRC}/COPYING -LIB_DEPENDS= libpng15.so:${PORTSDIR}/graphics/png +LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png RUN_DEPENDS= stratagus:${PORTSDIR}/games/stratagus NOT_FOR_ARCHS= sparc64 @@ -24,7 +24,7 @@ USE_GNOME= gtk20 WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} SUB_FILES= ${PORTNAME} pkg-message -CPPFLAGS+= -I${LOCALBASE}/include -I${LOCALBASE}/include/libpng15 +CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib post-patch: diff --git a/games/wargus/files/patch-wartool.c b/games/wargus/files/patch-wartool.c index 7161df10796a..65ebc12ce8e9 100644 --- a/games/wargus/files/patch-wartool.c +++ b/games/wargus/files/patch-wartool.c @@ -1,15 +1,14 @@ ---- wartool.c.orig 2010-11-22 22:44:24.000000000 +0100 -+++ wartool.c 2012-05-05 12:37:53.000000000 +0200 -@@ -62,6 +62,8 @@ +--- wartool.orig.c ++++ wartool.c +@@ -61,6 +61,7 @@ + #include <unistd.h> #endif #include <ctype.h> - #include <png.h> +#include <zlib.h> -+#include <pngpriv.h> + #include <png.h> #include "endian.h" - #include "xmi2mid.h" -@@ -1876,7 +1878,7 @@ +@@ -1876,7 +1877,7 @@ return 1; } @@ -18,3 +17,20 @@ // FIXME: must free buffers!! png_destroy_write_struct(&png_ptr, &info_ptr); fclose(fp); +@@ -1888,14 +1889,8 @@ + png_set_compression_level(png_ptr, Z_BEST_COMPRESSION); + + // prepare the file information +- info_ptr->width = w; +- info_ptr->height = h; +- info_ptr->bit_depth = 8; +- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; +- info_ptr->interlace_type = 0; +- info_ptr->valid |= PNG_INFO_PLTE; +- info_ptr->palette = (png_colorp)pal; +- info_ptr->num_palette = 256; ++ png_set_IHDR(png_ptr, info_ptr, w, h, 8, PNG_COLOR_TYPE_PALETTE, 0, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); ++ png_set_PLTE(png_ptr, info_ptr, (png_colorp)pal, 256); + + if (transparent) { + unsigned char* p; |