Update to sdl-image-1.2.12.

from Brad
This commit is contained in:
ajacoutot 2012-04-05 11:40:46 +00:00
parent b697253b59
commit 8a0c9e0366
5 changed files with 25 additions and 167 deletions

View File

@ -1,29 +1,28 @@
# $OpenBSD: Makefile,v 1.32 2010/11/15 19:46:09 espie Exp $
# $OpenBSD: Makefile,v 1.33 2012/04/05 11:40:46 ajacoutot Exp $
COMMENT= SDL image library
DISTNAME= SDL_image-1.2.10
DISTNAME= SDL_image-1.2.12
PKGNAME= ${DISTNAME:L:S/_/-/}
REVISION= 0
CATEGORIES= devel graphics
MASTER_SITES= ftp://ftp.fr.freebsd.org/pub/FreeBSD/distfiles/ \
http://www.libsdl.org/projects/SDL_image/release/
MASTER_SITES= ${HOMEPAGE}release/
SHARED_LIBS= SDL_image 3.0
SHARED_LIBS= SDL_image 3.1
HOMEPAGE= http://www.libsdl.org/projects/SDL_image/
# LGPLv2.1+
# Zlib
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= SDL jpeg m png tiff sndio usbhid z
WANTLIB= SDL jpeg m png sndio tiff usbhid webp z
MODULES= converters/libiconv
LIB_DEPENDS= devel/sdl \
graphics/jpeg \
graphics/libwebp \
graphics/png \
graphics/tiff
@ -32,8 +31,9 @@ CONFIGURE_STYLE=gnu
CONFIGURE_ARGS+=${CONFIGURE_SHARED} \
--disable-jpg-shared \
--disable-png-shared \
--disable-tif-shared
CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include/libpng -I${LOCALBASE}/include" \
--disable-tif-shared \
--disable-webp-shared
CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (SDL_image-1.2.10.tar.gz) = bAZYSzFVnitZ8rmC0NH2KA==
RMD160 (SDL_image-1.2.10.tar.gz) = gTP3+NSIscP2mtgKlBKJtFCNKQE=
SHA1 (SDL_image-1.2.10.tar.gz) = a65x/f15XD2/OfbHwM+LISkU75c=
SHA256 (SDL_image-1.2.10.tar.gz) = deBdHpX2J3tEeXFX2eJakIuo0Io5Mhb/sBmw103hGHY=
SIZE (SDL_image-1.2.10.tar.gz) = 1332906
MD5 (SDL_image-1.2.12.tar.gz) = oPkJjr5UAPC9ybYuYHl+yw==
RMD160 (SDL_image-1.2.12.tar.gz) = IGmQlZxrIlKGwKGbwFuZHGvCw+g=
SHA1 (SDL_image-1.2.12.tar.gz) = Xj45PU42ZjgEi7sQ1qJp6j9OTPI=
SHA256 (SDL_image-1.2.12.tar.gz) = C5ByKYRWEATehIR3RNVmgJ27na9zKp5QO5GhtahOVpk=
SIZE (SDL_image-1.2.12.tar.gz) = 2231074

View File

