Home > Debian, hacking, howto, Ubuntu, workaround > ZSNES on AMD64 Ubuntu

ZSNES on AMD64 Ubuntu

[ Update, 2013-10: This post post is not up to date anymore. On newer Debians (since 7.0/wheezy) and Ubuntus (at least since 12.04, Precise Pangolin), you should be able to install zsnes out of the box: sudo apt-get install zsnes:i386. For details see the MultiArch documentation for Debian and Ubuntu. ]

Before I had bought my current hardware, I was working on a 32-bit-based system, and I really appreciated ZSNES as an SNES emulator. But unfortunately, my new hardware was an AMD64 system, and there is currently no ZSNES package for 64-bit Ubuntu or Debian 😦 So I decided to google a bit about the issue, but it took me until now (a year later) to get ZSNES finally working on my machine. The problem is, if you build ZSNES on a 64-bit machine, all the application does is segfault at start, and if you try to compile for 32-bit systems, you get errors about missing 32-bit libs (in particular, configure does not find a suitable libsdl). Instead, if you just take the binary which was compiled on a 32-bit system, and install ia32-libs everything seems to work—at least I was able to play a few levels of Super Mario World succesfully 🙂

So here was my idea: take the 32-bit package from the Ubuntu repository, and just change the Architecture control field, and by this fool dpkg 😛 And as it turned out, this idea worked great. You can get the Debian package here if you want, it should work for Ubuntu Karmic and Lucid, as well as for Debian testing (but I only tested it on Lucid, so there is no warranty here—but I’m happy to hear if it works :)):

For the curious people reading here, here is what I actually did:

  1. wget http://archive.ubuntu.com/ubuntu/pool/universe/z/zsnes/zsnes_1.510-2.2ubuntu3_i386.deb
  2. ar x zsnes_1.510-2.2ubuntu3_i386.deb
  3. tar xzf data.tar.gz
  4. Edited usr/share/applications/zsnes.desktop and added -ad sdl to the Exec: field, otherwise it would just segfault on the first run:
    Exec=zsnes -ad sdl
  5. Edited usr/share/doc/zsnes/changelog.Debian.gz and added a new changelog entry for the version
  6. tar xzf control.tar.gz
  7. Edited the control file, changed the Version: and Architecture: field to amd64, added the ia32-libs dependency, and set myself as maintainer:
    Package: zsnes
    Version: 1.510-2.2ubuntu3~ppa1
    Architecture: amd64
    Maintainer: Roland Hieber <foobar@example.org>
    Installed-Size: 4160
    Depends: ia32-libs, libao2 (>= 0.8.8), libc6 (>= 2.4), libgcc1 (>= 1:4.1.1), libgl1-mesa-glx | libgl1, libpng12-0 (>= 1.2.13-4), libsdl1.2debian (>= 1.2.10-1), libstdc++6 (>= 4.1.1), zlib1g (>= 1:1.2.2.3)
    [...]
  8. Changed the md5sums file for the right values for usr/share/applications/zsnes.desktop and usr/share/doc/zsnes/changelog.Debian.gz (I used the md5sum command and copy-pasted it)
  9. tar czf control.tar.gz control md5sums postrm postinst
  10. tar czf data.tar.gz usr/
  11. ar r zsnes_1.510-2.2ubuntu3~ppa1_amd64.deb debian-binary control.tar.gz data.tar.gz

I’m afraid that I can’t put the package to PPA, Launchpad only accepts source packages for uploads, and builds the binary packages itself, both for i386 and AMD64. This approach can not be used here, since we needed the i386 binary for AMD64.


Flattr this

Advertisements
  1. Thorben Bräutigam
    October 16, 2010 at 10:46

    Made this for Maverick following your instructions, since the lucid package ends up in a broken package (libao2 turned into libao4) and zsnes would need symlinks on 10.10 to work.

    Thought I’d add it here for whoever runs into the same problems.

    Thank you for these easy to follow instructions.

    Here the link to the package on MediaFire: http://www.mediafire.com/?t9jwxm965gpicv7

  2. December 4, 2010 at 02:07

    It installed fine but when I open it it just shows the terminal for a split second and then it closes. I don’t know how to get it to open 😦

  3. idecasso
    December 29, 2010 at 09:05

    Thanks 🙂 the second file works for me 🙂

  4. Johannes
    March 13, 2011 at 11:39

    I installed the version by Thorben, seems to work fine. Thanks!

  5. TDK
    June 1, 2011 at 17:20

    Thorben’s version also works on Linux Mint 11 (Natty). Thanks to him and rohieb! 🙂

  6. aquameerkat
    December 7, 2011 at 16:01

    You’re the man Thorben! Works great on Oneiric 64bit

  7. March 11, 2012 at 18:26

    Thorben, you’re the man. I’ve got it working on Oneiric 64 bits.

  8. rivalary
    September 30, 2012 at 18:51

    Thank you!

  9. Haus
    October 21, 2013 at 03:51

    A shame Thorben’s link is down…

    I’m trying to make this process work on Raring 64-bits, but my Linux Fu is too weak. I lost you at step 8, and the steps after that.

    Also, none of the /usr/share files you edited existed on my machine, so I created them. Not sure if that will be an issue.

    Please advise!

    • rohieb
      October 21, 2013 at 18:13

      This post has gotten old now. Never versions of Ubuntu and Debian have enabled MultiArch (see https://help.ubuntu.com/community/MultiArch), so you should be able to install the i386 version of zsnes out of the box instead of building your own dpkg package as described here. Just try sudo aptitude install zsnes:i386.

  1. September 13, 2011 at 11:02

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: