Chaosforge Forum

  • September 28, 2021, 08:32
  • Welcome, Guest
Please login or register.



Login with username, password and session length

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Grolm

Pages: [1]
1
DiabloRL / Howto Play DiabloRL with sounds on Linux
« on: July 06, 2013, 05:39 »
Hi,

As said in this topic : http://forum.chaosforge.org/index.php/topic,6528.0.html

I made a script to install DiabloRL from sources on Linux, with some small patches to support sounds from DIABDAT.MPQ.

Tested with rev 770 of fpcvalkyrie and 1178 of diablorl on xubuntu 13.04 64 bits.

Code: [Select]
#!/bin/bash

# diablorl (http://diablo.chaosforge.org/) linux setup from sources with
# DIABDAT.MPQ sound support
#
# http://forum.chaosforge.org/index.php/topic,6528
# tested with ubuntu 13.04 64bits

# Please install the following packages before
#
# build-essential fpc libsdl1.2-dev libsdl1.2-dbg lua 5.1 liblua5.1-0-dev
# subversion p7zip-full wget sed
#
# ubuntu:
# sudo apt-get install -y build-essential fpc libsdl1.2-dev libsdl1.2-dbg lua 5.1 liblua5.1-0-dev subversion p7zip-full wget sed

DRL_DIR=$1
MPQ_PATH=$2

if [ $# -ne 2 ]; then
    echo $0 DRL_INSTALL_DIR PATH_TO_DIABDAT.MPQ
    exit 1
fi

if [ ! -f "${MPQ_PATH}" ]; then
    echo "MPQ not found : $2"
    exit 2
fi

cd $(dirname "${MPQ_PATH}")
MPQ_PATH="$PWD/$(basename "${MPQ_PATH}")"
cd - &>/dev/null

mkdir -p "${DRL_DIR}" || exit 3
cd "${DRL_DIR}" || exit 4
DRL_DIR="$PWD"

# downloads (tested with rev 770 of fpcvalkyrie and 1178 of diablorl)
svn checkout -r 770 http://svn.code.sf.net/p/fpcvalkyrie/code/trunk fpcvalkyrie
svn checkout -r 1178 http://svn.code.sf.net/p/diablorl/code/trunk diablorl
wget http://www.zezula.net/download/stormlib.zip
7z x stormlib.zip

# Build StormLib
cd "${DRL_DIR}"/StormLib
make -f Makefile.linux
cp libStorm.so "${DRL_DIR}"/diablorl/bin/lib
cd "${DRL_DIR}"/diablorl/bin/lib
ln -s libStorm.so StormLib.so


# patch fpcvalkyrie
cd "${DRL_DIR}"/fpcvalkyrie/src
sed -i~  -e 's/\(^[[:space:]]*\)\(FPrev.FNext := FNext;\)/\1if FPrev <> nil then \2/' \
         -e 's/\(^[[:space:]]*\)\(FNext.FPrev := FPrev;\)/\1if FNext <> nil then \2/' vnode.pas

# patch diablorl
cd "${DRL_DIR}"/diablorl/src
sed -i~ -e 's/\(raise EStreamError.CreateFmt.*;\)/{\1}/' rlui.pas

# compile
cd "${DRL_DIR}"/diablorl/src
FPCDIR=/usr/lib/fpc/2.6.0/ fpcmake
make COMPILER_UNITDIR=../../fpcvalkyrie/libs/ FPCOPT="-k-lm" DEBUG=1


# config and run
cd "${DRL_DIR}"/diablorl/bin
./mpq
cp -vf "${MPQ_PATH}" DIABDAT.MPQ
sed -i~ -e 's/sound     = "NONE"/sound     = "SDL"/' \
        -e 's/mpq       = ""/mpq       = "DIABDAT.MPQ"/' config.lua

# create a runner script
cat <<EOF > /tmp/diablorl
#!/bin/sh
cd "${DRL_DIR}/diablorl/bin"
export LD_LIBRARY_PATH="${DRL_DIR}/diablorl/bin/lib"
./rl
EOF
sudo mv /tmp/diablorl /usr/local/bin/diablorl
sudo chmod 755 /usr/local/bin/diablorl

echo Run and Have Fun with: /usr/local/bin/diablorl


Paste this code into diablorl-setup.sh with your favorite text editor and run

bash diablorl-setup.sh your_install_path your_path_to_DIABDAT.MPQ




Pages: [1]