Board index FlightGear Development New features

Fedora linux bash script to build from git

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

Fedora linux bash script to build from git

Postby xyz32 » Mon May 16, 2011 3:47 pm

Hello,
I don't know if this is the right place for this thread so fell free to move it.
I have made two bash scripts that will automatically build the latest binaries for FG in fedora.

To use them simply make a folder in your home directory or somewhere where you have full privileges, cd into that folder and create two .sh files containing the code below:
systemSetup.sh
Code: Select all
#!/bin/bash

su root yum install --skip-broken\
  git cmake cmake-gui\
  libpng-devel\
  freetype-devel\
  libjpeg-turbo-devel\
  giflib-devel giflib-utils\
  libtiff-devel\
  libXmu-devel\
  libXi-devel\
  libglut3-devel\
  freealut-devel\
  boost-devel\
  automake autoconf\
  fltk-devel\
  openal-soft\
  openal-soft-devel\
  plib-devel\
  OpenSceneGraph\
  OpenSceneGraph-devel\
  OpenThreads\
  OpenThreads-devel

git clone git://gitorious.org/fg/simgear.git

git clone git://gitorious.org/fg/flightgear.git


and the build-fg.sh file:
Code: Select all
#!/bin/bash

#script path
scriptLocation=$PWD/${0##*/}
# to get the path only - not the script name - add
path_only=`dirname "$scriptLocation"`

tmp="/tmp"

if [$1]; then
jobs=$1
else
jobs=""
fi

#start with simgear
cd simgear
make clean

echo "running git pull"
#git reset --hard HEAD
git pull
echo ""

echo "Running ./autogen.sh"
./autogen.sh
echo ""

echo "Running ./configure --prefix=${path_only}${tmp}/simgear"
./configure --prefix=${path_only}${tmp}/simgear
echo ""

echo "Running make ${jobs}"
make ${jobs}
echo ""

echo "Running make install"
make install
echo ""

echo "Cleanup"
make clean
echo ""

cd ..


cd flightgear
make clean

echo "running git pull"
#git reset --hard HEAD
git pull
echo ""

echo "Running ./autogen.sh"
./autogen.sh
echo ""

echo "Running ./configure --prefix=${path_only}/bin/flightgear --with-simgear=${path_only}${tmp}/simgear"
./configure --prefix=${path_only}/bin/flightgear --with-simgear=${path_only}${tmp}/simgear
echo ""

echo "Running make ${jobs}"
make ${jobs}
echo ""

echo "Running make install"
make install
echo ""

echo "Cleanup"
make clean
echo ""

cd ..

echo "tmp cleanup"
rm -rf ${path_only}${tmp}
echo "done"


How To Use:
1) systemSetup.sh will need to be run as root, and only once as it sets up your system with all the dependencies and tools needed:
$> systemSetup.sh

I think there are a few packages that are distributed using rpmfusion so make sure you have it set up first.

2) build-fg.sh is the one that you will use to build FG and to update it.
This script does not need root level access:
$> build-fg.sh

the script will put all the binaries in one folder /[wherever I am]/bin/flightgear. You can copy the flightgear folder and use it as is. I use this app as a luncher and point it to whatever it needs.

3)You will need to get the latest data folder separately (about 3.5G) from its own repository:
$> git clone git://gitorious.org/fg/fgdata.git

or from:

$> git clone git://mapserver.flightgear.org/fgdata

BUGS:
I believe the script builds the binaries, by default, with the debug strings in them therefore the end result is a fgfs file of ~120M, and right now I haven't figured out how to switch to release mode yet.

Hope this helps, And because fedora is LSB compatible I believe this script may also work on other RPM based distributions.

Thanks.
xyz32
 
Posts: 20
Joined: Mon Jan 11, 2010 2:43 am

Return to New features

Who is online

Users browsing this forum: No registered users and 1 guest