Before we start, make sure you have NASM, GCC and zlib installed, and optionally libpng and an opengl driver (refer to documentation). You also need a 32-bit version of libsdl >= 1.2.0. If you are using gentoo, it's as simple as:
Code: Select all
emerge emul-linux-x86-sdl
For other distros, refer to your package manager or install a 32-bit SDL manually. It should be as easy as getting the rpm here and extracting it (use rpm2targz or alien) somewhere like /usr/lib32.
First get the WIP here and unpack it
Code: Select all
mkdir zsnes && tar xjvf ZSNESS_0105.tar.bz2 -C zsnes && cd zsnes/src/
Code: Select all
export CFLAGS="-m32 -L/emul/linux/x86/usr/lib"
Code: Select all
aclocal && autoconf
./configure --prefix=/usr/games --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share/games --sysconfdir=/etc/games --localstatedir=/var/games --enable-libpng --enable-opengl
make
Code: Select all
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: warning: i386:x86-64 architecture of input file `cfgparse.o' is incompatible with i386 output
Code: Select all
./parsegen -D__UNIXSDL__ temppsr.c cfgparse.psr
x86_64-pc-linux-gnu-gcc -m32 -I. -O1 -o cfgparse.o -c temppsr.c
make
make install
-This will NOT work for zsnes 1.42, apparently gentoo applies a patch to configure.in file before compiling. I can't find this patch on the bugzilla, but if someone wants it to be able to compile this version, just ask I'll post it
-This probably works for FreeBSD 64-bit also, just use gmake instead of make
Ebuild modified to install the WIP instead of 1.42. I'd be interested to know if that ebuild works on x86 systems too :
Code: Select all
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils flag-o-matic games
DESCRIPTION="SNES (Super Nintendo) emulator that uses x86 assembly"
HOMEPAGE="http://www.zsnes.com/ http://ipherswipsite.com/zsnes/"
MY_P="ZSNESS_0105"
SRC_URI="http://files.ipherswipsite.com/zsnes/${MY_P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* amd64 x86"
IUSE="opengl png"
RDEPEND=">=media-libs/libsdl-1.2.0
>=sys-libs/zlib-1.1
amd64? ( app-emulation/emul-linux-x86-sdl )
opengl? ( virtual/opengl )
png? ( media-libs/libpng )"
DEPEND="${RDEPEND}
>=dev-lang/nasm-0.98
sys-devel/automake
>=sys-devel/autoconf-2.58"
S="${WORKDIR}"
pkg_setup() {
use amd64 || return 0
if has_m32 ; then
export ABI=x86
else
eerror "Your compiler seems to be unable to compile 32bit code."
eerror "Make sure you compile gcc with:"
echo
eerror " USE=multilib FEATURES=-sandbox"
die "Cannot produce 32bit code"
fi
games_pkg_setup
}
src_unpack() {
unpack ${A}
cd "${S}"/src
cp "icons/48x48x32.png" "${T}/zsnes.png"
aclocal && autoconf || die "autotools failed"
}
src_compile() {
cd src
egamesconf \
$(use_enable png libpng) \
$(use_enable opengl) \
|| die
emake || die "emake failed"
}
src_install() {
dogamesbin src/zsnes || die "dogamesbin failed"
newman src/linux/zsnes.1 zsnes.6
dodoc docs/{*.txt,README.LINUX}
dohtml -r docs/Linux/*
make_desktop_entry zsnes ZSNES zsnes.png
doicon "${T}/zsnes.png"
prepgamesdirs
}