Howto:Build and run FlightGear on Raspberry Pi 4: Difference between revisions

Jump to navigation Jump to search
Line 329: Line 329:
There could come a time when the source needs to be patched before compiling. In this case the <code>patch</code> command can be used along with it's argument <code>-p</code>. For example; the OpenSceneGraph-3.4.0 requires the '0007-Explicit-signed-char-type-for-portability-base64.patch' patch, in order for it to compile for the ARM architecture.
There could come a time when the source needs to be patched before compiling. In this case the <code>patch</code> command can be used along with it's argument <code>-p</code>. For example; the OpenSceneGraph-3.4.0 requires the '0007-Explicit-signed-char-type-for-portability-base64.patch' patch, in order for it to compile for the ARM architecture.


The argument ,<code>-p</code> adjusts the path of the patch. Below is an example of a snippet from a patch. You will need to navigate the terminal into the root folder of OpenSceneGraph-3.4.0 source. Reference the line ,<code>--- openscenegraph-3.4.orig/src/osgDB/ConvertBase64.cpp</code>. The folder <code>openscenegraph-3.4.orig/</code> can not be used, in our example. In this case, one of the path folders need to be ignored, hence <code>-p1</code>. If two path folders needed to be ignored; <code>-p2</code>.
In this example, the patch can be found at this link: [https://sources.debian.org/patches/openscenegraph-3.4/3.4.1+dfsg1-5/ OpenSceneGraph-3-4-0 patch]. The <code>download</code> link for '0007-Explicit-signed-char-type-for-portability-base64.patch' is what we are looking for. This file can be downloaded with the <code>wget</code> command as seen below:
 
<syntaxhighlight>wget --trust-server-names https://sources.debian.org/src/openscenegraph-3.4/3.4.1+dfsg1-5/src/osgPlugins/osgjs/Base64.cpp/</syntaxhighlight>
 
Place, the above patch file, into the the root folder of OpenSceneGraph-3-4-0.
 
The argument ,<code>-p</code> adjusts the path of the patch. Below is an example of a snippet from a patch. Reference the line ,<code>--- openscenegraph-3.4.orig/src/osgDB/ConvertBase64.cpp</code>. The folder <code>openscenegraph-3.4.orig/</code> can not be used, in our example. In this case, one of the path folders need to be ignored, hence <code>-p1</code>. If two path folders needed to be ignored; <code>-p2</code>.


<syntaxhighlight>Index: openscenegraph-3.4/src/osgDB/ConvertBase64.cpp
<syntaxhighlight>Index: openscenegraph-3.4/src/osgDB/ConvertBase64.cpp
Line 344: Line 350:
         value_in -= 43;
         value_in -= 43;
         if (value_in < 0 || value_in > decoding_size) return -1;</syntaxhighlight>
         if (value_in < 0 || value_in > decoding_size) return -1;</syntaxhighlight>
Navigate the terminal into the root folder of OpenSceneGraph-3.4.0 source. Side note: the <code>patch</code> command might need to be installed. Now enter the below command into the terminal:
<syntaxhighlight>patch -p1 <0007-Explicit-signed-char-type-for-portability-base64.patch</syntaxhighlight>


===PLIB===
===PLIB===
320

edits

Navigation menu