```
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...