Skip to content

Commit 8419795

Browse files
author
Adithya Ps
authored
Merge pull request pkgforge-dev#3 from psadi/feature/ghostty_resources
fix: add env var for ghostty resources dir
2 parents 9df9550 + d549bfe commit 8419795

File tree

3 files changed

+55
-26
lines changed

3 files changed

+55
-26
lines changed

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99

1010
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**.
1111

12-
1312
**Ghostty Source Code:** [Click Here](https://github.com/ghostty-org/ghostty)
1413

15-
1614
## 🚀 Quick Start
1715

1816
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
6058
1. Submit AppImage(s) to [AppImageHub](https://appimage.github.io/).
6159
2. Provide AppImages for other supported architectures.
6260

63-
| **Architecture** | **Support** |
64-
|------------------|-------------|
65-
| x86_64 | |
66-
| i386 | |
67-
| ARM | |
61+
| # | **Architecture** | **Status** |
62+
| :-: | ---------------- | :--------: |
63+
| 1 | x86_64 | |
64+
| 2 | i386 | 🟠 |
65+
| 3 | ARM | 🟠 |
6866

6967
### 🛠️ Troubleshooting
7068

build.sh

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ PUB_KEY="RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV"
99

1010
rm -rf "${TMP_DIR}"
1111

12-
mkdir -p -- "${TMP_DIR}" "${APP_DIR}/usr"
12+
mkdir -p -- "${TMP_DIR}" "${APP_DIR}/usr" "${APP_DIR}/usr/lib" "${APP_DIR}/usr/share/metainfo"
1313

1414
cd "${TMP_DIR}"
1515

@@ -45,23 +45,54 @@ zig build \
4545
cd "${APP_DIR}"
4646

4747
# bundle all libs
48-
mkdir -p ./usr/lib
49-
ldd ./usr/bin/ghostty | awk -F"[> ]" '{print $4}' | xargs -I {} cp -vn {} ./usr/lib
48+
ldd ./usr/bin/ghostty | awk -F"[> ]" '{print $4}' | xargs -I {} cp --update=none -v {} ./usr/lib
5049
if ! mv ./usr/lib/ld-linux-x86-64.so.2 ./; then
5150
cp -v /lib64/ld-linux-x86-64.so.2 ./
5251
fi
5352

5453
# prep appimage
55-
echo '#!/usr/bin/env sh
54+
cat <<'EOF' >./AppRun
55+
#!/usr/bin/env sh
56+
5657
HERE="$(dirname "$(readlink -f "$0")")"
58+
5759
export TERM=xterm-256color
58-
exec "$HERE"/ld-linux-x86-64.so.2 --library-path "$HERE"/usr/lib "$HERE"/usr/bin/ghostty "$@"' > ./AppRun
60+
export GHOSTTY_RESOURCES_DIR="${HERE}/usr/share/ghostty"
61+
62+
exec "${HERE}"/ld-linux-x86-64.so.2 --library-path "${HERE}"/usr/lib "${HERE}"/usr/bin/ghostty "$@"
63+
EOF
64+
5965
chmod +x AppRun
60-
ln -s usr/share/applications/com.mitchellh.ghostty.desktop
61-
ln -s usr/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png
66+
67+
ln -s usr/share/applications/com.mitchellh.ghostty.desktop .
68+
ln -s usr/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png .
69+
70+
sed -i 's/;TerminalEmulator;/;TerminalEmulator;Utility;/' com.mitchellh.ghostty.desktop
71+
72+
cat <<'EOF' >./usr/share/metainfo/com.mitchellh.ghostty.appdata.xml
73+
<?xml version="1.0" encoding="UTF-8"?>
74+
<component type="desktop-application">
75+
<content_rating type="oars-1.0" />
76+
<description>
77+
<p>
78+
👻 Ghostty is a fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration.
79+
</p>
80+
</description>
81+
<developer id="com.mitchellh">
82+
<name>Mitchell Hashimoto</name>
83+
</developer>
84+
<icon type="remote">https://raw.githubusercontent.com/ghostty-org/ghostty/refs/heads/main/images/icons/icon_256.png</icon>
85+
<id>com.mitchellh.ghostty</id>
86+
<launchable type="desktop-id">com.mitchellh.ghostty.desktop</launchable>
87+
<metadata_license>MIT</metadata_license>
88+
<name>Ghostty</name>
89+
<project_license>MIT</project_license>
90+
<summary>A terminal emulator</summary>
91+
<url type="homepage">https://ghostty.org</url>
92+
</component>
93+
EOF
6294

6395
cd "${TMP_DIR}"
96+
6497
# create app image
6598
ARCH="$(uname -m)" appimagetool "${APP_DIR}"
66-
67-
appimagelint "${TMP_DIR}/Ghostty-x86_64.AppImage" || true

setup.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@ export DEBIAN_FRONTEND="noninteractive"
77
ZIG_VERSION="0.13.0"
88

99
# update & install os base dependencies
10-
buildPkgs="build-essential libonig-dev libbz2-dev pandoc wget fuse libfuse2t64 file"
10+
buildPkgs="build-essential libonig-dev libbz2-dev pandoc wget fuse libfuse2t64 file zsync appstream"
1111
ghosttyPkgs="libgtk-4-dev libadwaita-1-dev"
12-
apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq -y install $buildPkgs $ghosttyPkgs
12+
apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq -y install ${buildPkgs} ${ghosttyPkgs}
1313

14-
# download & install other dependencie
14+
# download & install other dependencies
1515
# appimagetool: https://github.com/AppImage/appimagetool
1616
wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
1717
install appimagetool-x86_64.AppImage /usr/local/bin/appimagetool
18-
rm appimagetool-x86_64.AppImage
19-
20-
wget -q "https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage"
21-
install appimagelint-x86_64.AppImage /usr/local/bin/appimagelint
22-
rm appimagelint-x86_64.AppImage
2318

2419
# minisign: https://github.com/jedisct1/minisign
2520
wget -q "https://github.com/jedisct1/minisign/releases/download/0.11/minisign-0.11-linux.tar.gz"
2621
tar -xzf minisign-0.11-linux.tar.gz
2722
mv minisign-linux/x86_64/minisign /usr/local/bin
28-
rm -r minisign-0.11-linux.tar.gz
2923

3024
# zig: https://ziglang.org
3125
wget -q "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz"
3226
tar -xf "zig-linux-x86_64-${ZIG_VERSION}.tar.xz" -C /opt
33-
rm "zig-linux-x86_64-${ZIG_VERSION}.tar.xz"
3427
ln -s "/opt/zig-linux-x86_64-${ZIG_VERSION}/zig" /usr/local/bin/zig
28+
29+
# cleanup
30+
rm -r \
31+
"appimagetool-x86_64.AppImage" \
32+
"minisign-0.11-linux.tar.gz" \
33+
"minisign-linux" \
34+
"zig-linux-x86_64-${ZIG_VERSION}.tar.xz"

0 commit comments

Comments
 (0)