less flattr buttons - it is very dead and I don't use it anymore
[www-rohieb-name.git] / blag / post / zsnes-on-amd64-ubuntu.mdwn
1 [[!meta title="ZSNES on AMD64 Ubuntu"]]
2 [[!meta date="2010-10-06"]]
3 [[!meta author="rohieb"]]
4 [[!meta license="CC-BY-SA 3.0"]]
5
6 **[ Update, 2013-10:** This post post is not up to date anymore. On newer
7 Debians (since 7.0/wheezy) and Ubuntus (at least since 12.04, Precise Pangolin),
8 you should be able to install zsnes out of the box: `sudo apt-get install
9 zsnes:i386`. For details see the MultiArch documentation for
10 [Debian][MultiArchDebian] and [Ubuntu][MultiArchUbuntu]. **]**
11
12 [MultiArchDebian]: https://wiki.debian.org/Multiarch/
13 [MultiArchUbuntu]: https://help.ubuntu.com/community/MultiArch
14
15 Before I bought my current hardware, I was working on a 32-bit-based
16 system, and I really appreciated ZSNES as an SNES emulator. But
17 unfortunately, my new hardware was an AMD64 system, and there is
18 currently no ZSNES package for 64-bit Ubuntu or Debian :( So I decided
19 to google a bit about the issue, but it took me until now (a year later)
20 to get ZSNES finally working on my machine. The problem is, if you build
21 ZSNES on a 64-bit machine, all the application does is segfault at
22 start, and if you [try to compile for 32-bit systems][0], you get errors
23 about missing 32-bit libs (in particular, configure does not find a
24 suitable `libsdl`). Instead, if you just take the binary which was
25 compiled on a 32-bit system, and install the `ia32-libs` package,
26 everything seems to work—at least I was able to play a few levels of
27 Super Mario World succesfully :-)
28
29 [0]: http://board.zsnes.com/phpBB3/viewtopic.php?p=118067&sid=dd9a2a54d9178eb5009c33586aea703c#p118067
30
31 So here was my idea: take the 32-bit package from the Ubuntu repository,
32 and just change the Architecture control field, and by this fool dpkg :P
33 And as it turned out, this idea worked great. You can get the Debian
34 package here if you want, it *should* work for Ubuntu Karmic and Lucid,
35 as well as for Debian testing (**but** I only tested it on Lucid, so
36 there is no warranty here—but I’m happy to hear if it works :-)):
37
38 * [zsnes_1.510-2.2ubuntu3~ppa1_amd64.deb][2]
39 * SHA1: `716bbd37267b477ef02961a7727212619309b83f`
40 * MD5: `452ea5230ad17df1dee649ab4cc6c8c0`
41
42 [2]: http://rohieb.name/stuff/zsnes_1.510-2.2ubuntu3~ppa1_amd64.deb
43
44 ## How to Reproduce It
45 For the curious people reading here, here is what I actually did:
46
47 1. `wget http://archive.ubuntu.com/ubuntu/pool/universe/z/zsnes/zsnes_1.510-2.2ubuntu3_i386.deb`
48 2. `ar x zsnes_1.510-2.2ubuntu3_i386.deb`
49 3. `tar xzf data.tar.gz`
50 4. Edit `usr/share/applications/zsnes.desktop` and added `-ad sdl` to the
51 `Exec:` field, otherwise it would just segfault on the first run:
52
53 Exec=zsnes -ad sdl
54
55 5. Edit `usr/share/doc/zsnes/changelog.Debian.gz` and added a new
56 changelog entry for the version (just copy one of the previous
57 entries and adapt it)
58 6. `tar xzf control.tar.gz`
59 7. Edit the `control` file, changed the `Version:` and `Architecture:`
60 field to `amd64`, added the `ia32-libs` dependency, and set myself as
61 maintainer:
62
63 Package: zsnes
64 Version: 1.510-2.2ubuntu3~ppa1
65 Architecture: amd64
66 Maintainer: Roland Hieber <foobar@example.org>
67 Installed-Size: 4160
68 Depends: ia32-libs, libao2 (>= 0.8.8), libc6 (>= 2.4), libgcc1 (>= 1:4.1.1),
69 libgl1-mesa-glx | libgl1, libpng12-0 (>= 1.2.13-4),
70 libsdl1.2debian (>= 1.2.10-1), libstdc++6 (>= 4.1.1), zlib1g (>= 1:1.2.2.3)
71 [...]
72
73 8. Change the `md5sums` file for the right values for
74 `usr/share/applications/zsnes.desktop` and
75 `usr/share/doc/zsnes/changelog.Debian.gz` (I used the `md5sum`
76 command and copy-pasted it)
77 9. `tar czf control.tar.gz control md5sums postrm postinst`
78 0. `tar czf data.tar.gz usr/`
79 1. `ar r zsnes_1.510-2.2ubuntu3~ppa1_amd64.deb debian-binary
80 control.tar.gz data.tar.gz`
81
82 I’m afraid that I can’t put the package into [my PPA][3], Launchpad only
83 accepts source packages for uploads, and builds the binary packages
84 itself, both for i386 and AMD64. This approach can not be used here,
85 since we needed the i386 binary for AMD64.
86
87 [3]: https://launchpad.net/~rohieb/+archive/ppa
88
89 [[!tag Debian hacking howto Ubuntu workaround Linux packaging
90 Ubuntu_Jaunty Ubuntu_Karmic ZSNES]]
This page took 0.042283 seconds and 5 git commands to generate.