From 7e26d650bc02ca2301928b7dccd0a6aca433bf23 Mon Sep 17 00:00:00 2001 From: Automatic Release Builder Date: Thu, 19 Nov 2020 21:22:45 +0000 Subject: [PATCH] AppImage: default to launch, fix osgDB plugin loading When no arguments are pased to the AppImage, start with the launcher for a pleasant experience. Adjust the RPath on our copied osgDB plugins, so that dependencies are found at the bundled lib dir. --- build_appimage.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/build_appimage.sh b/build_appimage.sh index 5fe224f..c2742e8 100755 --- a/build_appimage.sh +++ b/build_appimage.sh @@ -45,6 +45,11 @@ cp -d dist/lib64/* appdir/usr/lib cp -d dist/lib/* appdir/usr/lib cp -a dist/lib/osgPlugins-3.6.5 appdir/usr/lib +# adjust the rpath on the copied plugins, so they don't +# require LD_LIBRARY_PATH to be set to load their dependencies +# correctly +patchelf --set-rpath \$ORIGIN/../ appdir/usr/lib/osgPlugins-3.6.5/*.so + cp -r dist/share appdir/usr # FIXME : only copy the QML plugins we actually need @@ -68,11 +73,16 @@ sed -i 's/^Categor.*/&;/ ; s/^Keyword.*/&;/ ; s/1\.1/1\.0/' appdir/usr/share/app cat << 'EOF' > appdir/AppRun #!/bin/bash HERE="$(dirname "$(readlink -f "${0}")")" + export SIMGEAR_TLS_CERT_PATH=$HERE/usr/ssl/cacert.pem -echo SIMGEAR_TLS_CERT_PATH=$SIMGEAR_TLS_CERT_PATH -export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HERE}/usr/lib -echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH -exec "${HERE}/usr/bin/fgfs" "$@" +export OSG_LIBRARY_PATH=${HERE}/usr/lib + +if [[ $# -eq 0 ]]; then + echo "Started with no arguments; assuming --launcher" + exec "${HERE}/usr/bin/fgfs" --launcher +else + exec "${HERE}/usr/bin/fgfs" "$@" +fi EOF