From c8fa53846fb0253c048927624dc85b32c56cb01d Mon Sep 17 00:00:00 2001 From: Neophytos Date: Thu, 6 Dec 2012 11:46:34 +0000 Subject: [PATCH] zsnes rebuild against libpng15 --- zsnes/PKGBUILD | 41 +++++++++++++++++++++-------------------- zsnes/gcc47-fix.patch | 10 ++++++++++ zsnes/libpng15.patch | 12 ++++++++++++ 3 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 zsnes/gcc47-fix.patch create mode 100644 zsnes/libpng15.patch diff --git a/zsnes/PKGBUILD b/zsnes/PKGBUILD index e42dff0..d22a39b 100644 --- a/zsnes/PKGBUILD +++ b/zsnes/PKGBUILD @@ -1,50 +1,51 @@ # Lib32 Packages for Chakra, part of chakra-project.org -# # maintainer (x86_64): Giuseppe CalĂ  # maintainer (x86_64): Anke Boersma +# Contributions from Arch: https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/zsnes pkgname=zsnes pkgver=1.51 -pkgrel=2 +pkgrel=4 pkgdesc="Super Nintendo emulator" url="http://www.zsnes.com/" arch=('i686' 'x86_64') license=('GPL') - -if [ $CARCH == "x86_64" ]; then - depends=('gcc-libs-multilib' 'lib32-sdl' 'lib32-libpng>=1.4.0' 'lib32-libgl' 'lib32-ncurses' 'lib32-mesa') - makedepends=('nasm' 'gcc-multilib') -else - depends=('gcc-libs' 'sdl' 'libpng>=1.4.0' 'libgl' 'ncurses' 'mesa') - makedepends=('nasm' 'gcc') -fi - +depends=('gcc-libs-multilib' 'lib32-sdl' 'lib32-libpng' 'lib32-libgl' 'lib32-ncurses' 'lib32-mesa') +makedepends=('nasm' 'gcc-multilib') source=(http://downloads.sourceforge.net/${pkgname}/zsnes151src.tar.bz2 zsnes.patch zsnes.desktop - zsnes_icon.png) + zsnes_icon.png + gcc47-fix.patch + libpng15.patch) md5sums=('7071186bf80632ae88a153239498d8c9' '3af40c7d674ebfce1bb1ab6b7e9a8fe4' 'b100b2aa342c551167d7c5dcdcde9dd4' - 'b5260c02adfc3b7ff725041214b00bfd') + 'b5260c02adfc3b7ff725041214b00bfd' + '951a54e05e4436fe1114308e4466ad74' + 'd9a9956bf8b709eaccb0f68132b8693a') build() { cd ${srcdir}/${pkgname}_1_51/ - patch -p1 -i ../zsnes.patch || return 1 - + patch -p1 -i ../zsnes.patch + patch -p1 -i ../gcc47-fix.patch + patch -p0 -i ../libpng15.patch + cd ${srcdir}/${pkgname}_1_51/src -if [ $CARCH == "x86_64" ]; then export CC="gcc -m32" export CXX="g++ -m32" -fi ./autogen.sh --prefix=/usr \ x_libraries=/usr/lib \ force_arch=i686 \ --enable-release - - make || return 1 + + make +} + +package() { + cd ${srcdir}/${pkgname}_1_51/src make DESTDIR=${pkgdir} install - + # adding --mandir= to autoconf line fails install -dm755 ${pkgdir}/usr/share diff --git a/zsnes/gcc47-fix.patch b/zsnes/gcc47-fix.patch new file mode 100644 index 0000000..a02e5b0 --- /dev/null +++ b/zsnes/gcc47-fix.patch @@ -0,0 +1,10 @@ + --- /src/tools/depbuild.cpp 2012-05-27 23:33:13.681858365 +0300 ++++ /src/tools/depbuild.cpp 2012-05-27 23:36:37.105674828 +0300 +@@ -28,6 +28,7 @@ + + #include "fileutil.h" + #include "strutil.h" ++#include "unistd.h" + + string cc; + string nasm; diff --git a/zsnes/libpng15.patch b/zsnes/libpng15.patch new file mode 100644 index 0000000..3a8e703 --- /dev/null +++ b/zsnes/libpng15.patch @@ -0,0 +1,12 @@ +Use existing png_set_IHDR() and stop accessing PNG structure members directly + +--- src/zip/zpng.c ++++ src/zip/zpng.c +@@ -129,7 +129,6 @@ + png_set_IHDR(png_ptr, info_ptr, width, height, 8, + PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); +- info_ptr->color_type = PNG_COLOR_TYPE_RGB; + + //Allocate an array of scanline pointers + row_pointers = (png_bytep*)malloc(height*sizeof(png_bytep)); \ No newline at end of file