Ubuntu scenery tools

From FlightGear wiki
Jump to navigation Jump to search
This article or section contains out-of-date information

Please help improve this article by updating it. There may be additional information on the talk page.

The following script allows you to install either Taxidraw and FlightGear Scenery Designer in a single directory of an Ubuntu distro taking care of all dependencies.

Necessary packages are installed via the apt-get system, libraries not included in the repositories are downloaded and compiled on the fly.

Note that you may have problems with later versions of Ubuntu, and will on 64 bit systems.

FG tools can be very difficult to install because of version dependencies.

It appears that since this script was written fgsd has been changed causing dependency failures. You will as at 2008/09/27 have to find plib 1.8.5 from the website and compile it yourself rather than use the script or the Ubuntu repository under Hardy Heron (Ubuntu 8.04).

FLU, a prerequisite widget toolkit, is badly written and fails to compile on 64 bit systems. The code can be fixed (a Google search should find you the changes you need to make) but this is probably pointless as you will later find, after downloading, installing, and compiling several other prerequisites from source that the current fgsd source itself (which you will need to compile) will not itself compile (as at 2008/09/27) on 64 bit systems.

Before you as a user should even think of installing fgsd on a 64 bit Linux system, the developers should either replace the FLU widget set or make available a version fixed for 64 bit, and they should test and correct their own code on a 64 bit environment.

If time has elapsed since the date quoted here, you want to try things out, and there have been no comments added, I would suggest you leave experimentation until you have a few hours to spare.

(Hint to developers; pointers are not necessarily ints on all systems; on 64 bit systems they probably will not be. I'm a Java programmer and I don't know C++, but even I know that.)

Download

You can download the script here: File:Download and compile-fgsd.sh

Instructions

to run it, just save it in a directory called for example: ~/fg_tools then execute it (No need to be execute it as root).

Programs execution

Eventually you will get both taxidraw and fgfs in the folders:

~/fg_tools/install/TaxiDraw
~/fg_tools/install/fgsd

to use them just run the generated scripts:

sh ~/fg_tools/run_taxi.sh
or
sh ~/fg_tools/run_scenery.sh

The Script

#!/bin/bash
#* Written by Francesco Angelo Brisa, started January 2008.
#
# Copyright (C) 2008 Francesco Angelo Brisa - http://brisa.homelinux.net
# email: francesco@brisa.homelinux.net   -   fbrisa@yahoo.it
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.



#COMPILE CVS FGFS


#sudo apt-get install libglut3-dev libopenal-dev libalut-dev plib1.8.4-dev libalut0 libopenal0a libfltk1.1-dev libfltk1.1 cvs subversion cmake make build-essential automake zlib1g-dev zlib1g libwxgtk2.8-0 libwxgtk2.8-dev fluid gawk gettext libjpeg62-dev libjpeg62 libwxbase2.6-dev libwxgtk2.6-0 libwxgtk2.6-dev libwxgtk2.6-0 libwxbase2.6-dev libwxbase2.6-0 libcurl4-openssl-dev


sudo apt-get install libglut3-dev libopenal-dev libalut-dev plib1.8.4-dev libalut0 libopenal0a libfltk1.1-dev libfltk1.1 cvs subversion cmake make build-essential automake zlib1g-dev zlib1g libjpeg62-dev libjpeg62 gawk libcurl4-openssl-dev curl libpng12-dev libpng12-0 libzzip-dev libzzip-0-13 libshp-dev libshp1 libgif4 libgif-dev libcgal-dev libcgal2 libwxbase2.6-dev libwxgtk2.6-0 libwxgtk2.6-dev libwxgtk2.6-0 libwxbase2.6-dev libwxbase2.6-0 libwxgtk2.8-dev libwxgtk2.8-0 libwxbase2.8-dev libwxbase2.8-0

COMPILE_BASE_DIR=.


#######################################################

#cd into compile base directory
cd "$COMPILE_BASE_DIR"

#get absolute pathlibwxgtk2.8-dev
CBD=$(pwd)
if [ ! -d install ]
then
	mkdir install
fi

INSTALL_DIR=$CBD/install


#######################################################
# OpenSceneGraph
#######################################################
INSTALL_DIR_OSG=$INSTALL_DIR/OpenSceneGraph

cd "$CBD"

