diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 115 |
1 files changed, 76 insertions, 39 deletions
@@ -3,14 +3,14 @@ pkgname=doomrl-git pkgver=r8.0cbac80 doomrl_assets='doomrl-linux-assets-x64-0997' -pkgrel=8 +pkgrel=10 pkgdesc="Doom: The Rogue-like (git-latest) (WIP!)." arch=(any) url="http://drl.chaosforge.org/" license=('GPL3') -depends=('sdl_mixer' 'zlib' 'lua' 'timidity++' 'sdl_image') +depends=('sdl_mixer' 'zlib' 'lua51' 'timidity++' 'sdl_image') makedepends=('git' 'fpc-svn' 'lua') -source=("$pkgname::git+https://github.com/ChaosForge/doomrl" +source=("${pkgname}::git+https://github.com/ChaosForge/doomrl" "fpcvalkyrie::git+https://github.com/ChaosForge/fpcvalkyrie" "http://www.libregeek.org/Linux/game-files/doomrl/${doomrl_assets}.tar" 'disable-asmcse-opt.patch' @@ -26,7 +26,7 @@ sha256sums=('SKIP' '439de08ce548b0dc7ff6ba31ace7f375a1e6f0ebac32addf8a05d3d31283e192' 'e57148577e3152c99a61adb7ae841272491b7be62b168b8d62ee73b322b37418' '8b7be4a787422722da65b3c184178f221d5ec76e60f11fda371aa27c9808ea9d' - 'SKIP' + '1bd87b0e8707ed7c41ad4f3b409515e5ac66aa9f14127cef584a68c7644615bc' ) prepare() @@ -35,15 +35,15 @@ prepare() msg2 "Cleaning files" # clean - find "$srcdir/$pkgname" "$srcdir/fpcvalkyrie" \ + find "${srcdir}/${pkgname}" "${srcdir}/fpcvalkyrie" \ '(' -iname '*.o' -or -iname '*.ppu' ')' -exec rm -f '{}' ';' # assets - cp -ru "$srcdir/$doomrl_assets/mp3"/* "$srcdir/$pkgname/bin/mp3" - cp -ru "$srcdir/$doomrl_assets/wavhq"/* "$srcdir/$pkgname/bin/wavhq" + cp -ru "${srcdir}/$doomrl_assets/mp3"/* "${srcdir}/${pkgname}/bin/mp3" + cp -ru "${srcdir}/$doomrl_assets/wavhq"/* "${srcdir}/${pkgname}/bin/wavhq" # symlinks - rm -f "$srcdir/$pkgname/bin/liblua5.1.so" + rm -f "${srcdir}/${pkgname}/bin/lua5.1.so" msg2 "Patching" @@ -57,22 +57,22 @@ prepare() } pkgver() { - cd "$pkgname" + cd "${pkgname}" printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } build() { - cd $srcdir/$pkgname + cd ${srcdir}/${pkgname} rm -rf tmp && mkdir tmp # add Linux config msg2 "Compiling doomrl" - echo "OS=\"LINUX\"" > "$srcdir/$pkgname/config.lua" - echo "VALKYRIE_ROOT=\"$srcdir/fpcvalkyrie/\"" >> "$srcdir/$pkgname/config.lua" + echo "OS=\"LINUX\"" > "${srcdir}/${pkgname}/config.lua" + echo "VALKYRIE_ROOT=\"${srcdir}/fpcvalkyrie/\"" >> "${srcdir}/${pkgname}/config.lua" - # lua makefile can be called to do thr build + # lua makefile can be called to do the build # but it seems to miss building makewad # use lazbuild instead # lua makefile.lua hq @@ -82,25 +82,38 @@ build() # Generate wad msg2 "Generating wad file(s)" - cd "$srcdir/$pkgname/bin" - # makewad doesn't properly search for the lua lialb - ln -s "/usr/lib/liblua5.1.so" "liblua5.1.so" + cd "${srcdir}/${pkgname}/bin" + + # makewad doesn't properly search for the lua lib, include our lib path + # link and provide the path + ln -s "/usr/lib/liblua5.1.so" "lua5.1.so" + LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./makewad } package() { - # check for doomrl executable first + msg2 "Installing doomrl files" + + # check for doomrl and wads # Even if compile fails, it often will just continue on # Doesn't seem to exit fully - if [[ ! -f "$srcdir/$pkgname/bin/doomrl" ]]; then - echo "ERROR: Cannot find built binary. Exiting build." - exit 1 + file_check="doomrl core.wad doomrl.wad" + + for file in ${file_check}; + do + + if [[ ! -f "${srcdir}/${pkgname}/bin/${file}" ]]; then - fi + echo "ERROR: Cannot find core file ${file}. Exiting build." + exit 1 - cd "$srcdir/$pkgname" + fi + + done + + cd "${srcdir}/${pkgname}" ##################### # Directories @@ -110,7 +123,7 @@ package() { # Modules should not include original source content, just readme install -d "$pkgdir/usr/share/games/doomrl/modules" - DIRS="mp3 wavhq screenshot backup mortem" + DIRS="backup mp3 wavhq screenshot backup mortem" for dir in $DIRS; do @@ -124,30 +137,54 @@ package() { # Shouldn't need the extra scripts, but include them anyway - FILES="doomrl.wad - bin/doomrl - bin/manual.txt - bin/version.txt - bin/unix_notes.txt - bin/config.lua - bin/colors.lua - bin/keybindings.lua - bin/sound.lua - bin/music.lua - bin/musichq.lua - bin/doomrl_gnome-terminal - bin/doomrl_konsole - bin/doomrl_xterm - bin/modules/!readme.txt" + FILES="core.wad + doomrl.wad + doomrl + manual.txt + version.txt + version_api.txt + unix_notes.txt + config.lua + colors.lua + keybindings.lua + sound.lua + manual.txt + music.lua + musichq.lua + doomrl_gnome-terminal + doomrl_konsole + doomrl_xterm + modules/!readme.txt" for file in $FILES; do - install -m755 "${file}" "$pkgdir/usr/share/games/doomrl/$(basename ${file})" + install -m755 "bin/${file}" "$pkgdir/usr/share/games/doomrl/$(basename ${file})" done # launcher install -Dm755 "$startdir/doomrl-launch" "$pkgdir/usr/bin/doomrl" + msg2 "Fixing permissions" + + # doomrl must have write access to several files + # Use a workaround, makeing the group owner games and + # only modifying files we need to + chown -R root:games "$pkgdir/usr/share/games/doomrl" + chmod -R g+w "$pkgdir/usr/share/games/doomrl" + + ############# + # libs + ############# + + msg "Fixing up libs" + + # doomrl expects the lib to be "lua5.1.so", not our liblua5.1.so + # Need to use a hack (until otherwise fixed) to trick doomrl to find it + # copy in the existing symlink in the $srcdir/$pkgname/bin dir, preserving + # the symlink path + + cp -P "bin/lua5.1.so" "$pkgdir/usr/share/games/doomrl" + } |