diff options
author | antoine <antoine@FreeBSD.org> | 2014-12-24 21:02:36 +0800 |
---|---|---|
committer | antoine <antoine@FreeBSD.org> | 2014-12-24 21:02:36 +0800 |
commit | 7c3e39ca16c67eac63a66e243866b3c053bb7b05 (patch) | |
tree | 1cb3f0491d9b84c1d955b86b6936fb5ddf52ac45 /x11 | |
parent | af51ef73285b356c3e42a62b0728b42206013849 (diff) | |
download | freebsd-ports-gnome-7c3e39ca16c67eac63a66e243866b3c053bb7b05.tar.gz freebsd-ports-gnome-7c3e39ca16c67eac63a66e243866b3c053bb7b05.tar.zst freebsd-ports-gnome-7c3e39ca16c67eac63a66e243866b3c053bb7b05.zip |
Properly support png 1.5
Obtained from: upstream, markusfisch/bbdock on github
Diffstat (limited to 'x11')
-rw-r--r-- | x11/bbdock/Makefile | 3 | ||||
-rw-r--r-- | x11/bbdock/files/patch-Slot.cc | 59 |
2 files changed, 53 insertions, 9 deletions
diff --git a/x11/bbdock/Makefile b/x11/bbdock/Makefile index f41cdc3e7eaa..911b4e54c8a5 100644 --- a/x11/bbdock/Makefile +++ b/x11/bbdock/Makefile @@ -12,11 +12,10 @@ COMMENT= Application launcher for Blackbox-like window manager LICENSE= BSD3CLAUSE -LIB_DEPENDS= libpng15.so:${PORTSDIR}/graphics/png +LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png GNU_CONFIGURE= yes USE_XORG= x11 -CPPFLAGS+= -I${LOCALBASE}/include/libpng15 PORTDOCS= README PLIST_FILES= bin/bbdock diff --git a/x11/bbdock/files/patch-Slot.cc b/x11/bbdock/files/patch-Slot.cc index 5ddeebaad37c..fcd5fc616378 100644 --- a/x11/bbdock/files/patch-Slot.cc +++ b/x11/bbdock/files/patch-Slot.cc @@ -1,10 +1,55 @@ ---- src/Slot.cc.orig 2011-03-29 21:48:36.000000000 +0200 -+++ src/Slot.cc 2012-05-06 10:01:10.000000000 +0200 -@@ -38,6 +38,7 @@ - #include <string> +--- src/Slot.cc.orig 2011-03-29 19:48:36 UTC ++++ src/Slot.cc +@@ -420,6 +420,8 @@ const bool Slot::hasFocus() + */ + void Slot::loadIcon() + { ++ png_bytep *rowPointers; ++ + destroyIcon(); + width = height = 0; - #include "Slot.hh" -+#include "pngpriv.h" +@@ -446,27 +448,29 @@ void Slot::loadIcon() + PNG_TRANSFORM_BGR, + 0 ); - extern char **environ; +- if( !(info->valid & PNG_INFO_IDAT) || +- !(normalicon = new int[info->width*info->height]) ) ++ width = png_get_image_width( png, info ); ++ height = png_get_image_height( png, info ); ++ ++ if( !png_get_valid( png, info, PNG_INFO_IDAT ) || ++ !(normalicon = new int[width*height]) ) + throw 0; +- for( int y = 0, *src, *dest = normalicon; +- y < info->height && (src = (int *) info->row_pointers[y]); +- y++, dest += info->width ) +- memcpy( dest, src, info->width<<2 ); ++ rowPointers = png_get_rows( png, info ); + +- width = info->width; +- height = info->height; ++ for( int y = 0, *src, *dest = normalicon; ++ y < height && (src = (int *) rowPointers[y]); ++ y++, dest += width ) ++ memcpy( dest, src, width<<2 ); + + // convert grayscale image to rgb +- if( info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA ) +- for( int y = info->height, *line = normalicon; +- --y; line += info->width ) ++ if( png_get_color_type(png, info) == PNG_COLOR_TYPE_GRAY_ALPHA ) ++ for( int y = height, *line = normalicon; ++ --y; line += width ) + { +- unsigned char *dest = (unsigned char *) line+(info->width<<2); +- unsigned char *src = (unsigned char *) line+(info->width<<1); ++ unsigned char *dest = (unsigned char *) line+(width<<2); ++ unsigned char *src = (unsigned char *) line+(width<<1); + +- for( int x = info->width; --x; ) ++ for( int x = width; --x; ) + { + *(--dest) = *(--src); + *(--dest) = *(--src); |