Installing snes9x on Debian

If you're having problems with Snes9x, or think you've found a bug, this is the place to be.
Post Reply
SandmanLobo
Snes9x White Belt
Posts: 1
Joined: Sat Mar 19, 2016 5:30 pm

Installing snes9x on Debian

Post by SandmanLobo »

So, after about a decade away from Snes9x I decided to play again and found out that now they have Linux support, which is awesome.

Unfortunately, I had a lot of trouble trying to install the latest version of Snes9x on my Debian PC and the README provided by the source files was quite unhelpful. After about 4 hours of messing around trying to find what was missing from my computer I was finally able to properly install Snes9x on my computer; so I decided to make a script with everything I had to do to install it for when I needed to do so again, so I'm sharing that script here for anyone who might be having trouble installing Snes9x on Linux.

This script was created and tested on Debian 8 (Jessie), but I have no reason to believe it won't work on other Debian distributions or Ubuntu.

Code: Select all

#!/bin/bash

sudo aptitude update &&
sudo aptitude install pkg-config libgtk2.0-dev libxml2-dev libxv-dev libsdl-dev libsdl-dev -y &&
wget http://launchpad.net/intltool/trunk/0.50.2/+download/intltool-0.50.2.tar.gz &&
tar -xzf intltool-0.50.2.tar.gz &&
sudo chmod -R 777 intltool-0.50.2 &&
cd intltool-0.50.2 &&
./configure &&
make &&
sudo make install &&
cd .. &&
rm -r intltool-0.50.2 &&
rm intltool-0.50.2.tar.gz &&
wget http://files.ipherswipsite.com/snes9x/snes9x-1.53-src.tar.bz2 &&
tar -xjf snes9x-1.53-src.tar.bz2 &&
sudo chmod -R 777 snes9x-1.53-src &&
cd snes9x-1.53-src/gtk &&
./configure &&
make &&
sudo make install &&
cd ../.. &&
rm -r snes9x-1.53-src &&
rm snes9x-1.53-src.tar.bz2
Just copy and paste the code on a script file, or download the file I am providing. In both cases you will probably have to change the script permissions to execute it (chmod 777 nameofthescript.sh)
Attachments
install_snes9x_Debian_(Jessie).gz
(323 Bytes) Downloaded 3342 times
freddiaN
Snes9x White Belt
Posts: 1
Joined: Sun Nov 27, 2016 4:04 pm

Re: Installing snes9x on Debian

Post by freddiaN »

Thanks alot!
I was also trying to install it on elementaryos 0.4 (loki) and I just had to replace aptitude with apt and it worked fine (so if anyone else wants to do the same, just replace it and it will work fine, atleast it did for me :P)
tititutu
Snes9x White Belt
Posts: 1
Joined: Fri Jun 16, 2017 12:21 am

Re: Installing snes9x on Debian

Post by tititutu »

Here is what works for me on the last Debian stable (Stretch). I don't use sudo as a default user doesn't have the sudo rights on Debian.

Code: Select all

su -
apt-get install -y pkg-config libgtk2.0-dev libxml2-dev libxv-dev libsdl-dev libsdl-dev intltool  &&
cd /tmp  &&
wget http://files.ipherswipsite.com/snes9x/snes9x-1.53-src.tar.bz2 &&
tar -xjf snes9x-1.53-src.tar.bz2 &&
cd snes9x-1.53-src/gtk &&
./configure &&
make &&
make install
andrebrait
Snes9x White Belt
Posts: 2
Joined: Sun Jul 02, 2017 5:51 pm

Re: Installing snes9x on Debian

Post by andrebrait »

Oops, correcting my script for 1.54.1

Code: Select all

su -
apt-get install -y pkg-config libgtk2.0-dev libxml2-dev libxv-dev libsdl-dev libsdl-dev intltool  &&
cd /tmp  &&
wget http://www.s9x-w32.de/dl/snes9x-1.54.1.tar.bz2 &&
tar -xjf snes9x-1.54.1.tar.bz2 &&
cd snes9x-1.54.1/gtk &&
./configure &&
make &&
make install
andrebrait
Snes9x White Belt
Posts: 2
Joined: Sun Jul 02, 2017 5:51 pm

Re: Installing snes9x on Debian

Post by andrebrait »

Updating for 1.55

Code: Select all

su -
apt-get install -y pkg-config libgtk2.0-dev libxml2-dev libxv-dev libsdl-dev libsdl-dev intltool libminizip-dev &&
cd /tmp  &&
wget http://www.s9x-w32.de/dl/snes9x-1.55.tar.bz2 &&
tar -xjf snes9x-1.55.tar.bz2 &&
cd snes9x-1.55/gtk &&
./configure &&
make &&
make install
fluttr
Snes9x White Belt
Posts: 1
Joined: Fri Feb 23, 2018 7:45 pm

Re: Installing snes9x on Debian

Post by fluttr »

This script will download Snes9x tarball, compile it and then build a Debian package using checkinstall, so you can manage distributive with dpkg and apt.
Script assuming that current user is allowed to run sudo. Don't forget to give this script execution permissions with command like

Code: Select all

chmod +x build_snes9x_debian_package.txt

Code: Select all

#!/bin/bash
set -e

