diff options
author | Carsten Teibes | 2014-06-04 10:47:43 +0200 |
---|---|---|
committer | Carsten Teibes | 2014-06-04 10:47:43 +0200 |
commit | f68662e8abfc4519aa8f62136eb5d33982abb240 (patch) | |
tree | 3bcbc81737fa52315cf7abf0e1beca0802466d15 | |
download | aur-f68662e8abfc4519aa8f62136eb5d33982abb240.tar.gz |
[add] lab3d-sdl 3.0
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | PKGBUILD | 41 | ||||
-rw-r--r-- | lab3d-sdl-datadir.patch | 117 | ||||
-rw-r--r-- | lab3d-sdl.sh | 13 |
4 files changed, 190 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..5fa40e30dfc0 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = lab3d-sdl + pkgdesc = Enhanced port of Ken's Labyrinth with hi-res texture support + pkgver = 3.0 + pkgrel = 1 + url = http://www.jspenguin.org/software/lab3d_sdl/ + arch = i686 + arch = x86_64 + license = GPL + depends = sdl2_image + depends = glu + source = http://s3.jspenguin.org/LAB3D-SDL-3.0-src.tar.gz + source = lab3d-sdl-datadir.patch + source = lab3d-sdl.sh + sha256sums = 9b358dc75054e34c19e442a6af389415b1a2ae06780a1e6b11364467f40a5daf + sha256sums = 03de7ab26787eb64af0e20d00effe79efd924e6395923f58c797a3f725550f88 + sha256sums = bf15793b64711138c0eb23591b93d82df7fb41aed8bceb0d90c8b2a705d0ff73 + +pkgname = lab3d-sdl + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b00cdcd4bd4a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,41 @@ +# Maintainer: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG + +pkgname=lab3d-sdl +pkgver=3.0 +pkgrel=1 +pkgdesc="Enhanced port of Ken's Labyrinth with hi-res texture support" +arch=('i686' 'x86_64') +url="http://www.jspenguin.org/software/lab3d_sdl/" +license=('GPL') +depends=('sdl2_image' 'glu') +source=("http://s3.jspenguin.org/LAB3D-SDL-3.0-src.tar.gz" + "$pkgname-datadir.patch" + "$pkgname.sh") +sha256sums=('9b358dc75054e34c19e442a6af389415b1a2ae06780a1e6b11364467f40a5daf' + '03de7ab26787eb64af0e20d00effe79efd924e6395923f58c797a3f725550f88' + 'bf15793b64711138c0eb23591b93d82df7fb41aed8bceb0d90c8b2a705d0ff73') + +prepare() { + # patch to change data directory + patch -Np0 < $pkgname-datadir.patch + sed 's|hires/|/usr/share/lab3d-sdl/&|' -i LAB3D-SDL-3.0/wallparams.ini +} + +build() { + make -C LAB3D-SDL-3.0 +} + +package() { + cd LAB3D-SDL-3.0 + + # binary + launcher + install -Dm755 ../$pkgname.sh "$pkgdir"/usr/bin/$pkgname + install -Dm755 ken.bin "$pkgdir"/usr/lib/$pkgname/ken.bin + # data + install -d "$pkgdir"/usr/share/$pkgname/hires + install -m644 *.kzp {insts,tables}.dat wallparams.ini ken.bmp "$pkgdir"/usr/share/$pkgname + install -m644 hires/* "$pkgdir"/usr/share/$pkgname/hires + # docs + install -d "$pkgdir"/usr/share/doc/$pkgname + install -m644 *.doc *.txt "$pkgdir"/usr/share/doc/$pkgname +} diff --git a/lab3d-sdl-datadir.patch b/lab3d-sdl-datadir.patch new file mode 100644 index 000000000000..3fc1072c9f9d --- /dev/null +++ b/lab3d-sdl-datadir.patch @@ -0,0 +1,117 @@ +diff -Naur LAB3D-SDL-3.0.old/init.c LAB3D-SDL-3.0/init.c +--- LAB3D-SDL-3.0.old/init.c 2014-01-03 18:08:52.000000000 +0100 ++++ LAB3D-SDL-3.0/init.c 2014-06-04 10:17:18.478710352 +0200 +@@ -49,7 +49,7 @@ + + fprintf(stderr,"Activating video...\n"); + +- icon = SDL_LoadBMP("ken.bmp"); ++ icon = SDL_LoadBMP("/usr/share/lab3d-sdl/ken.bmp"); + if (icon == NULL) { + fprintf(stderr,"Warning: ken.bmp (icon file) not found.\n"); + } +@@ -190,7 +190,7 @@ + + if (speechstatus >= 2) + { +- if (((i = open("sounds.kzp",O_BINARY|O_RDONLY,0)) != -1)|| ++ if (((i = open("/usr/share/lab3d-sdl/sounds.kzp",O_BINARY|O_RDONLY,0)) != -1)|| + ((i = open("SOUNDS.KZP",O_BINARY|O_RDONLY,0)) != -1)) { + fstat(i, &fstats); + sndsize = (int)(fstats.st_size); +@@ -206,7 +206,7 @@ + fatal_error("Insufficient memory for sound."); + } + +- file=fopen("sounds.kzp","rb"); ++ file=fopen("/usr/share/lab3d-sdl/sounds.kzp","rb"); + if (file==NULL) { + file=fopen("SOUNDS.KZP","rb"); + } +@@ -487,7 +487,7 @@ + exit(1); + } + } else { +- if (((i = open("boards.kzp",O_RDONLY|O_BINARY,0)) != -1)|| ++ if (((i = open("/usr/share/lab3d-sdl/boards.kzp",O_RDONLY|O_BINARY,0)) != -1)|| + ((i = open("BOARDS.KZP",O_RDONLY|O_BINARY,0)) != -1)) { + readLE16(i,&boleng[0],30*4); + numboards = 30; +diff -Naur LAB3D-SDL-3.0.old/oldlab3d.c LAB3D-SDL-3.0/oldlab3d.c +--- LAB3D-SDL-3.0.old/oldlab3d.c 2014-01-03 18:08:52.000000000 +0100 ++++ LAB3D-SDL-3.0/oldlab3d.c 2014-06-04 09:51:10.911984452 +0200 +@@ -2927,7 +2927,7 @@ + int fil, i, k, textbufcnt, textypos; + + ototclock = totalclock; +- if ((fil = open("story.kzp",O_BINARY|O_RDONLY,S_IREAD)) == -1) ++ if ((fil = open("/usr/share/lab3d-sdl/story.kzp",O_BINARY|O_RDONLY,S_IREAD)) == -1) + if ((fil = open("STORY.KZP",O_BINARY|O_RDONLY,S_IREAD)) == -1) + return(-1); + read(fil,&storyoffs[0],256); +diff -Naur LAB3D-SDL-3.0.old/subs.c LAB3D-SDL-3.0/subs.c +--- LAB3D-SDL-3.0.old/subs.c 2014-01-03 18:08:52.000000000 +0100 ++++ LAB3D-SDL-3.0/subs.c 2014-06-04 09:52:19.618653715 +0200 +@@ -332,7 +332,7 @@ + exit(1); + } + } else { +- if (((fil = open("boards.kzp", O_RDONLY|O_BINARY, 0)) != -1)|| ++ if (((fil = open("/usr/share/lab3d-sdl/boards.kzp", O_RDONLY|O_BINARY, 0)) != -1)|| + ((fil = open("BOARDS.KZP", O_RDONLY|O_BINARY, 0)) != -1)) + { + prepdie = 0; +@@ -625,7 +625,7 @@ + { + K_INT16 fil; + +- if (((fil = open("tables.dat", O_RDONLY|O_BINARY, 0)) != -1)|| ++ if (((fil = open("/usr/share/lab3d-sdl/tables.dat", O_RDONLY|O_BINARY, 0)) != -1)|| + ((fil = open("TABLES.DAT", O_RDONLY|O_BINARY, 0)) != -1)) + { + readLE32(fil, &sintable[0], 8192); +@@ -1499,7 +1499,7 @@ + + } + +- if (((fil = open("walls.kzp", O_RDONLY|O_BINARY, 0)) != -1)|| ++ if (((fil = open("/usr/share/lab3d-sdl/walls.kzp", O_RDONLY|O_BINARY, 0)) != -1)|| + ((fil = open("WALLS.KZP", O_RDONLY|O_BINARY, 0)) != -1)) + { + bmpkind[0] = 0; +@@ -2761,7 +2761,7 @@ + } + if (musicsource == 2) + { +- if(((infile=open("insts.dat", O_RDONLY|O_BINARY, 0))==-1)&& ++ if(((infile=open("/usr/share/lab3d-sdl/insts.dat", O_RDONLY|O_BINARY, 0))==-1)&& + ((infile=open("INSTS.DAT", O_RDONLY|O_BINARY, 0))==-1)) + return(-1); + for(i=0;i<256;i++) +@@ -2780,7 +2780,7 @@ + firstime = 0; + } + } +- if (((infile=open("songs.kzp", O_RDONLY|O_BINARY, 0))==-1)&& ++ if (((infile=open("/usr/share/lab3d-sdl/songs.kzp", O_RDONLY|O_BINARY, 0))==-1)&& + ((infile=open("SONGS.KZP", O_RDONLY|O_BINARY, 0))==-1)) + return(-1); + readLE16(infile, &numfiles, 2); +@@ -3839,7 +3839,7 @@ + return(-1); + } + } else { +- if (((fil = open("lab3d.kzp", O_RDONLY|O_BINARY, 0)) == -1)&& ++ if (((fil = open("/usr/share/lab3d-sdl/lab3d.kzp", O_RDONLY|O_BINARY, 0)) == -1)&& + ((fil = open("LAB3D.KZP", O_RDONLY|O_BINARY, 0)) == -1)) + return(-1); + } +@@ -4427,7 +4427,7 @@ + K_INT16 fil, i, textbufcnt, textypos; + + ototclock = totalclock; +- if (((fil = open("story.kzp", O_RDONLY|O_BINARY, 0)) == -1)&& ++ if (((fil = open("/usr/share/lab3d-sdl/story.kzp", O_RDONLY|O_BINARY, 0)) == -1)&& + ((fil = open("STORY.KZP", O_RDONLY|O_BINARY, 0)) == -1)) + return(-1); + readLE16(fil, &storyoffs[0], 256); diff --git a/lab3d-sdl.sh b/lab3d-sdl.sh new file mode 100644 index 000000000000..bd755ded10bc --- /dev/null +++ b/lab3d-sdl.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +echo "lab3d-sdl 3.0 launcher" + +mkdir -p ~/.lab3d-sdl + +# hires texture config +if [ ! -f ~/.lab3d-sdl/wallparams.ini ]; then + cp /usr/share/lab3d-sdl/wallparams.ini ~/.lab3d-sdl +fi + +# run the game +cd ~/.lab3d-sdl && exec /usr/lib/lab3d-sdl/ken.bin "$@" |