diff --git a/README.md b/README.md index 1253e82..00becb1 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,8 @@ This repository provides build scripts to create a Universal AppImage for [Ghostty](https://ghostty.org/). This unofficial build offers an executable AppImage compatible with any Linux distribution following the **x86_64 architecture**. - **Ghostty Source Code:** [Click Here](https://github.com/ghostty-org/ghostty) - ## 🚀 Quick Start 1. Download the latest AppImage from the [releases](https://github.com/psadi/ghostty-appimage/releases) section. @@ -60,11 +58,11 @@ Since AppImages are self-contained executables, there is no formal installation 1. Submit AppImage(s) to [AppImageHub](https://appimage.github.io/). 2. Provide AppImages for other supported architectures. - | **Architecture** | **Support** | - |------------------|-------------| - | x86_64 | ✅ | - | i386 | ❌ | - | ARM | ❌ | + | # | **Architecture** | **Status** | + | :-: | ---------------- | :--------: | + | 1 | x86_64 | ✅ | + | 2 | i386 | 🟠 | + | 3 | ARM | 🟠 | ### 🛠️ Troubleshooting diff --git a/build.sh b/build.sh index f38ee39..141aad0 100755 --- a/build.sh +++ b/build.sh @@ -9,7 +9,7 @@ PUB_KEY="RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV" rm -rf "${TMP_DIR}" -mkdir -p -- "${TMP_DIR}" "${APP_DIR}/usr" +mkdir -p -- "${TMP_DIR}" "${APP_DIR}/usr" "${APP_DIR}/usr/lib" "${APP_DIR}/usr/share/metainfo" cd "${TMP_DIR}" @@ -45,23 +45,54 @@ zig build \ cd "${APP_DIR}" # bundle all libs -mkdir -p ./usr/lib -ldd ./usr/bin/ghostty | awk -F"[> ]" '{print $4}' | xargs -I {} cp -vn {} ./usr/lib +ldd ./usr/bin/ghostty | awk -F"[> ]" '{print $4}' | xargs -I {} cp --update=none -v {} ./usr/lib if ! mv ./usr/lib/ld-linux-x86-64.so.2 ./; then cp -v /lib64/ld-linux-x86-64.so.2 ./ fi # prep appimage -echo '#!/usr/bin/env sh +cat <<'EOF' >./AppRun +#!/usr/bin/env sh + HERE="$(dirname "$(readlink -f "$0")")" + export TERM=xterm-256color -exec "$HERE"/ld-linux-x86-64.so.2 --library-path "$HERE"/usr/lib "$HERE"/usr/bin/ghostty "$@"' > ./AppRun +export GHOSTTY_RESOURCES_DIR="${HERE}/usr/share/ghostty" + +exec "${HERE}"/ld-linux-x86-64.so.2 --library-path "${HERE}"/usr/lib "${HERE}"/usr/bin/ghostty "$@" +EOF + chmod +x AppRun -ln -s usr/share/applications/com.mitchellh.ghostty.desktop -ln -s usr/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png + +ln -s usr/share/applications/com.mitchellh.ghostty.desktop . +ln -s usr/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png . + +sed -i 's/;TerminalEmulator;/;TerminalEmulator;Utility;/' com.mitchellh.ghostty.desktop + +cat <<'EOF' >./usr/share/metainfo/com.mitchellh.ghostty.appdata.xml + + + + +

+ 👻 Ghostty is a fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration. +

+
+ + Mitchell Hashimoto + + https://raw.githubusercontent.com/ghostty-org/ghostty/refs/heads/main/images/icons/icon_256.png + com.mitchellh.ghostty + com.mitchellh.ghostty.desktop + MIT + Ghostty + MIT + A terminal emulator + https://ghostty.org +
+EOF cd "${TMP_DIR}" + # create app image ARCH="$(uname -m)" appimagetool "${APP_DIR}" - -appimagelint "${TMP_DIR}/Ghostty-x86_64.AppImage" || true diff --git a/setup.sh b/setup.sh index 444f944..df7422b 100755 --- a/setup.sh +++ b/setup.sh @@ -7,28 +7,28 @@ export DEBIAN_FRONTEND="noninteractive" ZIG_VERSION="0.13.0" # update & install os base dependencies -buildPkgs="build-essential libonig-dev libbz2-dev pandoc wget fuse libfuse2t64 file" +buildPkgs="build-essential libonig-dev libbz2-dev pandoc wget fuse libfuse2t64 file zsync appstream" ghosttyPkgs="libgtk-4-dev libadwaita-1-dev" -apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq -y install $buildPkgs $ghosttyPkgs +apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq -y install ${buildPkgs} ${ghosttyPkgs} -# download & install other dependencie +# download & install other dependencies # appimagetool: https://github.com/AppImage/appimagetool wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" install appimagetool-x86_64.AppImage /usr/local/bin/appimagetool -rm appimagetool-x86_64.AppImage - -wget -q "https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage" -install appimagelint-x86_64.AppImage /usr/local/bin/appimagelint -rm appimagelint-x86_64.AppImage # minisign: https://github.com/jedisct1/minisign wget -q "https://github.com/jedisct1/minisign/releases/download/0.11/minisign-0.11-linux.tar.gz" tar -xzf minisign-0.11-linux.tar.gz mv minisign-linux/x86_64/minisign /usr/local/bin -rm -r minisign-0.11-linux.tar.gz # zig: https://ziglang.org wget -q "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz" tar -xf "zig-linux-x86_64-${ZIG_VERSION}.tar.xz" -C /opt -rm "zig-linux-x86_64-${ZIG_VERSION}.tar.xz" ln -s "/opt/zig-linux-x86_64-${ZIG_VERSION}/zig" /usr/local/bin/zig + +# cleanup +rm -r \ + "appimagetool-x86_64.AppImage" \ + "minisign-0.11-linux.tar.gz" \ + "minisign-linux" \ + "zig-linux-x86_64-${ZIG_VERSION}.tar.xz"