Skip to content

Commit 9df9550

Browse files
authored
Deploy dependencies in the AppImage (pkgforge-dev#2)
1 parent d49acaf commit 9df9550

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

build.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,24 @@ zig build \
4444

4545
cd "${APP_DIR}"
4646

47+
# bundle all libs
48+
mkdir -p ./usr/lib
49+
ldd ./usr/bin/ghostty | awk -F"[> ]" '{print $4}' | xargs -I {} cp -vn {} ./usr/lib
50+
if ! mv ./usr/lib/ld-linux-x86-64.so.2 ./; then
51+
cp -v /lib64/ld-linux-x86-64.so.2 ./
52+
fi
53+
4754
# prep appimage
48-
printf '#!/bin/sh\n\nexec "$(dirname "$(readlink -f "$0")")/usr/bin/ghostty"\n' | tee AppRun >/dev/null
55+
echo '#!/usr/bin/env sh
56+
HERE="$(dirname "$(readlink -f "$0")")"
57+
export TERM=xterm-256color
58+
exec "$HERE"/ld-linux-x86-64.so.2 --library-path "$HERE"/usr/lib "$HERE"/usr/bin/ghostty "$@"' > ./AppRun
4959
chmod +x AppRun
5060
ln -s usr/share/applications/com.mitchellh.ghostty.desktop
5161
ln -s usr/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png
5262

5363
cd "${TMP_DIR}"
5464
# create app image
55-
ARCH=x8_64 appimagetool "${APP_DIR}"
65+
ARCH="$(uname -m)" appimagetool "${APP_DIR}"
5666

5767
appimagelint "${TMP_DIR}/Ghostty-x86_64.AppImage" || true

0 commit comments

Comments
 (0)