Skip to content

Commit c2dec4e

Browse files
authored
update build.sh to handle aarch64 interpreter
1 parent c78d35f commit c2dec4e

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

build.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,22 @@ cd "${APP_DIR}"
6262

6363
# bundle all libs
6464
ldd ./usr/bin/ghostty | awk -F"[> ]" '{print $4}' | xargs -I {} cp --update=none -v {} ./usr/lib
65-
if ! mv ./usr/lib/ld-linux-x86-64.so.2 ./; then
66-
cp -v /lib64/ld-linux-x86-64.so.2 ./
65+
66+
# ld-linux contains x86-64 instead of x86_64.
67+
if [ "$ARCH" = "x86_64" ]; then
68+
if ! mv ./usr/lib/ld-linux-x86-64.so.2 ./ld-linux.so; then
69+
cp -v /lib64/ld-linux-x86-64.so.2 ./ld-linux.so
70+
fi
71+
elif [ "$ARCH" = "aarch64" ]; then
72+
if ! mv ./usr/lib/ld-linux-aarch64.so.2 ./ld-linux.so; then
73+
cp -v /lib64/ld-linux-aarch64.so.2 ./ld-linux.so
74+
fi
75+
else
76+
exit 1
6777
fi
6878

79+
80+
6981
# Prepare AppImage -- Configure launcher script, metainfo and desktop file with icon.
7082
cat <<'EOF' >./AppRun
7183
#!/usr/bin/env sh
@@ -75,7 +87,7 @@ HERE="$(dirname "$(readlink -f "$0")")"
7587
export TERM=xterm-256color
7688
export GHOSTTY_RESOURCES_DIR="${HERE}/usr/share/ghostty"
7789
78-
exec "${HERE}"/ld-linux-x86-64.so.2 --library-path "${HERE}"/usr/lib "${HERE}"/usr/bin/ghostty "$@"
90+
exec "${HERE}"/ld-linux.so --library-path "${HERE}"/usr/lib "${HERE}"/usr/bin/ghostty "$@"
7991
EOF
8092

8193
chmod +x AppRun

0 commit comments

Comments
 (0)