# ChangeLog for games-emulation/zsnes
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-emulation/zsnes/ChangeLog,v 1.10 2004/09/23 21:23:41 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-emulation/zsnes/ChangeLog,v 1.11 2004/11/20 12:24:34 mr_bones_ Exp $
+
+*zsnes-1.37_pre20041024 (20 Nov 2004)
+
+ 20 Nov 2004; Michael Sterrett <mr_bones_@gentoo.org>
+ +files/command-line.patch, +zsnes-1.37_pre20041024.ebuild:
+ version bump (bug #69787); command-line patch from Ben Ford via bug #69196
*zsnes-1.37_pre20040920 (23 Sep 2004)
-MD5 12ffdcbca63167f66c64b9ad62e82fe5 ChangeLog 3996
+MD5 420e80080d004920c31cdcb2586c7339 ChangeLog 4229
MD5 8c1a379dff1b3df750bf69ef17f339a2 zsnes-1.36.ebuild 883
MD5 5eebdb72e9ff23b107bbc7ec77a1aade zsnes-1.37_pre20040803.ebuild 1568
MD5 f17b9b8fa07a38914fe1c03268f51678 metadata.xml 158
MD5 72e63acb3d8445cdd97d7d09ad60f666 zsnes-1.37_pre20040920.ebuild 1573
+MD5 c16c5d8354eea7ee7719a64d14e6d8fb zsnes-1.37_pre20041024.ebuild 1623
MD5 80ca4b35a91db4fc77d10b9e3c51f48e files/digest-zsnes-1.37_pre20040920 64
MD5 b828464647d2d51e3a08b60e05795f1d files/digest-zsnes-1.36 63
MD5 4ae9745bf2b7f363d3703e5f4c402b6c files/digest-zsnes-1.37_pre20040803 64
+MD5 63565a81de9b21332b2c3950d280589a files/digest-zsnes-1.37_pre20041024 64
+MD5 46cccb6864144319a93aa5d953fadb0c files/command-line.patch 717
--- /dev/null
+--- zsnes/src/linux/zloaderw.c 2003-10-22 20:10:08.000000000 -0700
++++ zsnes/src/linux/zloaderw.c.new 2004-10-27 15:32:30.000000000 -0700
+@@ -336,15 +336,14 @@
+ }
+
+ /* execute rom filename: file.x */
+- if (optopt == '?')
++ /* getopt permutates argv until all non options are at the end of argv. */
++ /* since we only expect one non option, it should be the last argument. */
++ if ( optind == argc - 1 && argv[optind] != NULL)
+ {
+- if (argv[optind] != NULL)
+- {
+- fvar=&fname;
+- fvar[0] = strlen(argv[optind]);
+- strncpy(&fvar[1], argv[optind],127);
+- makeextension();
+- }
++ fvar=&fname;
++ fvar[0] = strlen(argv[optind]);
++ strncpy(&fvar[1], argv[optind],127);
++ makeextension();
+ }
+
+ zstart();
--- /dev/null
+MD5 8e92f3366cf93a4b541248abe36159f7 ZSNESS_1024.tar.bz2 789791
--- /dev/null
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-emulation/zsnes/zsnes-1.37_pre20041024.ebuild,v 1.1 2004/11/20 12:24:34 mr_bones_ Exp $
+
+inherit eutils flag-o-matic games
+
+DESCRIPTION="SNES (Super Nintendo) emulator that uses x86 assembly"
+HOMEPAGE="http://www.zsnes.com/ http://ipherswipsite.com/zsnes/"
+SRC_URI="http://www.ipherswipsite.com/files/zsnes/ZSNESS_${PV/*2004}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~x86 ~amd64"
+IUSE="opengl"
+
+# we need libsdl for headers on amd64, even though we'll technically be using
+# the 32bit sdl from emul-linux-x86-sdl.
+RDEPEND="opengl? ( virtual/opengl )
+ >=media-libs/libsdl-1.2.0
+ amd64? ( app-emulation/emul-linux-x86-sdl )
+ sys-libs/zlib
+ media-libs/libpng"
+DEPEND="${RDEPEND}
+ >=dev-lang/nasm-0.98
+ sys-devel/automake
+ >=sys-devel/autoconf-2.58"
+
+S="${WORKDIR}/${PN}"
+
+multilib_check() {
+ if has_m32 ; then
+ einfo "multilib detected, adding -m32 to CFLAGS. note that opengl"
+ einfo "support probably wont work quite right."
+ append-flags -m32
+ else
+ die "zsnes requires multilib support in gcc. please re-emerge gcc with multilib in USE and try again"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}/src"
+ epatch "${FILESDIR}/command-line.patch"
+ aclocal && autoconf || die "autotools failed"
+}
+
+src_compile() {
+ use amd64 && multilib_check
+
+ cd src
+ egamesconf \
+ $(use_enable opengl) \
+ || die
+ emake || die "emake failed"
+}
+
+src_install() {
+ dogamesbin src/zsnes || die "dogamesbin failed"
+ newman src/linux/zsnes.1 zsnes.6
+ dodoc *.txt linux/*
+ prepgamesdirs
+}