Skip to content

Commit f59e551

Browse files
authored
set and use APPIMAGE_ARCH, remove AppRun-Qt (#76)
1 parent 4ea7580 commit f59e551

6 files changed

Lines changed: 32 additions & 78 deletions

File tree

useful-tools/bin/AppRun-Qt

Lines changed: 0 additions & 71 deletions
This file was deleted.

useful-tools/bin/AppRun-generic

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ fi
1212
set -e
1313

1414
CURRENTDIR="$(cd "${0%/*}" && echo "$PWD")"
15-
PATH="$CURRENTDIR/bin:$PATH"
16-
export PATH
1715
BIN="${ARGV0:-$0}"
1816
BIN="${BIN##*/}"
1917

18+
export APPIMAGE_ARCH=@@@@@
19+
export PATH="$CURRENTDIR/bin:$PATH"
20+
2021
# get name of main binary from the .desktop file
2122
_get_main_bin_name() {
2223
for f in "$CURRENTDIR"/*.desktop; do
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
# Normally we bundle qt6ct to allow custom theming so this hook is not needed
4+
# WARNING: The '-stylesheet' flag is NOT supported by all Qt apps!
5+
# So verify that it works before using this hook!
6+
7+
# USAGE: Set the env variable APPIMAGE_QT_THEME
8+
# or make a .stylesheet file next to the appimage (appimagename + .stylesheet)
9+
10+
# check if there is a custom stylesheet and append it to the arrray
11+
if [ -f "$APPIMAGE".stylesheet ]; then
12+
APPIMAGE_QT_THEME="$APPIMAGE.stylesheet"
13+
fi
14+
if [ -f "$APPIMAGE_QT_THEME" ]; then
15+
set -- "$@" "-stylesheet" "$APPIMAGE_QT_THEME"
16+
fi

useful-tools/hooks/self-updater.bg.hook

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
set -e
1616

17-
ARCH="$(uname -m)"
1817
APPDIR=${APPDIR:-$SHARUN_DIR}
1918
APPNAME=${APPIMAGE##*/}
2019

@@ -34,7 +33,7 @@ UPDATE_MSG="${UPDATE_MSG:-A new version of $APPNAME is available. Do you wish to
3433
POST_UPDATE_GOOD="$APPNAME updated successfully!"
3534
POST_UPDATE_BAD="ERROR: Something went wrong updating $APPNAME"
3635
DO_NOT_ASK="Do you wish to disable update checking and not see this message again?"
37-
APPIMAGEUPDATETOOL_LINK="${APPIMAGEUPDATETOOL_LINK:-https://github.com/AppImageCommunity/AppImageUpdate/releases/download/continuous/appimageupdatetool-$ARCH.AppImage}"
36+
APPIMAGEUPDATETOOL_LINK="${APPIMAGEUPDATETOOL_LINK:-https://github.com/AppImageCommunity/AppImageUpdate/releases/download/continuous/appimageupdatetool-$APPIMAGE_ARCH.AppImage}"
3837

3938
# make sure we can update the thing
4039
_sanity_check() {

useful-tools/hooks/vulkan-check.src.hook

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
# hook that checks several potential issues vulkan related
44

5+
# On aarch64 device drivers are all over the place and often they ship with
6+
# modifications not upstreamed to mesa, so we need to allow the host vulkan
7+
if [ "$APPIMAGE_ARCH" = 'aarch64' ]; then
8+
export SHARUN_ALLOW_SYS_VKICD=1
9+
fi
10+
511
_err_msg(){
612
>&2 printf '\033[1;31m%s\033[0m\n' " $*"
713
}
@@ -53,15 +59,15 @@ _check_vulkan_json_path() (
5359
implicit_dir="$_VULKAN_HOOK_DIR"/vulkan/implicit_layer.d
5460
explicit_dir="$_VULKAN_HOOK_DIR"/vulkan/explicit_layer.d
5561

56-
for dep in grep sed mkdir uname; do
62+
for dep in grep sed mkdir; do
5763
if ! command -v "$dep" 1>/dev/null; then
5864
return 1
5965
fi
6066
done
6167

6268
for f in /usr/share/vulkan/explicit_layer.d/*; do
6369
if [ -f "$f" ] && layer_path=$(grep -o '"/usr.*$LIB.*"' "$f"); then
64-
for p in lib/"$(uname -m)"-linux-gnu lib64 lib; do
70+
for p in lib/"$APPIMAGE_ARCH"-linux-gnu lib64 lib; do
6571
test_path=$(echo "$layer_path" | sed "s|\"||g; s|\$LIB|$p|")
6672
if [ -e "$test_path" ]; then
6773
mkdir -p "$explicit_dir"
@@ -77,7 +83,7 @@ _check_vulkan_json_path() (
7783

7884
for f in /usr/share/vulkan/implicit_layer.d/*; do
7985
if [ -f "$f" ] && layer_path=$(grep -o '"/usr.*$LIB.*"' "$f"); then
80-
for p in lib/"$(uname -m)"-linux-gnu lib64 lib; do
86+
for p in lib/"$APPIMAGE_ARCH"-linux-gnu lib64 lib; do
8187
test_path=$(echo "$layer_path" | sed "s|\"||g; s|\$LIB|$p|")
8288
if [ -e "$test_path" ]; then
8389
mkdir -p "$implicit_dir"
@@ -95,3 +101,4 @@ _check_vulkan_json_path() (
95101
if _check_vulkan_json_path && [ -d "$_VULKAN_HOOK_DIR" ]; then
96102
export XDG_CONFIG_DIRS="$_VULKAN_HOOK_DIR:${XDG_CONFIG_DIRS:-/etc/xdg}"
97103
fi
104+

useful-tools/quick-sharun.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,8 @@ elif [ ! -f "$APPDIR"/AppRun ]; then
10421042
_echo "* Hardlinked $APPDIR/sharun as $APPDIR/AppRun..."
10431043
fi
10441044

1045+
sed -i -e "s|@@@@@|$ARCH|" "$APPDIR"/AppRun
1046+
10451047
chmod +x "$APPDIR"/AppRun "$APPDIR"/bin/*.hook "$APPDIR"/bin/notify 2>/dev/null || :
10461048

10471049
# make sure the .env has all the "unset" last, due to a bug in the dotenv

0 commit comments

Comments
 (0)