Fedora Packages and Compiling: Difference between revisions

Jump to navigation Jump to search
Add a section on download_and_compile.sh
(More heading cleanup)
(Add a section on download_and_compile.sh)
Line 89: Line 89:


==== Building 2024.1 ====
==== Building 2024.1 ====
Once the code is loaded we can build. The general technique is to make a separate empty build directory, use cmake to configure and then compile and link. This avoids cluttering up the source directories with build files. Also, you can have several different configurations with the same source: fgbuild-release, fgbuild-debug, fgbuild-test, etc.
Once the code is loaded we can build. Editing and re-building can proceed without need to re-fetch the source. Using a ''git pull'' command can be use in each repository to keep up to date.
 
The general technique is to make a separate empty build directory, use cmake to configure and then compile and link. This avoids cluttering up the source directories with build files. Also, you can have several different configurations with the same source: fgbuild-release, fgbuild-debug, fgbuild-test, etc.
  mkdir fgbuild
  mkdir fgbuild
  mkdir sgbuild
  mkdir sgbuild
Line 116: Line 118:
  cd $HOME/fg2024.2
  cd $HOME/fg2024.2


==== Use the git repository ====
====Use the git repository ====
  git clone https://gitlab.com/flightgear/openscenegraph.git openscenegraph
  git clone https://gitlab.com/flightgear/openscenegraph.git openscenegraph
  git clone https://gitlab.com/flightgear/simgear.git simgear
  git clone https://gitlab.com/flightgear/simgear.git simgear
Line 122: Line 124:
  git clone https://gitlab.com/flightgear/fgdata.git fgdata
  git clone https://gitlab.com/flightgear/fgdata.git fgdata


==== Building 2024.2 ====
====Building 2024.2====
  mkdir osgbuild
  mkdir osgbuild
  mkdir fgbuild
  mkdir fgbuild
Line 143: Line 145:
  export PATH $HOME/fg2024.2/install/bin:$PATH
  export PATH $HOME/fg2024.2/install/bin:$PATH


===Various tools===
The examples above use low level tools such as tar and make to build the system. Higher level tools can also be used depending on user preference.
====cmake====
''cmake --build'' can be used in place of ''make''. The effect and level of effort are similar. If the developer is familiar with cmake and wishes to use the level of command there is no problem replacing make with cmake for this development.
====Download_and_compile.sh====
As mentioned above, the download_and_compile.sh command is used by developers on apt-based Linux systems to automate parts of the development process.
The single script merges all aspects of the devlelopment given above. In particular, the script has lists of system package dependencies that are automatically checked, loaded, or updated as needed. However this behaviour is closely linked to details of the ''apt'' command suite. Users on ''dnf''-based systems such as Fedora, or redhat cannot use this.
If desired, the script can be used for parts of the development process on Fedora by omitting the system-package checks performed by ''apt''. For example, the script uses git to automatically pull updates for the various parts of Flightgear from the repositories.
To use, load the system packages listed above with ''dnf'' and then do something like this:
mkdir $HOME/fg2024
cd $HOME/fg2024
git clone [https://gitlab.com/flightgear/fgdata.git https://gitlab.com/flightgear/fgmeta.git] fgmeta
fgmeta/download_and_compile.sh -p n FGFS
The ''-p n'' arg tells the script to NOT use ''apt'' to check, update, or fetch packages. Once the required packages are loaded from the Fedora repositories normal dnf upgrade commands will update the needed packages along with the rest of your system.
A detailed help message is available with
fgmeta/download_and_compile.sh --help
With no additional arguments as in the example above, the script will build 2024.2/next. To build 2024.1:
fgmeta/download_and_compile.sh -s -p -n FGFS
Use of the download_and_compile.sh script has pros and cons.
If one is developing on both Fedora and other apt-based systems such as Ubuntu or Raspberry Pi, then using a common tool suite may be an advantage.
On the other hand, the script builds a somewhat complex directory structure and may do additional work not needed at various steps in you particular process. If you prefer a fully automated single tool, then the script may be desirable for you. If you prefer lower-level finer grained control of the process, using the separate commands my be preferred.
[[Category:Building from source]]
[[Category:Building from source]]
50

edits

Navigation menu