Building Flightgear - CentOS: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
m (Under construction)
mNo edit summary
(4 intermediate revisions by the same user not shown)
Line 18: Line 18:
     libXrandr-devel.x86_64 libXinerama-devel.x86_64 zlib-devel.x86_64 expat-devel.x86_64 boost.x86_64 openal-soft-devel.x86_64 cmake.x86_64 \
     libXrandr-devel.x86_64 libXinerama-devel.x86_64 zlib-devel.x86_64 expat-devel.x86_64 boost.x86_64 openal-soft-devel.x86_64 cmake.x86_64 \
     mesa-libEGL-devel.x86_64 jasper-devel.x86_64 gstreamer1-devel.x86_64 SDL2-devel.x86_64 poppler-glib-devel.x86_64 lua-devel.x86_64 fltk-devel.x86_64 boost-devel.x86_64 \
     mesa-libEGL-devel.x86_64 jasper-devel.x86_64 gstreamer1-devel.x86_64 SDL2-devel.x86_64 poppler-glib-devel.x86_64 lua-devel.x86_64 fltk-devel.x86_64 boost-devel.x86_64 \
     dbus-devel.x86_64 libevent-devel.x86_64 glew-devel.x86_64
     dbus-devel.x86_64 libevent-devel.x86_64 glew-devel.x86_64 qt5-qtdeclarative-devel.x86_64 qt5-qtsvg-devel.x86_64 qt5-linguist.x86_64


The <code>plib</code> package is not available for CentOS 8. The package from CentOS 7 can be used instead. After downloading the following packages:
The <code>plib</code> package is not available for CentOS 8. The package from CentOS 7 can be used instead. After downloading the following packages:
Line 31: Line 31:
= Definitions =
= Definitions =
The following environment variables must be set because they will be used in shell commands:
The following environment variables must be set because they will be used in shell commands:
* <code>NR_JOBS</code>: Number of jobs for parallel compilation. For example: <code>NR_JOBS=$(/usr/bin/nproc)</code>
* <code>NR_JOBS</code>: Number of jobs for parallel compilation. For example: <code>NR_JOBS=$(/usr/bin/nproc)</code>.
* <code>FGFS_PREFIX</code>: Prefix of the Flightgear installation. For example: <code>FGFS_PREFIX=${HOME}/Flightgear</code>
* <code>FGFS_PREFIX</code>: Prefix of the Flightgear installation. For example: <code>FGFS_PREFIX=${HOME}/Flightgear</code>. All the source code must be located under the directory <code>${FGFS_PREFIX}/src</code> and the installation will be done under the directory <code>${FGFS_PREFIX}</code> as <code>${FGFS_PREFIX}/bin</code>, <code>${FGFS_PREFIX}/include</code>, <code>${FGFS_PREFIX}/lib</code>,...
* <code>OPENSCENEGRAPH_VERSION</code>: Version of OpenSceneGraph. For example: <code>OPENSCENEGRAPH_VERSION=3.6.4</code>
* <code>OPENSCENEGRAPH_VERSION</code>: Version of OpenSceneGraph. For example: <code>OPENSCENEGRAPH_VERSION=3.6.4</code>.


= OpenSceneGraph =
= OpenSceneGraph =
OpenSceneGraph is not available as a RPM for CentOS 8 and, for this reason, needs to build from sources. The latest stable version of OpenSceneGraph can be downloaded from [http://www.openscenegraph.org/index.php/download-section/stable-releases here].
OpenSceneGraph is not available as a RPM for CentOS 8 and, for this reason, needs to be build from sources. The latest stable version of OpenSceneGraph can be downloaded from [http://www.openscenegraph.org/index.php/download-section/stable-releases here]. The downloaded file must be placed under the directory <code>${FGFS_PREFIX}/src</code> such that the full path of the file will be <code>${FGFS_PREFIX}/src/OpenSceneGraph-OpenSceneGraph-${OPENSCENEGRAPH_VERSION}</code>.


The following commands can be used to build OpenSceneGraph:
The following commands can be used to build OpenSceneGraph:
Line 51: Line 51:
       -DOSG_USE_LOCAL_LUA_SOURCE:BOOL=OFF \
       -DOSG_USE_LOCAL_LUA_SOURCE:BOOL=OFF \
       -DCMAKE_INSTALL_PREFIX="${FGFS_PREFIX}" \
       -DCMAKE_INSTALL_PREFIX="${FGFS_PREFIX}" \
      -DLIB_POSTFIX=64 \
       -DCMAKE_VERBOSE_MAKEFILE=TRUE
       -DCMAKE_VERBOSE_MAKEFILE=TRUE
  make --jobs=${NR_JOBS}
  make --jobs=${NR_JOBS}
Line 59: Line 60:


= Simgear =
= Simgear =
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/"
  cd -- "${FGFS_PREFIX}/src/"
Line 75: Line 99:


= Flightgear =
= 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/"
  cd -- "${FGFS_PREFIX}/src/"
Line 89: Line 136:
  popd
  popd
  rm -Rf -- "${FGFS_PREFIX}/src/fg_build/"
  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}/lib/"
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 =
cd -- "${FGFS_PREFIX}"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${FGFS_PREFIX}/lib64
./bin/fgfs
[[Category:Building from source]]
88

edits

Navigation menu