Building Flightgear - CentOS: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
Line 57: Line 57:
  rm -Rf -- "${FGFS_PREFIX}/src/OpenSceneGraph_build/"
  rm -Rf -- "${FGFS_PREFIX}/src/OpenSceneGraph_build/"


= Simgear =
= [[Building FlightGear - Linux#Compiling | Compiling]] =
The source code of Simgear can be provided:
* as an official release that can be downloaded from [https://sourceforge.net/projects/flightgear/files/ here]. The environment variable <code>SIMGEAR_VERSION</code> must be set to the relevant version of Simgear, for example <code>SIMGEAR_VERSION=2019.1.1</code> and then using the following commands to extract the source code:
 
cd -- "${FGFS_PREFIX}/src/"
SIMGEAR_SRC=${FGFS_PREFIX}/src/simgear-${SIMGEAR_VERSION}
rm -Rf -- "${SIMGEAR_SRC}/"
tar axvf "${FGFS_PREFIX}/src/simgear-${SIMGEAR_VERSION}.tar.bz2"
 
* as a clone of the Simgear Git repo by using the following commands:
 
cd -- "${FGFS_PREFIX}/src/"
git clone https://git.code.sf.net/p/flightgear/simgear flightgear-simgear
SIMGEAR_SRC=${FGFS_PREFIX}/src/flightgear-simgear
 
* if you have already a clone of the Simgear Git repo, the local copy can be updated using the following commands:
 
cd -- "${FGFS_PREFIX}/src/"
SIMGEAR_SRC=${FGFS_PREFIX}/src/flightgear-simgear
pushd -- "${SIMGEAR_SRC}/"
git pull
popd
 
Now that the source code of Simgear is available under the directory <code>${SIMGEAR_SRC}</code>, the build can be started using the following commands:
 
cd -- "${FGFS_PREFIX}/src/"
rm -Rf -- "${FGFS_PREFIX}/src/sg_build/"
mkdir -- "${FGFS_PREFIX}/src/sg_build/"
pushd -- "${FGFS_PREFIX}/src/sg_build/"
cmake "${SIMGEAR_SRC}" \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo \
      -DCMAKE_INSTALL_PREFIX="${FGFS_PREFIX}" \
      -DCMAKE_VERBOSE_MAKEFILE=TRUE
make --jobs=${NR_JOBS}
make -- test
make -- install
popd
rm -Rf -- "${FGFS_PREFIX}/src/sg_build/"
 
= Flightgear =
The source code of Flightgear can be provided:
* as an official release that can be downloaded from [https://sourceforge.net/projects/flightgear/files/ here]. The version of Simgear and Flightgear must match. The environment variable <code>FLIGHTGEAR_VERSION</code> must be set to the relevant version of Flightgear, for example <code>FLIGHTGEAR_VERSION=2019.1.1</code> and then using the following commands to extract the source code:
 
cd -- "${FGFS_PREFIX}/src/"
FLIGHTGEAR_SRC=${FGFS_PREFIX}/src/flightgear-${FLIGHTGEAR_VERSION}
rm -Rf -- "${FLIGHTGEAR_SRC}/"
tar axvf "${FGFS_PREFIX}/src/flightgear-${FLIGHTGEAR_VERSION}.tar.bz2"
 
* as a clone of the Flightgear Git repo by using the following commands:
 
cd -- "${FGFS_PREFIX}/src/"
git clone https://git.code.sf.net/p/flightgear/flightgear flightgear-flightgear
FLIGHTGEAR_SRC=${FGFS_PREFIX}/src/flightgear-flightgear
 
* if you have already a clone of the Flightgear Git repo, the local copy can be updated using the following commands:
 
cd -- "${FGFS_PREFIX}/src/"
FLIGHTGEAR_SRC=${FGFS_PREFIX}/src/flightgear-flightgear
pushd -- "${FLIGHTGEAR_SRC}/"
git pull
popd
 
Now that the source code of Flightgear is available under the directory <code>${FLIGHTGEAR_SRC}</code>, the build can be started using the following commands:
 
cd -- "${FGFS_PREFIX}/src/"
rm -Rf -- "${FGFS_PREFIX}/src/fg_build/"
mkdir -- "${FGFS_PREFIX}/src/fg_build/"
pushd -- "${FGFS_PREFIX}/src/fg_build/"
cmake "${FLIGHTGEAR_SRC}" \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo \
      -DCMAKE_INSTALL_PREFIX="${FGFS_PREFIX}" \
      -DCMAKE_VERBOSE_MAKEFILE=TRUE
make --jobs=${NR_JOBS}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${FGFS_PREFIX}/lib64/
FG_ROOT=${FGFS_PREFIX}/lib64/Flightgear make --jobs=${NR_JOBS} -- test_suite || true
make -- test
make -- install
popd
rm -Rf -- "${FGFS_PREFIX}/src/fg_build/"
 
The data for Flightgear can be provided:
* as an official release that can be downloaded from [https://sourceforge.net/projects/flightgear/files/ here].
rm -f -- "${FGFS_PREFIX}/lib/FlightGear"
rm -Rf -- "${FGFS_PREFIX}/lib/FlightGear-${FLIGHTGEAR_VERSION}/"
mkdir --parents -- "${FGFS_PREFIX}/lib/FlightGear-${FLIGHTGEAR_VERSION}/"
pushd -- "${FGFS_PREFIX}/lib/FlightGear-${FLIGHTGEAR_VERSION}/"
tar axvf "${FGFS_PREFIX}/src/FlightGear-${FLIGHTGEAR_VERSION}-data.tar.bz2"
popd
pushd -- "${FGFS_PREFIX}/lib64/"
ln --symbolic -- "FlightGear-${FLIGHTGEAR_VERSION}/fgdata/" FlightGear
popd
 
* as a clone of the Flightgear Git repo by using the following commands:
 
pushd -- "${FGFS_PREFIX}/lib64/"
git clone --depth 1 https://git.code.sf.net/p/flightgear/fgdata flightgear-fgdata
ln --symbolic -- "flightgear-fgdata/" FlightGear
popd
 
* if you have already a clone of the Flightgear Git repo, the local copy can be updated using the following commands:
 
pushd -- "${FGFS_PREFIX}/lib64/flightgear-fgdata/"
git pull
popd


= Start Flightgear =
= Start Flightgear =
88

edits

Navigation menu