#!/bin/bash # Main AppImage internal startup script. # Wrap XDG_* variables properly for Qt. # # SPDX-FileCopyrightText: 2015-2026 by Gilles Caulier # # SPDX-License-Identifier: BSD-3-Clause # # Function to preload a shared library in memory before to start application. preload_shared_library () { FILENAME=$1 for dir in /usr/lib64 /usr/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu ; do fullpath=$dir/$FILENAME # Check with ld.so if the library can be loaded # We need also to check if the library exists, otherwise ld.so will print: # ERROR: ld.so: object from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. # but exit with 0. # See also bug 492040 # echo -n "$fullpath " # Uncomment for debugging if [ -f "$fullpath" ] && ld.so --preload "$fullpath" /bin/true >/dev/null 2>&1 ; then echo "Preloading $fullpath" export LD_PRELOAD="$LD_PRELOAD:$fullpath" return 0 fi done echo "Preloading skipped for $FILENAME" return 1 } ### echo "-- digiKam Linux AppImage Bundle" echo "-- Use 'help' as CLI argument to know all available options for digiKam application." echo "-- Notes: to integrate this bundle to your desktop, use AppImageLauncher." echo "-- to enable all debug messages on the console, use 'export QT_LOGGING_RULES=\"digikam*=true\"'." echo "-- to extract the bundle contents locally, use option '--appimage-extract' on the command line." if [[ "$(uname -m)" != "x86_64" ]] ; then echo "!!! You trying to run a 64 bits binary on a 32 bits system. Aborted !!!" exit -1; fi # Show host OS name and version. OS_NAME=$(awk -F'=' '$1 ~ /^DISTRIB_ID/ {print $2}' /etc/*-release | tr -d '"') OS_ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/') OS_VERSION=$(awk -F'=' '$1 ~ /^DISTRIB_RELEASE/ {print $2}' /etc/*-release | tr -d '"') if [ -z "${OS_NAME}" ] ; then OS_NAME=$(awk -F'=' '$1 ~ /^NAME/ {print $2}' /etc/*-release | tr -d '"') fi if [ -z "${OS_VERSION}" ] ; then OS_VERSION=$(awk -F'=' '$1 ~ /^VERSION_ID/ {print $2}' /etc/*-release | tr -d '"') fi if [ "${OS_NAME}" == "Debian GNU/Linux" ] ; then # Debian testing versions don't include numbers in /etc/os-release. OS_VERSION=$( : run Showfoto instead digiKam." echo " : run digiKam and wait at startup to be attached to a remote GDB instance (only suitable with the AppImage compiled with debug symbols)." echo " : run Showfoto and wait at startup to be attached to a remote GDB instance (only suitable with the AppImage compiled with debug symbols)." echo " : show these information." else # Run digiKam as well. digikam $@ fi