@ -1,142 +0,0 @@
$OpenBSD: patch-IMG_png_c,v 1.1 2011/07/08 20:36:09 naddy Exp $
Fix build with png-1.5.
--- IMG_png.c.orig Sun Nov 8 03:55:32 2009
+++ IMG_png.c Mon Jul 4 15:36:36 2011
@@ -80,6 +80,8 @@ static struct {
void (*png_destroy_read_struct) (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr);
png_uint_32 (*png_get_IHDR) (png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method);
png_voidp (*png_get_io_ptr) (png_structp png_ptr);
+ png_byte (*png_get_channels) (png_structp png_ptr, png_infop info_ptr);
+ png_uint_32 (*png_get_PLTE) (png_structp png_ptr, png_infop info_ptr, png_colorp *palette, int *num_palette);
png_uint_32 (*png_get_tRNS) (png_structp png_ptr, png_infop info_ptr, png_bytep *trans, int *num_trans, png_color_16p *trans_values);
png_uint_32 (*png_get_valid) (png_structp png_ptr, png_infop info_ptr, png_uint_32 flag);
void (*png_read_image) (png_structp png_ptr, png_bytepp image);
@@ -91,6 +93,7 @@ static struct {
void (*png_set_read_fn) (png_structp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn);
void (*png_set_strip_16) (png_structp png_ptr);
int (*png_sig_cmp) (png_bytep sig, png_size_t start, png_size_t num_to_check);
+ jmp_buf* (*png_set_longjmp_fn) (png_structp, png_longjmp_ptr, size_t);
} lib;
#ifdef LOAD_PNG_DYNAMIC
@@ -129,6 +132,13 @@ int IMG_InitPNG()
SDL_UnloadObject(lib.handle);
return -1;
}
+ lib.png_get_channels =
+ (png_byte (*) (png_structp, png_infop))
+ SDL_LoadFunction(lib.handle, "png_get_channels");
+ if ( lib.png_get_channels == NULL ) {
+ SDL_UnloadObject(lib.handle);
+ return -1;
+ }
lib.png_get_io_ptr =
(png_voidp (*) (png_structp))
SDL_LoadFunction(lib.handle, "png_get_io_ptr");
@@ -136,6 +146,13 @@ int IMG_InitPNG()
SDL_UnloadObject(lib.handle);
return -1;
}
+ lib.png_get_PLTE =
+ (png_uint_32 (*) (png_structp, png_infop, png_colorp *, int *))
+ SDL_LoadFunction(lib.handle, "png_get_PLTE");
+ if ( lib.png_get_PLTE == NULL ) {
+ SDL_UnloadObject(lib.handle);
+ return -1;
+ }
lib.png_get_tRNS =
(png_uint_32 (*) (png_structp, png_infop, png_bytep *, int *, png_color_16p *))
SDL_LoadFunction(lib.handle, "png_get_tRNS");
@@ -213,6 +230,13 @@ int IMG_InitPNG()
SDL_UnloadObject(lib.handle);
return -1;
}
+ lib.png_set_longjmp_fn =
+ (jmp_buf * (*) (png_structp, png_longjmp_ptr, size_t))
+ SDL_LoadFunction(lib.handle, "png_set_longjmp_fn");
+ if ( lib.png_set_longjmp_fn == NULL ) {
+ SDL_UnloadObject(lib.handle);
+ return -1;
+ }
}
++lib.loaded;
@@ -236,7 +260,9 @@ int IMG_InitPNG()
lib.png_create_read_struct = png_create_read_struct;
lib.png_destroy_read_struct = png_destroy_read_struct;
lib.png_get_IHDR = png_get_IHDR;
+ lib.png_get_channels = png_get_channels;
lib.png_get_io_ptr = png_get_io_ptr;
+ lib.png_get_PLTE = png_get_PLTE;
lib.png_get_tRNS = png_get_tRNS;
lib.png_get_valid = png_get_valid;
lib.png_read_image = png_read_image;
@@ -248,6 +274,7 @@ int IMG_InitPNG()
lib.png_set_read_fn = png_set_read_fn;
lib.png_set_strip_16 = png_set_strip_16;
lib.png_sig_cmp = png_sig_cmp;
+ lib.png_set_longjmp_fn = png_set_longjmp_fn;
}
++lib.loaded;
@@ -347,7 +374,7 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
* the normal method of doing things with libpng). REQUIRED unless you
* set up your own error handlers in png_create_read_struct() earlier.
*/
- if ( setjmp(png_ptr->jmpbuf) ) {
+ if ( setjmp(*lib.png_set_longjmp_fn(png_ptr, longjmp, sizeof (jmp_buf)))) {
error = "Error reading the PNG file.";
goto done;
}
@@ -416,9 +443,9 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
Rmask = 0x000000FF;
Gmask = 0x0000FF00;
Bmask = 0x00FF0000;
- Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0;
+ Amask = (lib.png_get_channels(png_ptr, info_ptr) == 4) ? 0xFF000000 : 0;
} else {
- int s = (info_ptr->channels == 4) ? 0 : 8;
+ int s = (lib.png_get_channels(png_ptr, info_ptr) == 4) ? 0 : 8;
Rmask = 0xFF000000 >> s;
Gmask = 0x00FF0000 >> s;
Bmask = 0x0000FF00 >> s;
@@ -426,7 +453,7 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
}
}
surface = SDL_AllocSurface(SDL_SWSURFACE, width, height,
- bit_depth*info_ptr->channels, Rmask,Gmask,Bmask,Amask);
+ bit_depth*lib.png_get_channels(png_ptr, info_ptr), Rmask,Gmask,Bmask,Amask);
if ( surface == NULL ) {
error = "Out of memory";
goto done;
@@ -467,6 +494,9 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
/* Load the palette, if any */
palette = surface->format->palette;
if ( palette ) {
+ int png_num_palette;
+ png_colorp png_palette;
+ lib.png_get_PLTE(png_ptr, info_ptr, &png_palette, &png_num_palette);
if(color_type == PNG_COLOR_TYPE_GRAY) {
palette->ncolors = 256;
for(i = 0; i < 256; i++) {
@@ -474,12 +504,12 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
palette->colors[i].g = i;
palette->colors[i].b = i;
}
- } else if (info_ptr->num_palette > 0 ) {
- palette->ncolors = info_ptr->num_palette;
- for( i=0; i<info_ptr->num_palette; ++i ) {
- palette->colors[i].b = info_ptr->palette[i].blue;
- palette->colors[i].g = info_ptr->palette[i].green;
- palette->colors[i].r = info_ptr->palette[i].red;
+ } else if (png_num_palette > 0 ) {
+ palette->ncolors = png_num_palette;
+ for( i=0; i<png_num_palette; ++i ) {
+ palette->colors[i].b = png_palette[i].blue;
+ palette->colors[i].g = png_palette[i].green;
+ palette->colors[i].r = png_palette[i].red;
}
}
}

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-Makefile_in,v 1.6 2010/07/09 09:20:53 sthen Exp $
--- Makefile.in.orig Thu Nov 12 01:42:10 2009
+++ Makefile.in Sun Jun 20 19:05:55 2010
@@ -297,12 +297,10 @@ EXTRA_DIST = \
$OpenBSD: patch-Makefile_in,v 1.7 2012/04/05 11:40:46 ajacoutot Exp $
--- Makefile.in.orig Fri Jan 20 20:51:33 2012
+++ Makefile.in Sat Mar 17 12:45:49 2012
@@ -303,12 +303,10 @@ EXTRA_DIST = \
@USE_VERSION_RC_FALSE@libSDL_image_la_LDFLAGS = \
@USE_VERSION_RC_FALSE@ -no-undefined \

View File

@ -1,8 +1,8 @@
$OpenBSD: patch-configure,v 1.2 2010/07/09 09:20:53 sthen Exp $
--- configure.orig Thu Nov 12 01:42:10 2009
+++ configure Sun Jun 20 19:08:23 2010
@@ -14004,7 +14004,7 @@ if test "${ac_cv_lib_tiff_TIFFClientOpen+set}" = set;
$as_echo_n "(cached) " >&6
$OpenBSD: patch-configure,v 1.3 2012/04/05 11:40:46 ajacoutot Exp $
--- configure.orig Fri Jan 20 20:51:33 2012
+++ configure Sat Mar 17 12:45:49 2012
@@ -14313,7 +14313,7 @@ if test "${ac_cv_lib_tiff_TIFFClientOpen+set}" = set;
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltiff -lz $LIBS"
@ -10,7 +10,7 @@ $OpenBSD: patch-configure,v 1.2 2010/07/09 09:20:53 sthen Exp $
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -14170,7 +14170,7 @@ _ACEOF
@@ -14986,7 +14986,7 @@ _ACEOF
# Disable dynamic jpeg since we're linking it explicitly
jpg_lib=''
fi