CentOS

From FlightGear wiki
Jump to: navigation, search

With a little bit of tweaking the download_and_compile.sh from GIT can be made to do the heavy-lifting for compiling FlightGear on CentOS.

Update A patched version of download_and_compile.sh script that can build on CentOS 6 can be found here:

https://github.com/nickva/flightgear-centos


At the very least, you can use this list of packages to get the available dependancies right ( tested on Centos 6.3 ):

yum install freealut-
devel openal-soft-devel freealut-devel fltk-devel cvs git subversion cmake make automake zlib-devel \
wxGTK-devel fltk-fluid gawk gettext libXi-devel libXmu-devel boost-devel alsa-lib-devel libpng-devel \
jasper-devel OpenEXR-libs OpenEXR-devel boost-serialization boost-devel git-core hal-devel qt4-devel \
scons pygtk2-devel python-imaging-tk subversion-devel glew-devel libcurl-devel curl libxml2-devel librsvg2-devel gtkglext-devel

download_and_compile.sh mods

I am currently tweaking the download_and_compile.sh* to work on CentOS 6.3.

So far, it seems to be working with the below changes, but I'm only up to the prt where it's building OSG.... so I'll send another email later with the final result.

( I got the script from here: http://wiki.flightgear.org/Scripted_Compilation_on_Linux_Debian/Ubuntu#Download , which points to here: http://www.gitorious.org/fg/fgmeta/blobs/raw/master/download_and_compile.sh )

The key changes are:

  • define these line/s near the start:
# on CentOS, installing the -devel version also installs the primary package too!
CENTOS_PACKAGES="freealut-devel openal-soft-devel freealut-devel fltk-devel cvs git subversion cmake make automake zlib-devel wxGTK-devel fltk-fluid gawk gettext libXi-devel libXmu-devel boost-devel alsa-lib-devel libpng-devel jasper-devel OpenEXR-libs OpenEXR-devel boost-serialization boost-devel git-core hal-devel qt4-devel scons pygtk2-devel python-imaging-tk subversion-devel glew-devel libcurl-devel curl libxml2-devel librsvg2-devel gtkglext-devel "
  • adding support for detecting a CentOS-like OS:
if [  -e /etc/redhat-release ]
then
        DISTRIB_ID=CentOS
        echo REDHAT, hopefully: $DISTRIB_ID
fi
  • adding to the DOWNLOAD_PACKAGES if-else block support for CentOS way of things:
        if [ "$DISTRIB_ID" = "CentOS" ]
        then
                echo "Asking your password to perform a yum install ... "
                 sudo yum install $CENTOS_PACKAGES
  • I also found a bug in PLIB , at the very end ( 4 lines from the bottom) of plib/src/ssg/ssg.h there is a
#elif  

statement without any truth statement attached, so I changed it to a simple

#else