The build process installed the SDL2 framework at
Frameworks/SDL2.Framework
but in MacOS 12.6 this seems to matter because the correct name
that is stored in the QGroundControl binary is
Frameworks/SDL2.framework
This patch stores the SDL2 framework at the correct place that
fits to the location stored in the binary.
Thanks to krl91 who figured out the problem.
Closes: #10435
* qgroundcontrol.pro: use gold linker if available (on linux)
Speeds up linking by ~4s on my machine.
* linux-fixup-rpaths.bash: use timestamp file to avoid unnecessary re-evaluation
Speeds up incremental builds, this step takes ~17s.
```
Post Link Common
/bin/sh: 1: /home/runner/work/qgroundcontrol/qgroundcontrol/deploy/linux-fixup-rpaths.bash: not found
make: *** [staging/QGroundControl] Error 127
Makefile:2944: recipe for target 'staging/QGroundControl' failed
Error: Process completed with exit code 2.
```
- script is clean according to shellcheck.net
- added the script to the QGCPostLinkCommon
- added patchelf to the Dockerfile and the github workflows for Linux
* For https://github.com/mavlink/qgroundcontrol/pull/9947
this solves libairmap and most of the qt libraries. but note some defects still exist:
```
$ ./QGroundControl
QML debugging is enabled. Only use this in a safe environment.
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
```
The above error is solved with `QT_PLUGIN_PATH=./Qt/plugins`.
After that, the below error message shows up:
```
$ ./QGroundControl
QML debugging is enabled. Only use this in a safe environment.
./QGroundControl: symbol lookup error: /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5: undefined symbol: _ZN22QWindowSystemInterface24setPlatformFiltersEventsEb, version Qt_5_PRIVATE_API
```
Setting `LD_LIBRARY_PATH=./Qt/libs` appears to solve that one.
It looks like some of the Qt libraries need to be configured? I spent a half hour looking at that and didn't find a quick/easy solution.
* QT_PLUGIN_PATH might be solved with `QCoreApplication::addLibraryPath()` set to `QCoreApplication::applicationDirPath() / "Qt/libs"`, but I'm not 100% sure if it needs to be platform specific.
* I'm not sure which library is trying to poke at `libQt5XcbQpa` or how to solve that at runtime.
Both of the environment variables can be avoided by using `qt.conf` in the same directory:
```
$ cat <<EOF | tee qt.conf
[Paths]
Prefix=./
Libraryes=Qt/libs
Plugins=Qt/plugins
EOF
$ ./QGroundControl
QML debugging is enabled. Only use this in a safe environment.
./QGroundControl: symbol lookup error: /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5: undefined symbol: _ZN22QWindowSystemInterface24setPlatformFiltersEventsEb, version Qt_5_PRIVATE_API
```
which reaches us to the same undefined symbol error pointing to a system-installed Qt-5 library...
A little bit of a rabbit hole suggests that `patchelf` can solve our problem:
```
$ ldd ./Qt/plugins/platforms/libqxcb.so | grep -i libQt
./Qt/plugins/platforms/libqxcb.so: /lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found (required by ./Qt/plugins/platforms/libqxcb.so)
libQt5XcbQpa.so.5 => /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5 (0x00007f8c6ad23000)
libQt5Gui.so.5 => /lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007f8c6a616000)
libQt5DBus.so.5 => /lib/x86_64-linux-gnu/libQt5DBus.so.5 (0x00007f8c6a57a000)
libQt5Core.so.5 => /lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f8c6a02f000)
$ patchelf --set-rpath \$ORIGIN/../../libs ./Qt/plugins/platforms/libqxcb.so
$ ldd staging/Qt/plugins/platforms/libqxcb.so | grep -i libQt
libQt5XcbQpa.so.5 => /home/kbennett/src/public/qgroundcontrol/build/build-qgroundcontrol-Desktop_Qt_5_15_2_GCC_64bit-Debug/staging/Qt/plugins/platforms/../../libs/libQt5XcbQpa.so.5 (0x00007fceceef1000)
libQt5Gui.so.5 => /home/kbennett/src/public/qgroundcontrol/build/build-qgroundcontrol-Desktop_Qt_5_15_2_GCC_64bit-Debug/staging/Qt/plugins/platforms/../../libs/libQt5Gui.so.5 (0x00007fcece479000)
libQt5DBus.so.5 => /home/kbennett/src/public/qgroundcontrol/build/build-qgroundcontrol-Desktop_Qt_5_15_2_GCC_64bit-Debug/staging/Qt/plugins/platforms/../../libs/libQt5DBus.so.5 (0x00007fcece1eb000)
libQt5Core.so.5 => /home/kbennett/src/public/qgroundcontrol/build/build-qgroundcontrol-Desktop_Qt_5_15_2_GCC_64bit-Debug/staging/Qt/plugins/platforms/../../libs/libQt5Core.so.5 (0x00007fcecd9f5000)
```
However, `patchelf` is not available on all systems...
The general goal is to tidy up the project folder and give better focus on other contents of the project.
As a first iteration, I would like to tidy up files, which are Windows related. Technically seen I'm pretty sure that we won't notice any differences, since some libraries and images have been moved and some config files cleaned up.
Signed-off-by: Thomas Karl Pietrowski <thopiekar@gmail.com>
* fixes and updates to header files and libs to support AirMap's services on linux. Also includes updates to the platform-sdk functionality backing AirMap functionality in QGC
* udpated telemetry host; made username in pilot struct optional
* updates to airmap libraries
Co-authored-by: jennerl <jenner@airmap.com>