script_root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# where the result package will be stored
pkg_dest_dir="${script_root}"
pkg_name="snes9x"
pkg_version="1.55"
# mirrors listed here: http://www.snes9x.com/downloads.php
src_url="http://www.s9x-w32.de/dl/snes9x-1.55.tar.bz2"
src_tarball=${script_root}/$(basename "${src_url}")
build_dir="${script_root}/build"
build_deps=(
    'build-essential' 'checkinstall' 'pkg-config' 'libgtk2.0-dev' 'libxml2-dev' 'libxv-dev'
    'libsdl-dev' 'libsdl-dev' 'intltool' 'libminizip-dev'
)

COLOR_LCYAN='\033[1;36m'
COLOR_DEFAULT='\033[0m'
notify(){
    echo -e "${COLOR_LCYAN}$1${COLOR_DEFAULT}"
}

notify "Installing build dependencies..."
if ! sudo dpkg -s ${build_deps[@]}; then
    sudo apt install --yes ${build_deps[@]}
fi

notify "Downloading and extracting Snes9x source tarball..."
if [ ! -f "${src_tarball}" ]; then
    wget -O "${src_tarball}" "${src_url}"
fi
if [ ! -d "${build_dir}" ]; then
    mkdir -p "${build_dir}"
    tar xjf "${src_tarball}" -C "${build_dir}"
fi

notify "Configuring and building Snes9x sources..."
# Name of extracted from src tarball directory may vary in future. Change it if script fails here.
pushd "${build_dir}"/snes9x*/gtk
./configure && make

notify "Building debian package..."
# You can either add needed package metainformation as checkinstall arguments (see man checkinstall)
# or remove --default switch and then interactively specify needed info
# Also, you can create RPM and Slackware packages with checkinstall if needed
sudo checkinstall     --default --install=no --fstrans=yes     --pakdir "${pkg_dest_dir}"     --pkgname "${pkg_name}"     --pkgversion "${pkg_version}"     sudo make install
popd
Attachments
build_snes9x_debian_package.tar.gz
(1011 Bytes) Downloaded 2080 times
enigma9o7
Snes9x White Belt
Posts: 5
Joined: Tue Sep 25, 2018 9:18 pm

Re: Installing snes9x on Debian

Post by enigma9o7 »

fluttr wrote:This script will download Snes9x tarball, compile it and then build a Debian package using checkinstall, so you can manage distributive with dpkg and apt.
Thanks! Worked for me.

Any chance for a 1.56 update?
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Re: Installing snes9x on Debian

Post by BearOso »

Take the last version posted above and change the 1.55 to 1.56.2 in the two places and change the file extension from bz2 to gz
nesnes
Snes9x White Belt
Posts: 3
Joined: Sun Jan 19, 2020 8:04 pm

Re: Installing snes9x on Debian

Post by nesnes »

Can someone help me to install snes9x 1.60 on Debian 10? What I've tried so far:

Code: Select all

su -
apt-get install -y pkg-config libgtk2.0-dev libxml2-dev libxv-dev libsdl-dev libsdl-dev intltool libminizip-dev &&
cd /tmp  &&
wget http://www.s9x-w32.de/dl/snes9x-1.60.tar.gz &&
tar -xzf snes9x-1.60.tar.gz &&
cd snes9x-1.60/gtk &&
./configure &&
make &&
make install
Terminal says './configure: No such file or directory'.
odditude
Snes9x Green Belt
Posts: 445
Joined: Tue May 03, 2011 2:35 pm

Re: Installing snes9x on Debian

Post by odditude »

try using fluttr's script (with BearOso's tweaks for newer versions), just a few replies before your post.
nesnes
Snes9x White Belt
Posts: 3
Joined: Sun Jan 19, 2020 8:04 pm

Re: Installing snes9x on Debian

Post by nesnes »

The build system has been switched to Meson:

viewtopic.php?t=26600

So the posted script will not work for 1.60. Unfortunately, I have never compiled anything from source before. Running 'Meson' does not work so far.

Code: Select all

user@debian:/tmp/snes9x-1.60/gtk$ meson builddir --prefix=/usr --buildtype=release
The Meson build system
Version: 0.49.2
Source dir: /tmp/snes9x-1.60/gtk
Build dir: /tmp/snes9x-1.60/gtk/builddir
Build type: native build
Project name: snes9x-gtk
Project version: 1.60
Native C compiler: cc (gcc 8.3.0 "cc (Debian 8.3.0-6) 8.3.0")
Native C++ compiler: c++ (gcc 8.3.0 "c++ (Debian 8.3.0-6) 8.3.0")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29)
Dependency glib-2.0 found: YES 2.58.3
Dependency gthread-2.0 found: YES 2.58.3
Dependency gobject-2.0 found: YES 2.58.3
Found sdl2-config None NO
Dependency sdl2 found: NO (tried pkgconfig and config-tool)

meson.build:29:0: ERROR:  Dependency "sdl2" not found, tried pkgconfig and config-tool

A full log can be found at /tmp/snes9x-1.60/gtk/builddir/meson-logs/meson-log.txt
:?:
odditude
Snes9x Green Belt
Posts: 445
Joined: Tue May 03, 2011 2:35 pm

Re: Installing snes9x on Debian

Post by odditude »

here's the important part:

Code: Select all

meson.build:29:0: ERROR:  Dependency "sdl2" not found, tried pkgconfig and config-tool
Per the SDL Wiki, you can use the following on Debian (and related distros):

Code: Select all

sudo apt-get install libsdl2-2.0 libsdl2-dev
once that's done, run that Meson command again.
nesnes
Snes9x White Belt
Posts: 3
Joined: Sun Jan 19, 2020 8:04 pm

Re: Installing snes9x on Debian

Post by nesnes »

Many thanks, now all error messages are gone and the installation process works fine!
Post Reply