Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : Compiling DROD:AE CVS (A script)
New Topic New Poll Post Reply
Poster Message
Thunor
Level: Goblin
Rank Points: 19
Registered: 05-05-2011
IP: Logged
icon Compiling DROD:AE CVS (+4)  
I made a shell script to build drod-ae on *nix. I've tested it on Puppy Linux (user is root) but I'll test it later tonight on Xubuntu with sudo. It expects SDL+SDL_ttf with development headers to have already been installed, but if you're the type to compile your own games then I expect you'll have these anyway.

Ouch! Well I attempted to post the code but it uses wget and includes URLs and I can't post links until I have 12 rank points!

[EDIT] Now fixed below.


[Last edited by Thunor at 05-05-2011 07:15 PM]
05-05-2011 at 06:15 PM
View Profile Send Private Message to User Visit Homepage Show all user's posts Quote Reply
west.logan
Level: Smitemaster
Avatar
Rank Points: 608
Registered: 03-09-2011
IP: Logged
icon Re: Compiling DROD:AE CVS (+1)  
There :)

It's a worthy cause.

____________________________
-Logan
05-05-2011 at 06:46 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Thunor
Level: Goblin
Rank Points: 19
Registered: 05-05-2011
IP: Logged

File: drod-ae-build.sh (5.1 KB)
Downloaded 69 times.
License: Public Domain
icon Re: Compiling DROD:AE CVS (+2)  
west.logan wrote:
There :)

It's a worthy cause.
Thank you kind sir :)

I've just tested the script on Xubuntu 10.10 which uses sudo and it works as expected.

#!/bin/bash

#------------------------------------------------------------------------------
# DROD: Architect's Edition 1.6 CVS build script v1 (c) Thunor 2011 GNU GPL v3
# 
# This script will download DROD: Architect's Edition 1.6 from CVS, metakit
# 2.4.9.7 and fmod 3.75 and compile and install them on *nix.
#
# Everything is downloaded to and built within $HOME/Source/drod-ae.
# metakit is installed to /usr/lib and /usr/include.
# fmod is installed to /usr/lib and /usr/include/fmod.
# drod-ae is installed to $HOME/Games/drod-ae.
#
# If the above destinations don't suit you then modify the variables directly
# below this header.
#
# Also, installing into the system requires superuser privileges, but I don't
# know if you're using su or sudo, so set-up USE_SU and USE_SUDO below.
#------------------------------------------------------------------------------

# These few variables are user-configurable.
DROD_SRC="$HOME/Source/drod-ae"
METAKIT_PREFIX=/usr
FMOD_PREFIX=/usr
DROD_DEST='$(HOME)/Games/drod-ae'
# Comment out the one that you don't use.
USE_SU=su
#USE_SUDO=sudo

# If the user is already root then ignore USE_SU and USE_SUDO.
if [ $USER = root ]; then USE_SU=; USE_SUDO=; fi

#------------------------------------------------------------------------------
# Create the build folder, download and check for the necessary files.
#------------------------------------------------------------------------------
mkdir -p "$DROD_SRC"
cd "$DROD_SRC"
wget -nc -c http://equi4.com/pub/mk/metakit-2.4.9.7.tar.gz
wget -nc -c http://www.fmod.org/files/fmod3/fmodapi375linux.tar.gz
wget -nc -c http://drod.cvs.sourceforge.net/viewvc/drod/?view=tar -O drod-ae.tar.gz
wget -nc -c "http://gcc.gnu.org/cgi-bin/cvsweb.cgi/~checkout~/gcc/libstdc++-v3/include/ext/pod_char_traits.h?rev=1.4&content-type=text/plain" -O pod_char_traits.h

if [ ! -e metakit-2.4.9.7.tar.gz ]; then echo "ERROR: metakit-2.4.9.7.tar.gz not found"; exit; fi
if [ ! -e fmodapi375linux.tar.gz ]; then echo "ERROR: fmodapi375linux.tar.gz not found"; exit; fi
if [ ! -e drod-ae.tar.gz ]; then echo "ERROR: drod-ae.tar.gz not found"; exit; fi
if [ ! -e pod_char_traits.h ]; then echo "ERROR: pod_char_traits.h not found"; exit; fi

#------------------------------------------------------------------------------
# Compile and install metakit-2.4.9.7.
#------------------------------------------------------------------------------
cd "$DROD_SRC"
tar xzvf metakit-2.4.9.7.tar.gz
cd metakit-2.4.9.7/builds
../unix/configure --prefix=$METAKIT_PREFIX
make
echo "*** You may be required to type your superuser password here: ***"; 
if [ -n "$USE_SU" ]; then su; fi
$USE_SUDO make install
if [ -n "$USE_SU" ]; then exit; fi

