Scripted Compilation on Linux Debian/Ubuntu: Difference between revisions

Streamline general introduction and add an Introduction section as recommended by the wiki's Manual of Style
(→‎Update Available: Update outdatedness advisory)
(Streamline general introduction and add an Introduction section as recommended by the wiki's Manual of Style)
Line 1: Line 1:
<tt>download_and_compile.sh</tt> is a [https://www.gnu.org/software/bash/ Bash] script that takes care of downloading and compiling FlightGear from the Git repositories with just one command execution<ref name="just-one-command">Due to technical problems on the [https://sourceforge.net/ SourceForge] side, this is currently only true once you have an [[FGData]] clone. See [[User:Rominet|here]] for details.</ref> for both 32-bit and 64-bit [https://www.debian.org/ Debian]-based systems (Debian, [https://www.ubuntu.com/ Ubuntu], [https://devuan.org/ Devuan], [https://www.linuxmint.com/ Linux Mint], etc.). Pre-existing installed versions (if any) of FlightGear are not touched at all since the script downloads, builds and installs everything under the directory in which it is launched. You can choose between building all or only specific tools and applications. For RedHat-based systems such as Fedora and CentOS, you may want to check out [[CentOS]].
<tt>download_and_compile.sh</tt> is a Bash script that takes care of downloading and compiling FlightGear and related software from their source code repositories with just one command execution<ref name="just-one-command">Due to technical problems on the [https://sourceforge.net/ SourceForge] side, this is currently only true once you have an [[FGData]] clone. See [[User:Rominet|here]] for details.</ref> for both 32-bit and 64-bit [https://www.debian.org/ Debian]-based systems. Pre-existing versions (if any) of the software installed by <tt>download_and_compile.sh</tt> are not touched at all since the script downloads, builds and installs everything under the directory in which it is launched. You can choose the particular components to download, build and install.


By default, <tt>download_and_compile.sh</tt> installs most dependencies with <tt>apt-get</tt> run under <tt>sudo</tt>.<ref name="note-on-changing-how-packages-are-installed">This can be changed with options <code>--package-manager</code> and <code>--sudo</code>, or completely turned off with option <code>-pn</code> (see the output of <code>download_and_compile.sh --help</code> for the list of available options).</ref> Other dependencies, either because they aren't available in the standard APT repositories, or because it was explicitly requested using the non-option arguments of <tt>download_and_compile.sh</tt>, are downloaded and compiled on the fly (this can be the case for [[PLIB]], [[Simgear]] and [[OpenSceneGraph]], for instance—depending on the arguments passed to <tt>download_and_compile.sh</tt>).
Unless told not to do so, <tt>download_and_compile.sh</tt> installs packages with <tt>apt-get</tt>. For this reason, it is primarily useful on Debian-based distributions. However, if one disables package installation (using <code>-pn</code> or <code>--sudo=echo</code>) and installs the corresponding dependencies oneself, it might be useful on other distributions as well.


For hints on using a RPM-based distribution like CentOS, please see [[CentOS]].
For hints on using <tt>rpm</tt>-based distributions such as Redhat, Fedora and CentOS, please see [[CentOS]]. Please also see [[Superbuild]].


Please also see [[Superbuild]].
=== Introduction ===
 
<tt>download_and_compile.sh</tt> is a [https://www.gnu.org/software/bash/ Bash] script written for [https://www.debian.org/ Debian]-derived distributions ([https://www.ubuntu.com/ Ubuntu], [https://devuan.org/ Devuan], [https://www.linuxmint.com/ Linux Mint], etc.). Its purpose is to automatically install dependencies using the package manager, then build and install FlightGear-related programs.
 
By default, <tt>download_and_compile.sh</tt> installs most dependencies with <tt>apt-get</tt> run under <tt>sudo</tt>.<ref name="disabling-installation-of-dependencies-via-package-manager">If you think you already have the dependencies, this installation can be disabled either by using option <code>-pn</code> or by passing option <code>--sudo=echo</code> (the latter results in printing the <tt>apt-get</tt> command line without running it).</ref> Other dependencies, either because they aren't available in the standard APT repositories, or because of non-option arguments passed to <tt>download_and_compile.sh</tt>, are downloaded and compiled on the fly (this can be the case for [[PLIB]], [[Simgear]] and [[OpenSceneGraph]], for instance—it all depends on the arguments passed to the script).
 
<tt>download_and_compile.sh</tt> works in the directory it is run from: apart from dependencies installed via the package manager, all programs built by <tt>download_and_compile.sh</tt> are installed under the <tt>install</tt> subdirectory of the directory from which the script was run. In other words, installation of programs by <tt>download_and_compile.sh</tt> is clean, very easy to undo and doesn't interfere with other programs on the system.
 
It is possible to manage several directory trees with <tt>download_and_compile.sh</tt>; as far as it is concerned, such directory trees are completely independent from each other. For instance, if you run <tt>download_and_compile.sh</tt> in <tt>dir1</tt> and <tt>dir2</tt>, the programs installed under <tt>dir1</tt> won't “see” those installed under <tt>dir2</tt>, and vice versa.
 
Apart from its main purpose, <tt>download_and_compile.sh</tt> can be used to find hopefully up-to-date build-dependency information for FlightGear and related software. You would do so by inspecting [https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/download_and_compile.sh the script] at the point where it installs packages.<ref name="note-inspecting-download-and-compile-sh-to-gather-build-dependency-information">Look for strings such as <tt>zlib1g-dev</tt>, <tt>libglew-dev</tt> or <tt>qt5-default</tt>.</ref>


=== Update Available ===
=== Update Available ===
377

edits