Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down
49 changes: 40 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down Expand Up @@ -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
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<content_rating type="oars-1.0" />
<description>
<p>
👻 Ghostty is a fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration.
</p>
</description>
<developer id="com.mitchellh">
<name>Mitchell Hashimoto</name>
</developer>
<icon type="remote">https://raw.githubusercontent.com/ghostty-org/ghostty/refs/heads/main/images/icons/icon_256.png</icon>
<id>com.mitchellh.ghostty</id>
<launchable type="desktop-id">com.mitchellh.ghostty.desktop</launchable>
<metadata_license>MIT</metadata_license>
<name>Ghostty</name>
<project_license>MIT</project_license>
<summary>A terminal emulator</summary>
<url type="homepage">https://ghostty.org</url>
</component>
EOF

cd "${TMP_DIR}"

# create app image
ARCH="$(uname -m)" appimagetool "${APP_DIR}"

appimagelint "${TMP_DIR}/Ghostty-x86_64.AppImage" || true
20 changes: 10 additions & 10 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"