development/SDL2_image: Added PNG Support.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Dugan Chen 2014-01-14 23:07:54 +07:00 committed by Erik Hanson
parent f7b3f20275
commit ad722f51d0
2 changed files with 23 additions and 7 deletions

View file

@ -24,7 +24,7 @@
PRGNAM=SDL2_image
VERSION=${VERSION:-2.0.0}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -64,10 +64,13 @@ tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# To allow for compiling with png support.
patch -p1 --verbose < $CWD/pngfix.patch
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
@ -78,8 +81,7 @@ CXXFLAGS="$SLKCFLAGS" \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--build=$ARCH-slackware-linux \
--disable-png # Building with PNG support on Slackware 14 doesn't work.
--build=$ARCH-slackware-linux
make
make install DESTDIR=$PKG

View file

@ -0,0 +1,14 @@
diff -rupN SDL2_image-2.0.0.orig/IMG_png.c SDL2_image-2.0.0/IMG_png.c
--- SDL2_image-2.0.0.orig/IMG_png.c 2013-08-10 10:38:36.000000000 -0700
+++ SDL2_image-2.0.0/IMG_png.c 2014-01-13 09:33:32.569432897 -0800
@@ -68,8 +68,8 @@
#include <png.h>
/* Check for the older version of libpng */
-#if (PNG_LIBPNG_VER_MAJOR == 1)
-#if (PNG_LIBPNG_VER_MINOR < 4)
+#if (PNG_LIBPNG_VER_MAJOR == 1)
+#if (PNG_LIBPNG_VER_MINOR < 5)
#define LIBPNG_VERSION_12
typedef png_bytep png_const_bytep;
#endif