makedeb
A tribute to Nintendo's The Legend of Zelda (NES), read install instructions in README.pkg
Click here to go back to the commit logs for zelda-classic-bin.
Hash: b15e0a0fa26afe58c14966b853d3ce3864d366ca
Message: Initial mpr release
diff --git a/.SRCINFO b/.SRCINFO
index fd7acb3..b8cfd4d 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,39 +1,46 @@
-pkgbase = zelda-classic
- pkgdesc = A tribute to Nintendo's The Legend of Zelda (NES)
- pkgver = 2.50.2.29
- pkgrel = 2
- url = http://zeldaclassic.com
- install = zelda-classic.install
- arch = i686
- arch = x86_64
- license = GPL3
- license = custom
- options = !strip
- source = zelda-classic-2-50-2-linux.tar.gz::https://www.zeldaclassic.com/download/100/
- source = zelda-classic.png
- source = zelda-classic-zlaunch.png
- source = zelda-classic-zquest.png
- source = zelda-classic.desktop
- source = zelda-classic-zlaunch.desktop
- source = zelda-classic-zquest.desktop
- source = zelda-classic.sh
- sha256sums = 44e105415b1b1d5ca5c625907cf6fc2ce835ddaf9b70a6ace4cd0febe1ae4ed0
- sha256sums = bb4331ce9940c81edb95d3388f3e3cb459c1559df159d727b0302dd7dbbd82e1
- sha256sums = bfc007209c30f8b752ad102e2f9e6a4cd4fc447dc306c2712db4f34a8ffb3b7e
- sha256sums = e436cfa2303703037a800b298ad52f50af8e9e2d3e410e9298a6218761c9d088
- sha256sums = 23c4158bea70740a3685217dcb0e8cc1225425af437cfccf6d12c83de4743c8c
- sha256sums = 44e1c4f0a0bed46ce40cb7659863c797b47d1afcef99c86cc329d10898511c2f
- sha256sums = 72bc054a698e36b9a23e3907ac9112aab78b0424c71ba0c9a657cbe78886572c
- sha256sums = 7188389790cdc030316231103a76b0e692e4a546fed748d86f15f977907be684
- depends_i686 = libxxf86vm
- depends_i686 = libxcursor
- depends_i686 = alsa-lib
- depends_i686 = bash
- optdepends_i686 = gtk-engine-murrine: needed for the gtk2-launcher
- depends_x86_64 = lib32-libxxf86vm
- depends_x86_64 = lib32-libxcursor
- depends_x86_64 = lib32-alsa-lib
- depends_x86_64 = bash
- optdepends_x86_64 = lib32-gtk-engine-murrine: needed for the gtk2-launcher
-
-pkgname = zelda-classic
+generated-by = makedeb
+pkgname = zelda-classic-bin
+pkgbase = zelda-classic-bin
+pkgdesc = A tribute to Nintendo's The Legend of Zelda (NES), read install instructions in README.pkg
+pkgrel = 0
+pkgver = 2.50.2.29
+url = http://zeldaclassic.com
+arch = i386
+conflicts = zelda-classic
+depends = libxxf86vm1
+depends = libxcursor1
+depends = libasound2-plugins
+license = GPL3
+license = custom
+optdepends = libgtk2.0-0: needed by the launcher
+optdepends = gtk2-engines-murrine: optional for the launcher
+optdepends = gtk2-engines-pixbuf: optional for the launcher
+optdepends = libcanberra-gtk-module: optional for the launcher
+optdepends = libatk-adaptor: optional for the launcher
+options = !strip
+provides = zelda-classic
+source = zelda-classic-2-50-2-linux.tar.gz::https://www.zeldaclassic.com/download/100/
+source = zelda-classic.png
+source = zelda-classic-zlaunch.png
+source = zelda-classic-zquest.png
+source = zelda-classic.desktop
+source = zelda-classic-zlaunch.desktop
+source = zelda-classic-zquest.desktop
+source = zelda-classic.sh
+source = zelda-classic-workaround.sh
+source = zelda-classic-README.pkg
+b2sums = fb8b8f672e277ebd13e59c47064dbc3dcfdcc7fd8d26256258c3177a836dc2cee87d62b99446f13a610e7581bf3b5d716e4e66d944460341a3c770efa64ca811
+b2sums = f3514a8f9911c2955955ab4af60e364c6dcafdc727f1da8f73ed3f52501cc6b23fdb98a2c9ba8139b77a984312d99270556d8e68ac4a36913cf48557f0b4ceb9
+b2sums = 11a6698d7905490742538d48e34be7151a69de8050f9431f69e610e41de56876316daa29fb1700599579641a3b013b3d028a3181aad79759fd99e3f3e302480b
+b2sums = a4d5f37f869626fb350bf9c7f3ce84ac201b8120ab0c363eccd6588fa7b8a0a310958dcc5db86909527791563751491359a38d80095a02745132770e8f0a9005
+b2sums = c991b7c6b85c1288fa1c624f9530ae5a45ca3154f823b5dc91cc3ea136eaeaae00e399076296d4b6789459efba3e2e84e840b229d35538d400e7e11d87e458c8
+b2sums = c9e579e7e36ef1bf9e2dab19c11bc3c0da0c427a45f0b8f1db8e11c8d4e2b0897d540506f8727ab6006ee8947d9df0035afcca83a23ac8d0fed437be492943b7
+b2sums = 954eb03b87ae1382a5e609813755823f905341f35636a1eb67c19a8fd498d743f5aa797428efcee27fce29b7eb491495a32280a14b7b2252dfc38c4486b2ac23
+b2sums = 1a3693d094d0c2289ef9c0776c0f5a5ab80c85364b56fa504c416b5f5e063215800fd2d587df5ae0bb43acc7c6bdbbbe97bc34fe91a05075cec1c7e6f02f7162
+b2sums = 3c2c1dc85120a340b29f0288426ed4d86ef06acaa4fd86d141bcc223071f0449858a3320e0d070ab9c860a16ea78cb1a3c3e0fd4ad5fe1642cb013d213d77903
+b2sums = 512926d10029a688e3328fc5a4992da643864f9eddc3944ee7eb708d1461054c84c61139246809a3b4a790cdb65fd62367778284c37552de3565d70e5aeadb4d
+optdepends = libgtk2.0-0: needed by the launcher
+optdepends = gtk2-engines-murrine: optional for the launcher
+optdepends = gtk2-engines-pixbuf: optional for the launcher
+optdepends = libcanberra-gtk-module: optional for the launcher
+optdepends = libatk-adaptor: optional for the launcher
diff --git a/.gitignore b/.gitignore
index fc7564a..cdb73e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,4 @@
-*
-!.gitignore
-!.SRCINFO
-!PKGBUILD
-!zelda-classic-*
-!zelda-classic.*
+*.tar.gz
+*.deb
+pkg/
+src/
diff --git a/PKGBUILD b/PKGBUILD
index 32cf65a..db93455 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,64 +1,88 @@
-# Maintainer: Marcell Meszaros < marcell.meszaros AT runbox.eu >
-# Contributor: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG
+# Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>
+# Contributor: Marcell Meszaros (AUR) < marcell.meszaros AT runbox.eu >
+# Contributor: carstene1ns (AUR) <arch carsten-teibes de> - http://git.io/ctPKG
-pkgname=zelda-classic
+# multiarch and bug workaround
+# read instructions README.pkg or /usr/share/doc/zelda-classic/README.pkg
+
+# for makedeb multiarch,
+# starting with version 16 use this:
+# export MAKEDEB_DPKG_ARCHITECTURE='i386'
+# in the SHELL, **NOT** in the PKGBUILD, or it will throw a fatal error.
+
+_pkgname=zelda-classic
+pkgname=zelda-classic-bin
pkgver=2.50.2.29
-pkgrel=2
-pkgdesc="A tribute to Nintendo's The Legend of Zelda (NES)"
-arch=('i686' 'x86_64')
+pkgrel=0
+pkgdesc="A tribute to Nintendo's The Legend of Zelda (NES), read install instructions in README.pkg"
+arch=('i386')
url="http://zeldaclassic.com"
license=('GPL3' 'custom')
-depends_i686=('libxxf86vm' 'libxcursor' 'alsa-lib' 'bash')
-depends_x86_64=('lib32-libxxf86vm' 'lib32-libxcursor' 'lib32-alsa-lib' 'bash')
-optdepends_i686=('gtk-engine-murrine: needed for the gtk2-launcher')
-optdepends_x86_64=('lib32-gtk-engine-murrine: needed for the gtk2-launcher')
-install=$pkgname.install
-source=("$pkgname-2-50-2-linux.tar.gz::https://www.zeldaclassic.com/download/100/"
- "$pkgname.png"
- "$pkgname-zlaunch.png"
- "$pkgname-zquest.png"
- "$pkgname.desktop"
- "$pkgname-zlaunch.desktop"
- "$pkgname-zquest.desktop"
- "$pkgname.sh")
-sha256sums=('44e105415b1b1d5ca5c625907cf6fc2ce835ddaf9b70a6ace4cd0febe1ae4ed0'
- 'bb4331ce9940c81edb95d3388f3e3cb459c1559df159d727b0302dd7dbbd82e1'
- 'bfc007209c30f8b752ad102e2f9e6a4cd4fc447dc306c2712db4f34a8ffb3b7e'
- 'e436cfa2303703037a800b298ad52f50af8e9e2d3e410e9298a6218761c9d088'
- '23c4158bea70740a3685217dcb0e8cc1225425af437cfccf6d12c83de4743c8c'
- '44e1c4f0a0bed46ce40cb7659863c797b47d1afcef99c86cc329d10898511c2f'
- '72bc054a698e36b9a23e3907ac9112aab78b0424c71ba0c9a657cbe78886572c'
- '7188389790cdc030316231103a76b0e692e4a546fed748d86f15f977907be684')
+depends=('libxxf86vm1' 'libxcursor1' 'libasound2-plugins')
+optdepends=('libgtk2.0-0: needed by the launcher'
+ 'gtk2-engines-murrine: optional for the launcher'
+ 'gtk2-engines-pixbuf: optional for the launcher'
+ 'libcanberra-gtk-module: optional for the launcher'
+ 'libatk-adaptor: optional for the launcher'
+ #'xserver-xephyr: serious Xorg bug workaround, install native package'
+)
+provides=('zelda-classic')
+conflicts=('zelda-classic')
+source=("$_pkgname-2-50-2-linux.tar.gz::https://www.zeldaclassic.com/download/100/"
+ "$_pkgname.png"
+ "$_pkgname-zlaunch.png"
+ "$_pkgname-zquest.png"
+ "$_pkgname.desktop"
+ "$_pkgname-zlaunch.desktop"
+ "$_pkgname-zquest.desktop"
+ "$_pkgname.sh"
+ "$_pkgname-workaround.sh"
+ "$_pkgname-README.pkg")
+b2sums=('fb8b8f672e277ebd13e59c47064dbc3dcfdcc7fd8d26256258c3177a836dc2cee87d62b99446f13a610e7581bf3b5d716e4e66d944460341a3c770efa64ca811'
+ 'f3514a8f9911c2955955ab4af60e364c6dcafdc727f1da8f73ed3f52501cc6b23fdb98a2c9ba8139b77a984312d99270556d8e68ac4a36913cf48557f0b4ceb9'
+ '11a6698d7905490742538d48e34be7151a69de8050f9431f69e610e41de56876316daa29fb1700599579641a3b013b3d028a3181aad79759fd99e3f3e302480b'
+ 'a4d5f37f869626fb350bf9c7f3ce84ac201b8120ab0c363eccd6588fa7b8a0a310958dcc5db86909527791563751491359a38d80095a02745132770e8f0a9005'
+ 'c991b7c6b85c1288fa1c624f9530ae5a45ca3154f823b5dc91cc3ea136eaeaae00e399076296d4b6789459efba3e2e84e840b229d35538d400e7e11d87e458c8'
+ 'c9e579e7e36ef1bf9e2dab19c11bc3c0da0c427a45f0b8f1db8e11c8d4e2b0897d540506f8727ab6006ee8947d9df0035afcca83a23ac8d0fed437be492943b7'
+ '954eb03b87ae1382a5e609813755823f905341f35636a1eb67c19a8fd498d743f5aa797428efcee27fce29b7eb491495a32280a14b7b2252dfc38c4486b2ac23'
+ '1a3693d094d0c2289ef9c0776c0f5a5ab80c85364b56fa504c416b5f5e063215800fd2d587df5ae0bb43acc7c6bdbbbe97bc34fe91a05075cec1c7e6f02f7162'
+ '3c2c1dc85120a340b29f0288426ed4d86ef06acaa4fd86d141bcc223071f0449858a3320e0d070ab9c860a16ea78cb1a3c3e0fd4ad5fe1642cb013d213d77903'
+ '512926d10029a688e3328fc5a4992da643864f9eddc3944ee7eb708d1461054c84c61139246809a3b4a790cdb65fd62367778284c37552de3565d70e5aeadb4d')
options=('!strip')
package() {
cd "Zelda Classic"
# create folders
- install -d "$pkgdir"/{opt/$pkgname/samplesoundset,usr/{bin,share/doc/$pkgname}}
+ install -d "$pkgdir"/{usr/games,usr/{share/{doc/$_pkgname,games/$_pkgname/samplesoundset},libexec/$_pkgname,lib/$_pkgname}}
# install binaries + libraries
- install -m755 {romview,zelda,zlaunch,zquest}-l "$pkgdir"/opt/$pkgname
- install -m644 *.so "$pkgdir"/opt/$pkgname
+ install -m755 {romview,zelda,zlaunch,zquest}-l "$pkgdir"/usr/libexec/$_pkgname
+ install -m644 *.so "$pkgdir"/usr/lib/$_pkgname
+
+ # Xorg bug workaround
+ mv "$pkgdir"/usr/libexec/$_pkgname/zelda-l "$pkgdir"/usr/libexec/$_pkgname/zelda-l.real
+ install -m755 ../$_pkgname-workaround.sh "$pkgdir"/usr/libexec/$_pkgname/zelda-l
# install data files
- install -m644 samplesoundset/patches.dat "$pkgdir"/opt/$pkgname/samplesoundset
- install -m644 *.{qst,dat,nsf} "$pkgdir"/opt/$pkgname
+ install -m644 samplesoundset/patches.dat "$pkgdir"/usr/share/games/$_pkgname/samplesoundset
+ install -m644 *.{qst,dat,nsf} "$pkgdir"/usr/share/games/$_pkgname
# install doc files
- install -m644 *.{txt,zh} "$pkgdir"/usr/share/doc/$pkgname
+ install -m644 *.{txt,zh} "$pkgdir"/usr/share/doc/$_pkgname
+ install -m644 ../$_pkgname-README.pkg "$pkgdir"/usr/share/doc/$_pkgname/README.pkg
# install launchers
- install -m755 ../$pkgname.sh "$pkgdir"/usr/bin/$pkgname
- ln -s $pkgname "$pkgdir"/usr/bin/$pkgname-zlaunch
- ln -s $pkgname "$pkgdir"/usr/bin/$pkgname-zquest
+ install -m755 ../$_pkgname.sh "$pkgdir"/usr/games/$_pkgname
+ ln -s $_pkgname "$pkgdir"/usr/games/$_pkgname-zlaunch
+ ln -s $_pkgname "$pkgdir"/usr/games/$_pkgname-zquest
# install icon and desktop files
- for i in zelda-classic{,-zlaunch,-zquest}; do
+ for i in $_pkgname{,-zlaunch,-zquest}; do
install -Dm644 ../$i.png "$pkgdir"/usr/share/pixmaps/$i.png
install -Dm644 ../$i.desktop "$pkgdir"/usr/share/applications/$i.desktop
done
# install soundset licence
- install -Dm644 samplesoundset/COPYRIGHT "$pkgdir"/usr/share/licenses/$pkgname/LICENSE-soundset
+ install -Dm644 samplesoundset/COPYRIGHT "$pkgdir"/usr/share/doc/$_pkgname/LICENSE-soundset
}
diff --git a/zelda-classic-README.pkg b/zelda-classic-README.pkg
new file mode 100644
index 0000000..40b4c70
--- /dev/null
+++ b/zelda-classic-README.pkg
@@ -0,0 +1,57 @@
+SHORT GENERAL INSTALL INSTRUCTIONS
+==================================
+
+
+ +---------+
+ |Multiarch|
+ +---------+
+
+
+
+Read this if you want to run zelda-classic, on a different architecture then i386. It will run without emulation on amd64.
+
+For other non-x86 architectures, it's possible with CPU emulation with qemu.
+
+Activate multiarch for i386
+----------------------------
+
+ activate it:
+ sudo dpkg --add-architecture i386
+
+ For Ubuntu you'll need to change your sources in "/etc/apt/sources.list" like so:
+ deb [arch=amd64,i386] http://uk.archive.ubuntu.com/ubuntu/ quantal main universe
+
+ Then update:
+ sudo apt update
+
+If you want to remove multiarch
+-------------------------------
+
+ purge all i386 packages first:
+ sudo apt-get purge ".*:i386"
+
+ deactivate:
+ sudo dpkg --remove-architecture i386
+
+ For Ubuntu remove [arch=amd64,i386] from your sources in "/etc/apt/sources.list"
+
+ update:
+ sudo apt update
+
+More detailed instructions
+--------------------------
+
+ For in dept explanations and qemu emulation on non x86 architectures:
+ https://wiki.debian.org/Multiarch/HOWTO
+
+
+
+
+ +--------------+
+ |Bug workaround|
+ +--------------+
+
+
+There's a serious bug with Xorg making zelda-classic unplayable. As a workaround install the **native** package "xserver-xephyr". It will be used automatically if installed.
+
+Xephyr is a lightweight X server that can run on top of Xorg, that will mask the bug. It's not perfect, toggling fullscreen/windowed mode will not work while the game is running. You'll have to shutdown the game first.
diff --git a/zelda-classic-workaround.sh b/zelda-classic-workaround.sh
new file mode 100755
index 0000000..e80ec38
--- /dev/null
+++ b/zelda-classic-workaround.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Zelda Classic bug workaround - (c) exponential 2022
+
+#SKIP="true"
+#
+SKIP="false"
+
+if [ "$SKIP" = "false" ] && [ -n "$(command -v Xephyr 2>/dev/null)" ]; then
+
+ if echo "$@" | grep -q -- "-fullscreen" 2>/dev/null || echo "$@" | grep -vq -- "-windowed" 2>/dev/null && cat "ag.cfg" | grep "^fullscreen" | tail -n 1 | grep -q "1" 2>/dev/null ; then
+
+ screen="$(xrandr -q | grep '*' | sed 's/^\s*//' | sed 's/\s.*$//')"
+ fullscreen="-fullscreen"
+
+ else
+ if echo "$@" | grep -q "-windowed" 2>/dev/null ; then
+
+ screen="$(echo ""$@"" | sed 's!.*res \([0-9]*\) \([0-9]*\).*!\1x\2!')"
+
+ else
+
+ screenx="$( cat ag.cfg | grep resx | sed 's/resx *= *\([0-9]*\).*/\1/')"
+ screeny="$( cat ag.cfg | grep resy | sed 's/resy *= *\([0-9]*\).*/\1/')"
+ screen="${screenx}x${screeny}"
+ fi
+ fi
+
+ Xephyr -br $fullscreen -reset -terminate -screen "$screen" :10 &
+ DISPLAY=:10 exec /usr/libexec/zelda-classic/zelda-l.real "$@"
+
+else
+
+ exec /usr/libexec/zelda-classic/zelda-l.real "$@"
+
+fi
diff --git a/zelda-classic.install b/zelda-classic.install
deleted file mode 100644
index 476b1ef..0000000
--- a/zelda-classic.install
+++ /dev/null
@@ -1,16 +0,0 @@
-
-post_install() {
- echo " => If you experience problems, check/delete your zelda-classic directory,"
- echo " It is located in \$XDG_CONFIG_HOME, default: '~/.config/zelda-classic'."
-}
-
-post_upgrade() {
- post_install
-
- # the launcher changed in that version
- if [ $(vercmp $2 2.50.2.29-1) -lt 0 ]; then
- echo " => This folder was formerly located at '~/.zelda-classic'. The launcher script"
- echo " tries to migrate settings and data files to the new location, however custom"
- echo " quests are not touched and should be moved manually."
- fi
-}
diff --git a/zelda-classic.sh b/zelda-classic.sh
index 65e1cf6..2cbdc62 100755
--- a/zelda-classic.sh
+++ b/zelda-classic.sh
@@ -1,47 +1,32 @@
-#!/bin/bash
+#!/bin/sh
#
# Zelda Classic launcher - (c) carstene1ns 2013
-#
+# (c) exponential 2022
# Does some magic juggling with the data files
# Changelog:
# * 11-2016: Added XDG support
+# * 2022: refactor
-jail_dir=${XDG_CONFIG_HOME:-$HOME/.config}/zelda-classic
-
-# migrate files from old location
-jail_old=$HOME/.zelda-classic
-
-if [ ! -e $jail_dir ]; then
- mkdir -p $jail_dir
-
- if [ -e $jail_old ]; then
- for f in $jail_old/{*.{qst,dat,nsf,txt},samplesoundset,{zelda,zlaunch,zquest}-l}; do
- [ -L $f ] && rm $f
- done
-
- mv $jail_old/{ag.cfg,allegro.log,zc.{icn,lck,sav}} $jail_dir
- fi
-
-fi
+_name="zelda-classic"
+config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/$_name"
-# symlink files from installation directory
-for f in /opt/zelda-classic/{*.{qst,dat,nsf,so},samplesoundset,z*-l} \
- /usr/share/doc/zelda-classic/zquest.txt; do
- [ ! -e $jail_dir/${f##*/} ] && ln -s $f $jail_dir
-done
+cp -nas "/usr/share/games/$_name/" "${XDG_CONFIG_HOME:-$HOME/.config}"
+cp -nas "/usr/lib/$_name/"*.so "$config_dir"
+cp -nas "/usr/libexec/$_name/"z*-l "$config_dir"
+cp -nas "/usr/share/doc/$_name/zquest.txt" "$config_dir"
# change to directory and launch
-cd $jail_dir
+cd "$config_dir"
case "${0##*/}" in
- zelda-classic)
+ "$_name")
exec ./zelda-l "$@"
;;
- zelda-classic-zlaunch)
+ "$_name-zlaunch")
exec ./zlaunch-l "$@"
;;
- zelda-classic-zquest)
+ "$_name-zquest")
exec ./zquest-l "$@"
;;
*)