From 3f57a7f93b3e7550cbd73036f6a56654e17d1d5c Mon Sep 17 00:00:00 2001 From: tnut Date: Sun, 8 Jan 2012 12:15:45 +0100 Subject: split de git pakxe et NuTyX-extra --- sdl_image/.footprint.i686 | 12 +++ sdl_image/.footprint.x86_64 | 12 +++ sdl_image/.md5sum.i686 | 2 + sdl_image/.md5sum.x86_64 | 2 + sdl_image/Pkgfile | 21 ++++ sdl_image/sdl-image-1.2.10-libpng15.patch | 160 ++++++++++++++++++++++++++++++ 6 files changed, 209 insertions(+) create mode 100644 sdl_image/.footprint.i686 create mode 100644 sdl_image/.footprint.x86_64 create mode 100644 sdl_image/.md5sum.i686 create mode 100644 sdl_image/.md5sum.x86_64 create mode 100644 sdl_image/Pkgfile create mode 100644 sdl_image/sdl-image-1.2.10-libpng15.patch (limited to 'sdl_image') diff --git a/sdl_image/.footprint.i686 b/sdl_image/.footprint.i686 new file mode 100644 index 000000000..c11c1bfe0 --- /dev/null +++ b/sdl_image/.footprint.i686 @@ -0,0 +1,12 @@ +drwxr-xr-x root/root usr/ +drwxr-xr-x root/root usr/include/ +drwxr-xr-x root/root usr/include/SDL/ +-rw-r--r-- root/root usr/include/SDL/SDL_image.h +drwxr-xr-x root/root usr/lib/ +lrwxrwxrwx root/root usr/lib/libSDL_image-1.2.so.0 -> libSDL_image-1.2.so.0.8.2 +-rwxr-xr-x root/root usr/lib/libSDL_image-1.2.so.0.8.2 +-rw-r--r-- root/root usr/lib/libSDL_image.a +-rwxr-xr-x root/root usr/lib/libSDL_image.la +lrwxrwxrwx root/root usr/lib/libSDL_image.so -> libSDL_image-1.2.so.0.8.2 +drwxr-xr-x root/root usr/lib/pkgconfig/ +-rw-r--r-- root/root usr/lib/pkgconfig/SDL_image.pc diff --git a/sdl_image/.footprint.x86_64 b/sdl_image/.footprint.x86_64 new file mode 100644 index 000000000..c11c1bfe0 --- /dev/null +++ b/sdl_image/.footprint.x86_64 @@ -0,0 +1,12 @@ +drwxr-xr-x root/root usr/ +drwxr-xr-x root/root usr/include/ +drwxr-xr-x root/root usr/include/SDL/ +-rw-r--r-- root/root usr/include/SDL/SDL_image.h +drwxr-xr-x root/root usr/lib/ +lrwxrwxrwx root/root usr/lib/libSDL_image-1.2.so.0 -> libSDL_image-1.2.so.0.8.2 +-rwxr-xr-x root/root usr/lib/libSDL_image-1.2.so.0.8.2 +-rw-r--r-- root/root usr/lib/libSDL_image.a +-rwxr-xr-x root/root usr/lib/libSDL_image.la +lrwxrwxrwx root/root usr/lib/libSDL_image.so -> libSDL_image-1.2.so.0.8.2 +drwxr-xr-x root/root usr/lib/pkgconfig/ +-rw-r--r-- root/root usr/lib/pkgconfig/SDL_image.pc diff --git a/sdl_image/.md5sum.i686 b/sdl_image/.md5sum.i686 new file mode 100644 index 000000000..06d6a22e9 --- /dev/null +++ b/sdl_image/.md5sum.i686 @@ -0,0 +1,2 @@ +6c06584b31559e2b59f2b982d0d1f628 SDL_image-1.2.10.tar.gz +ec3645af2a8e0b07fa0b7b9bde39256e sdl-image-1.2.10-libpng15.patch diff --git a/sdl_image/.md5sum.x86_64 b/sdl_image/.md5sum.x86_64 new file mode 100644 index 000000000..06d6a22e9 --- /dev/null +++ b/sdl_image/.md5sum.x86_64 @@ -0,0 +1,2 @@ +6c06584b31559e2b59f2b982d0d1f628 SDL_image-1.2.10.tar.gz +ec3645af2a8e0b07fa0b7b9bde39256e sdl-image-1.2.10-libpng15.patch diff --git a/sdl_image/Pkgfile b/sdl_image/Pkgfile new file mode 100644 index 000000000..bf0b60031 --- /dev/null +++ b/sdl_image/Pkgfile @@ -0,0 +1,21 @@ +# Description: Librairie pour charger des images. +# URL: http://www.libsdl.org/projects/SDL_image +# Maintainer: Danny Rawlins, monster dot romster at gmail dot com +# Packager: thierryn1 at hispeed dot ch +# Depends on: libtiff, libpng, sdl +# Run on: libtiff,libpng,sdl + +name=sdl_image +version=1.2.10 +release=4 +source=(http://www.libsdl.org/projects/SDL_image/release/SDL_image-$version.tar.gz sdl-image-1.2.10-libpng15.patch) + +build() { + cd SDL_image-$version + patch -p0 < ../sdl-image-1.2.10-libpng15.patch + ./configure --prefix=/usr + make + make DESTDIR=$PKG install +} + + diff --git a/sdl_image/sdl-image-1.2.10-libpng15.patch b/sdl_image/sdl-image-1.2.10-libpng15.patch new file mode 100644 index 000000000..78b0a92ea --- /dev/null +++ b/sdl_image/sdl-image-1.2.10-libpng15.patch @@ -0,0 +1,160 @@ +--- IMG_png.c ++++ IMG_png.c +@@ -71,6 +71,10 @@ + #endif + #include + ++/* Check for the older version of libpng */ ++#if (PNG_LIBPNG_VER_MAJOR == 1) && (PNG_LIBPNG_VER_MINOR < 4) ++#define LIBPNG_VERSION_12 ++#endif + + static struct { + int loaded; +@@ -80,6 +84,8 @@ + 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 +97,9 @@ + 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); ++#ifndef LIBPNG_VERSION_12 ++ jmp_buf* (*png_set_longjmp_fn) (png_structp, png_longjmp_ptr, size_t); ++#endif + } lib; + + #ifdef LOAD_PNG_DYNAMIC +@@ -129,6 +138,13 @@ + 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 +152,13 @@ + 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 +236,15 @@ + SDL_UnloadObject(lib.handle); + return -1; + } ++#ifndef LIBPNG_VERSION_12 ++ 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; ++ } ++#endif + } + ++lib.loaded; + +@@ -236,7 +268,9 @@ + 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 +282,9 @@ + 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; ++#ifndef LIBPNG_VERSION_12 ++ lib.png_set_longjmp_fn = png_set_longjmp_fn; ++#endif + } + ++lib.loaded; + +@@ -347,7 +384,12 @@ + * 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) ) { ++#ifndef LIBPNG_VERSION_12 ++ if ( setjmp(*lib.png_set_longjmp_fn(png_ptr, longjmp, sizeof (jmp_buf))) ) ++#else ++ if ( setjmp(png_ptr->jmpbuf) ) ++#endif ++ { + error = "Error reading the PNG file."; + goto done; + } +@@ -416,9 +458,9 @@ + 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 +468,7 @@ + } + } + 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 +509,9 @@ + /* 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 +519,12 @@ + 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; inum_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; icolors[i].b = png_palette[i].blue; ++ palette->colors[i].g = png_palette[i].green; ++ palette->colors[i].r = png_palette[i].red; + } + } + } -- cgit v1.2.3-54-g00ecf