zsnes: patches for modern gcc & libpng

builds fine on stdenv-updates now
needs gcc 4.8+, so keep this commit on stdenv-updates until merge
This commit is contained in:
Mathijs Kwik
2013-10-11 01:10:41 +02:00
parent 1772bcebc1
commit ef3cc83d1e
4 changed files with 106 additions and 22 deletions
+13 -19
View File
@@ -2,33 +2,27 @@
stdenv.mkDerivation {
name = "zsnes-1.51";
src = fetchurl {
url = mirror://sourceforge/zsnes/zsnes151src.tar.bz2;
sha256 = "08s64qsxziv538vmfv38fg1rfrz5k95dss5zdkbfxsbjlbdxwmi8";
};
buildInputs = [ nasm SDL zlib libpng ncurses mesa ];
# copied from arch linux, fixes gcc-4.8 compatibility
patches = [ ./zsnes.patch ];
postPatch = ''
patch -p0 < ${./zsnes-1.51-libpng15.patch}
'';
preConfigure = ''
cd src
# Fix for undefined strncasecmp()
echo '#include <strings.h>' > tmp.cpp
cat tmp.cpp tools/strutil.h > tools/strutil.h.new
mv tools/strutil.h.new tools/strutil.h
# Fix for undefined system()
echo '#include <stdlib.h>' > tmp.cpp
cat tmp.cpp tools/depbuild.cpp > tools/depbuild.cpp.new
mv tools/depbuild.cpp.new tools/depbuild.cpp
# Fix for lots of undefined strcmp, strncmp etc.
echo '#include <string.h>' > tmp.cpp
cat tmp.cpp parsegen.cpp > parsegen.cpp.new
mv parsegen.cpp.new parsegen.cpp
'';
buildInputs = [ nasm SDL zlib libpng ncurses mesa ];
configureFlags = "--enable-release";
meta = {
description = "A Super Nintendo Entertainment System Emulator";
license = "GPLv2+";