Skip to content

Commit

Permalink
restyled
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Dec 28, 2024
1 parent ff347f1 commit 9a0b069
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions appimage/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,32 @@
set -exuo pipefail

usage() {
echo "$0 --src-dir SRC_DIR"
echo "Builds an app image in the CWD based off qtox installation at SRC_DIR"
echo "$0 --src-dir SRC_DIR"
echo "Builds an app image in the CWD based off qtox installation at SRC_DIR"
}

while (( $# > 0 )); do
case $1 in
--src-dir) QTOX_SRC_DIR=$2; shift 2 ;;
--help|-h) usage; exit 1 ;;
*) echo "Unexpected argument $1"; usage; exit 1;;
esac
while (($# > 0)); do
case $1 in
--src-dir)
QTOX_SRC_DIR=$2
shift 2
;;
--help | -h)
usage
exit 1
;;
*)
echo "Unexpected argument $1"
usage
exit 1
;;
esac
done

if [ -z "${QTOX_SRC_DIR+x}" ]; then
echo "--src-dir is a required argument"
usage
exit 1
echo "--src-dir is a required argument"
usage
exit 1
fi

# directory paths
Expand All @@ -33,7 +43,7 @@ QTOX_APP_DIR="$BUILD_DIR/QTox.AppDir"
readonly QTOX_APP_DIR

rm -f appimagetool-*.AppImage
wget https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)
wget "https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)"
chmod +x appimagetool-*.AppImage

# update information to be embeded in AppImage
Expand All @@ -58,6 +68,6 @@ export LD_LIBRARY_PATH="/work/lib64:$QTDIR/lib"
./appimagetool-*.AppImage --appimage-extract-and-run -s deploy "$QTOX_APP_DIR"/usr/share/applications/*.desktop

# print all links not contained inside the AppDir
LD_LIBRARY_PATH='' find "$QTOX_APP_DIR" -type f -exec ldd {} 2>&1 \; | grep '=>' | grep -v "$QTOX_APP_DIR"
LD_LIBRARY_PATH='' find "$QTOX_APP_DIR" -type f -exec ldd {} \; 2>&1 | grep '=>' | grep -v "$QTOX_APP_DIR"

./appimagetool-*.AppImage --appimage-extract-and-run "$QTOX_APP_DIR"

0 comments on commit 9a0b069

Please sign in to comment.