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