svn co http://svn.openscenegraph.org/osg/OpenSceneGraph/tags/OpenSceneGraph-2.2.0 OpenSceneGraph
#svn checkout http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk OpenSceneGraph
cd OpenSceneGraph
cmake -D CMAKE_BUILD_TYPE="Release" -D CMAKE_CXX_FLAGS="-O3" -D CMAKE_C_FLAGS="-O3" -D CMAKE_INSTALL_PREFIX:PATH="$INSTALL_DIR_OSG" .
make

if [ ! -d $INSTALL_DIR_OSG ]
then
	mkdir -p "$INSTALL_DIR_OSG"
fi

make install
cd -

#######################################################
# SIMGEAR
#######################################################
INSTALL_DIR_SIMGEAR=$INSTALL_DIR/simgear
cd "$CBD"

if [ ! -d "simgear" ]
then
	mkdir "simgear"
fi
cd simgear


cvs -d :pserver:cvsguest:guest@cvs.simgear.org:/var/cvs/SimGear-0.3 login
cvs -d :pserver:cvsguest@cvs.simgear.org:/var/cvs/SimGear-0.3 co source
cd -

cd "simgear/source"
./autogen.sh
./configure --prefix="$INSTALL_DIR_SIMGEAR" --exec-prefix="$INSTALL_DIR_SIMGEAR" --with-osg="$INSTALL_DIR_OSG" --with-jpeg-factory
make
make install
cd -

#######################################################
# FGSD
#######################################################
INSTALL_DIR_FLU=$INSTALL_DIR/FLU
INSTALL_DIR_FGSD=$INSTALL_DIR/fgsd
cd "$CBD"

# GETTING FLU
wget -c http://www.osc.edu/~jbryan/FLU/FLU_2.14.tar.gz
tar zxvf FLU_2.14.tar.gz
cd FLU_2.14/
# FIXING gcc problem
cat FLU/Flu_Tree_Browser.h | sed s/"bool Flu_Tree_Browser ::"/bool/ > FLU/Flu_Tree_Browser.h-ok
mv FLU/Flu_Tree_Browser.h-ok FLU/Flu_Tree_Browser.h

./configure --L=/usr/lib --I=/usr/include --disable-examples --prefix=$INSTALL_DIR_FLU
make
make install
cd ..



svn co http://fgsd.svn.sourceforge.net/svnroot/fgsd fgsd
cd fgsd/trunk/fgsd


./autogen.sh
./configure --prefix=$INSTALL_DIR_FGSD --exec-prefix=$INSTALL_DIR_FGSD --with-simgear="$INSTALL_DIR_SIMGEAR" --with-fltk="$INSTALL_DIR_FLU" CXXFLAGS="$CXXFLAGS -I$CBD/OpenSceneGraph/include"
make
make install

cd -



echo "#!/bin/sh" > run_scenery.sh
echo "cd $INSTALL_DIR_FGSD/bin" >> run_scenery.sh
echo "export LD_LIBRARY_PATH=$INSTALL_DIR_OSG/lib:$INSTALL_DIR_SIMGEAR/lib:$INSTALL_DIR_FLU/lib" >> run_scenery.sh
echo "./fgsd" >> run_scenery.sh
chmod 755 run_scenery.sh










#######################################################
# TAXIDRAW
#######################################################
INSTALL_DIR_TAXI=$INSTALL_DIR/TaxiDraw
cd "$CBD"

cvs -d :pserver:anonymous:guest@taxidraw.cvs.sourceforge.net:/cvsroot/taxidraw login
cvs -z3 -d :pserver:anonymous@taxidraw.cvs.sourceforge.net:/cvsroot/taxidraw co TaxiDraw

cd TaxiDraw

./autogen.sh
./configure --prefix=$INSTALL_DIR_TAXI --exec-prefix=$INSTALL_DIR_TAXI --with-wx-config=/usr/lib/wx/config/gtk2-unicode-release-2.8
make
make install
cd -

echo "#!/bin/sh" > run_taxi.sh
echo "cd $INSTALL_DIR_TAXI/bin && ./taxidraw" >> run_taxi.sh
chmod 755 run_taxi.sh





echo "To start Scenery Designer, run the run_scenery.sh file"
echo "To start TaxiDraw, run the run_taxi.sh file"