#------------------------------------------------------------------------------
# Compile and install fmodapi375linux.
#------------------------------------------------------------------------------
cd "$DROD_SRC"
tar xzvf fmodapi375linux.tar.gz
cd fmodapi375linux/api
echo "*** You may be required to type your superuser password here: ***"; 
if [ -n "$USE_SU" ]; then su; fi
$USE_SUDO cp libfmod-3.75.so $FMOD_PREFIX/lib/
$USE_SUDO mkdir $FMOD_PREFIX/include/fmod
$USE_SUDO cp inc/* $FMOD_PREFIX/include/fmod
$USE_SUDO ldconfig
if [ -n "$USE_SU" ]; then exit; fi

#------------------------------------------------------------------------------
# Extract and fix drod-ae's source files.
#------------------------------------------------------------------------------
cd "$DROD_SRC"
tar xzvf drod-ae.tar.gz
mkdir drod/Caravel/ext
cp pod_char_traits.h drod/Caravel/ext/
sed -i 's/#include <string>/#include <cstring>/' drod/Caravel/ext/pod_char_traits.h
sed -i 's/#  include <fcntl.h>/#  include <fcntl.h>\n#  include <cstdlib>\n#  include <limits.h>/' drod/Caravel/BackEndLib/Files.cpp
sed -i 's/#  include <ctype.h>/#  include <ctype.h>\n#  include <cstdio>/' drod/Caravel/BackEndLib/IniFile.cpp
sed -i 's/#include \"Wchar.h\"/#include <cstdlib>\n#include <cstdio>\n#include \"Wchar.h\"/' drod/Caravel/BackEndLib/Wchar.cpp
sed -i 's/^#include <fmod.h>/#include <fmod\/fmod.h>/' drod/Caravel/FrontEndLib/Sound.h
sed -i 's|const int X_OK |//const int X_OK |' drod/Caravel/FrontEndLib/Screen.cpp

#------------------------------------------------------------------------------
# Tweak the Config file, compile and install drod-ae.
#------------------------------------------------------------------------------
cd "$DROD_SRC"
sed -i 's/INSTALL_TYPE = local/INSTALL_TYPE = one/' drod/Caravel/Master/Linux/Config
sed -i "s|prefix  = opt/games/drod|prefix = $DROD_DEST|" drod/Caravel/Master/Linux/Config
sed -i 's/LIBRARY_FMOD=fmod-3.74.1/LIBRARY_FMOD=fmod-3.75/' drod/Caravel/Master/Linux/Config
sed -i 's/INST_DAT_DIRS  = -m 0775 -g games/INST_DAT_DIRS  = -m 0775/' drod/Caravel/Master/Linux/Config
sed -i 's/INST_DAT_FILES = -m 0664 -g games/INST_DAT_FILES = -m 0664/' drod/Caravel/Master/Linux/Config
cd drod/Caravel/Master/Linux
make drod-custom
make install

#------------------------------------------------------------------------------
# Tidy-up from any previous installation so that the correct data path is set.
#------------------------------------------------------------------------------
rm ~/.caravel/drod-1_6/DataPath.txt


I've noticed that the code above is being rendered with an extra semi-colon after the last double-quote on the wget pod_char_traits.h line (I've just diffed it), so if you're going to use it then I recommend you download the attachment.



[Last edited by Thunor at 05-05-2011 10:48 PM]
05-05-2011 at 07:14 PM
View Profile Send Private Message to User Visit Homepage Show all user's posts Quote Reply
Thunor
Level: Goblin
Rank Points: 19
Registered: 05-05-2011
IP: Logged
icon Re: Compiling DROD:AE CVS (+3)  
Update

Seventeen months later and this script now fails because fmod have removed fmodapi375linux.tar.gz from their website, but I have found it in three other locations:

ftp.tiscali.nl/pub/mirror/gentoo/distfiles/fmodapi375linux.tar.gz
ftp.fi.debian.org/gentoo/distfiles/fmodapi375linux.tar.gz
ftp.is.co.za/mirror/ftp.gentoo.org/distfiles/fmodapi375linux.tar.gz


So, for the above script to work you'll need to modify "wget -nc -c http://www.fmod.org/files/fmod3/fmodapi375linux.tar.gz" to include one of the working URLs.

I've recently installed another Linux distro and I've just run the script and it works :)

Regards,
Thunor



10-21-2012 at 01:11 PM
View Profile Send Private Message to User Visit Homepage Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : Compiling DROD:AE CVS (A script)
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.