aboutsummaryrefslogtreecommitdiffstats
path: root/community/zsnes
diff options
context:
space:
mode:
authorBartłomiej Piotrowski <b@bpiotrowski.pl>2015-11-09 11:59:39 +0100
committerBartłomiej Piotrowski <b@bpiotrowski.pl>2015-11-09 11:59:39 +0100
commitf27f694e518010617995ede72357067f1f9a6525 (patch)
treeddefed5a23d78e5118ff2cefb01c73f4e5e035ce /community/zsnes
parente217298a190403f629f1f07454197d6bcc38155b (diff)
main/zsnes: move to community
Diffstat (limited to 'community/zsnes')
-rw-r--r--community/zsnes/APKBUILD66
-rw-r--r--community/zsnes/zsnes-1.51-CC-quotes.patch20
-rw-r--r--community/zsnes/zsnes-1.51-depbuild.patch34
-rw-r--r--community/zsnes/zsnes-libpng15.patch10
-rw-r--r--community/zsnes/zsnes.desktop9
-rw-r--r--community/zsnes/zsnes.patch67
-rw-r--r--community/zsnes/zsnes_icon.pngbin0 -> 7301 bytes
7 files changed, 206 insertions, 0 deletions
diff --git a/community/zsnes/APKBUILD b/community/zsnes/APKBUILD
new file mode 100644
index 00000000000..b2884e0258d
--- /dev/null
+++ b/community/zsnes/APKBUILD
@@ -0,0 +1,66 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=zsnes
+pkgver=1.51
+pkgrel=9
+pkgdesc="Super Nintendo emulator"
+url="http://www.zsnes.com/"
+arch="x86"
+license="GPL2"
+makedepends="sdl-dev libpng-dev ncurses-dev mesa-dev automake autoconf nasm"
+subpackages="$pkgname-doc"
+source="http://downloads.sourceforge.net/sourceforge/$pkgname/${pkgname}151src.tar.bz2
+ $pkgname.desktop
+ zsnes.patch
+ zsnes-1.51-CC-quotes.patch
+ zsnes-1.51-depbuild.patch
+ zsnes-libpng15.patch
+ zsnes_icon.png"
+
+_builddir="$srcdir/${pkgname}_${pkgver%.*}_${pkgver#*.}"
+
+prepare() {
+ cd "$_builddir"
+ update_config_sub || return 1
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+
+ cd "$_builddir"/src
+ aclocal && autoconf || return 1
+}
+
+build() {
+ cd "$_builddir"/src
+ export GCC_SPECS=hardenednopie.specs
+ LDFLAGS="$LDFLAGS -fno-PIE"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ x_libraries=/usr/lib \
+ force_arch=i486 \
+ --enable-release \
+ || return 1
+ make makefile.dep
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"/src
+ make DESTDIR="$pkgdir" install
+ install -Dm644 "$srcdir"/zsnes.desktop \
+ "$pkgdir"/usr/share/applications/zsnes.desktop
+ install -Dm644 "$srcdir"/zsnes_icon.png \
+ "$pkgdir"/usr/share/pixmaps/zsnes_icon.png
+ mv "$pkgdir"/usr/man "$pkgdir"/usr/share
+}
+md5sums="7071186bf80632ae88a153239498d8c9 zsnes151src.tar.bz2
+b100b2aa342c551167d7c5dcdcde9dd4 zsnes.desktop
+4df831b3d87a35949bcf3fd5547decb1 zsnes.patch
+69ca17611c0d4a21529a95eb37e05c2f zsnes-1.51-CC-quotes.patch
+994af091cbb8f17f82d78c0ca89ac549 zsnes-1.51-depbuild.patch
+c9962edc521df8876b714d061458b600 zsnes-libpng15.patch
+b5260c02adfc3b7ff725041214b00bfd zsnes_icon.png"
diff --git a/community/zsnes/zsnes-1.51-CC-quotes.patch b/community/zsnes/zsnes-1.51-CC-quotes.patch
new file mode 100644
index 00000000000..a871b62604a
--- /dev/null
+++ b/community/zsnes/zsnes-1.51-CC-quotes.patch
@@ -0,0 +1,20 @@
+--- a/src/Makefile.in.orig 2009-02-25 18:13:40.000000000 +0100
++++ b/src/Makefile.in 2009-02-25 18:13:16.000000000 +0100
+@@ -95,7 +95,7 @@
+ %.o: %.cpp
+ @CXX@ @CXXFLAGS@ -o $@ -c $<
+ %.o %.h: %.psr $(PSR)
+- ./$(PSR) @PSRFLAGS@ -gcc @CC@ -compile -flags "@CFLAGS@ -O1" -cheader $*.h -fname $* $*.o $<
++ ./$(PSR) @PSRFLAGS@ -gcc "@CC@" -compile -flags "@CFLAGS@ -O1" -cheader $*.h -fname $* $*.o $<
+
+ default: main
+ all: main tools--- zsnes_1_51/src/Makefile.in.orig 2009-02-25 18:02:07.000000000 +0100
+@@ -133,7 +133,7 @@
+
+ include makefile.dep
+ makefile.dep: $(TOOL_D)/depbuild Makefile
+- $(TOOL_D)/depbuild @CC@ "@CFLAGS@" @NASMPATH@ "@NFLAGS@" $(Z_OBJS) > makefile.dep
++ $(TOOL_D)/depbuild "@CC@" "@CFLAGS@" @NASMPATH@ "@NFLAGS@" $(Z_OBJS) > makefile.dep
+
+ Makefile: Makefile.in config.status
+ ./config.status
diff --git a/community/zsnes/zsnes-1.51-depbuild.patch b/community/zsnes/zsnes-1.51-depbuild.patch
new file mode 100644
index 00000000000..e2cc0d86f64
--- /dev/null
+++ b/community/zsnes/zsnes-1.51-depbuild.patch
@@ -0,0 +1,34 @@
+--- a/src/tools/depbuild.cpp Fri Nov 13 18:41:24 2009
++++ b/src/tools/depbuild.cpp Fri Nov 13 19:04:09 2009
+@@ -24,6 +24,9 @@
+ #include <iostream>
+ #include <string>
+ #include <cstdio>
++#include <cstdlib>
++#include <unistd.h>
++
+ using namespace std;
+
+ #include "fileutil.h"
+@@ -130,7 +133,20 @@
+ void dependency_calculate_asm(const char *filename)
+ {
+ string command = nasm + " " + nflags + " -M " + filename;
+- system(command.c_str());
++ FILE *fp = popen(command.c_str(), "r");
++ if (fp)
++ {
++ char line[256];
++ while (fgets(line, sizeof(line), fp)) //Process all lines of output
++ {
++ cout << line;
++ }
++ pclose(fp);
++ }
++ else
++ {
++ cerr << "Failed on: " << filename << "\n";
++ }
+ }
+
+ void dependency_calculate_psr(const char *filename)
diff --git a/community/zsnes/zsnes-libpng15.patch b/community/zsnes/zsnes-libpng15.patch
new file mode 100644
index 00000000000..8f831716688
--- /dev/null
+++ b/community/zsnes/zsnes-libpng15.patch
@@ -0,0 +1,10 @@
+--- ./src/zip/zpng.c.orig
++++ ./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));
diff --git a/community/zsnes/zsnes.desktop b/community/zsnes/zsnes.desktop
new file mode 100644
index 00000000000..db13ada4c6f
--- /dev/null
+++ b/community/zsnes/zsnes.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Zsnes
+Comment=Super Nintendo emulator
+Exec=/usr/bin/zsnes
+Icon=/usr/share/pixmaps/zsnes_icon.png
+Terminal=false
+Type=Application
+Categories=Application;Game
+StartupNotify=false
diff --git a/community/zsnes/zsnes.patch b/community/zsnes/zsnes.patch
new file mode 100644
index 00000000000..db074038451
--- /dev/null
+++ b/community/zsnes/zsnes.patch
@@ -0,0 +1,67 @@
+diff -cr zsnes_1_51/src/parsegen.cpp zsnes_1_51-patched/src/parsegen.cpp
+*** zsnes_1_51/src/parsegen.cpp 2007-10-31 01:30:26.000000000 -0300
+--- zsnes_1_51-patched/src/parsegen.cpp 2008-07-13 18:28:53.000000000 -0300
+***************
+*** 19,24 ****
+--- 19,27 ----
+ Config file handler creator by Nach (C) 2005-2007
+ */
+
++ #include <cstring>
++ #include <cstdlib>
++
+ #if !defined(__GNUC__) && !defined(_MSC_VER)
+ #error You are using an unsupported compiler
+ #endif
+***************
+*** 1822,1828 ****
+ }
+ }
+
+! int main(size_t argc, const char *const *const argv)
+ {
+ const char *cheader_file = 0;
+ bool compile = false;
+--- 1825,1831 ----
+ }
+ }
+
+! int main(int argc, const char *const *const argv)
+ {
+ const char *cheader_file = 0;
+ bool compile = false;
+diff -cr zsnes_1_51/src/tools/depbuild.cpp zsnes_1_51-patched/src/tools/depbuild.cpp
+*** zsnes_1_51/src/tools/depbuild.cpp 2006-12-27 08:04:05.000000000 -0300
+--- zsnes_1_51-patched/src/tools/depbuild.cpp 2008-07-13 18:30:46.000000000 -0300
+***************
+*** 183,189 ****
+ }
+ }
+
+! int main(size_t argc, const char *const *const argv)
+ {
+ if (argc < 5)
+ {
+--- 183,189 ----
+ }
+ }
+
+! int main(int argc, const char *const *const argv)
+ {
+ if (argc < 5)
+ {
+diff -cr zsnes_1_51/src/tools/strutil.h zsnes_1_51-patched/src/tools/strutil.h
+*** zsnes_1_51/src/tools/strutil.h 2006-12-27 08:04:05.000000000 -0300
+--- zsnes_1_51-patched/src/tools/strutil.h 2008-07-13 18:30:27.000000000 -0300
+***************
+*** 15,20 ****
+--- 15,23 ----
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
++ #include <cstring>
++ #include <cstdlib>
++
+ /*
+ This is part of a toolkit used to assist in ZSNES development
+ */
diff --git a/community/zsnes/zsnes_icon.png b/community/zsnes/zsnes_icon.png
new file mode 100644
index 00000000000..31608ba0685
--- /dev/null
+++ b/community/zsnes/zsnes_icon.png
Binary files differ