Skip to content

Commit 56cbf5e

Browse files
author
PS Adithya
authored
Merge pull request pkgforge-dev#8 from psadi/feature/arm_build
feat: add support for arm/aarch64
2 parents fd63623 + 94c65b6 commit 56cbf5e

File tree

5 files changed

+94
-40
lines changed

5 files changed

+94
-40
lines changed

.github/actionlint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
self-hosted-runner:
2+
labels:
3+
- ubuntu-24.04-arm

.github/workflows/ci.yaml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
---
21
name: Build
3-
42
on:
53
workflow_dispatch: {}
64
pull_request:
@@ -14,10 +12,19 @@ jobs:
1412
actions: read
1513
security-events: write
1614
contents: write
17-
name: Build Ghostty
18-
runs-on: ubuntu-24.04
15+
name: Build Ghostty (${{ matrix.arch }})
16+
runs-on: ${{ matrix.runs-on }}
17+
strategy:
18+
matrix:
19+
include:
20+
- arch: aarch64
21+
platform: linux/arm64
22+
runs-on: ubuntu-24.04-arm
23+
- arch: x86_64
24+
platform: linux/amd64
25+
runs-on: ubuntu-24.04
1926
container:
20-
image: ubuntu:24.04
27+
image: ${{ matrix.arch == 'aarch64' && 'arm64v8/ubuntu:24.04' || 'ubuntu:24.04' }}
2128
options: "--privileged --cap-add SYS_ADMIN --device /dev/fuse"
2229
steps:
2330
- name: Checkout ghostty-appimage
@@ -34,9 +41,12 @@ jobs:
3441
- name: Upload Artifact
3542
uses: actions/upload-artifact@v4
3643
with:
37-
name: ghostty-appimage
44+
name: ghostty-appimage-${{ matrix.arch }}
3845
retention-days: 7
39-
path: /tmp/ghostty-build/Ghostty-*-x86_64.AppImage*
46+
path: /tmp/ghostty-build/Ghostty-*.AppImage*
47+
48+
outputs:
49+
arch: ${{ matrix.arch }}
4050

4151
release_appimage:
4252
permissions:
@@ -50,13 +60,13 @@ jobs:
5060
steps:
5161
- uses: actions/download-artifact@v4
5262
with:
53-
name: ghostty-appimage
63+
name: ghostty-appimage-${{ needs.build_appimage.outputs.arch }}
5464

5565
- name: Upload binaries to release
5666
uses: svenstaro/upload-release-action@v2
5767
with:
5868
repo_token: ${{ secrets.GITHUB_TOKEN }}
59-
file: ./Ghostty-*-x86_64.AppImage*
69+
file: ./Ghostty-*.AppImage*
6070
tag: ${{ github.ref }}
6171
overwrite: true
6272
file_glob: true

README.md

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<img src="https://img.shields.io/github/contributors/psadi/ghostty-appimage" alt="Contributors">
1717
</p></h1>
1818

19-
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**.
19+
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.
2020

2121
**Ghostty Source Code:** [Click Here](https://github.com/ghostty-org/ghostty)
2222

@@ -32,14 +32,29 @@ This repository provides build scripts to create a Universal AppImage for [Ghost
3232
Run the following commands in your terminal:
3333

3434
```bash
35-
# Download the latest AppImage package
36-
wget https://github.com/psadi/ghostty-appimage/releases/download/[TAG]/Ghostty-x86_64.AppImage
37-
# Provide executable permissions
35+
# Download the latest AppImage package from releases
36+
wget https://github.com/psadi/ghostty-appimage/releases/download/${TAG}/Ghostty-x86_64.AppImage
37+
38+
# Make the AppImage executable
3839
chmod +x Ghostty-x86_64.AppImage
39-
# Execute the AppImage
40+
41+
# Run the AppImage
4042
./Ghostty-x86_64.AppImage
43+
44+
# Optionally, add the AppImage to your PATH for easier access
45+
46+
# With sudo for system wide availability
47+
sudo install ./Ghostty-x86_64.AppImage /usr/local/bin/ghostty
48+
49+
# Without sudo, XDG base spec mandate
50+
install ./Ghostty-x86_64.AppImage $HOME/.local/bin/ghostty
51+
52+
# Now you can run Ghostty from anywhere using the command:
53+
# ghostty
4154
```
4255

56+
_**Note:** By using [**AM**](https://github.com/ivan-hc/AM)/[**AppMan**](https://github.com/ivan-hc/AppMan), **PATH** config done automatically when you install appimages with it._
57+
4358
### Graphical
4459

4560
1. Download the latest AppImage package from the [releases](https://github.com/psadi/ghostty-appimage/releases) section.
@@ -57,26 +72,35 @@ chmod +x Ghostty-x86_64.AppImage
5772

5873
Since AppImages are self-contained executables, there is no formal installation process beyond setting executable permissions.
5974

60-
**To update manually:**
75+
**Update manually:**
6176

62-
1. Download the latest AppImage package from the [releases](https://github.com/psadi/ghostty-appimage/releases) section.
63-
2. Follow the same steps as in the [Installation](#installation) section to make it executable and run it.
77+
1. Download the latest AppImage package from the [releases](https://github.com/psadi/ghostty-appimage/releases) section.
78+
2. Follow the same steps as in the [Installation](#installation) section to make it executable and run it.
6479

6580
**Update automatically:**
6681

67-
1. Use [AppImageUpdate](https://github.com/AppImageCommunity/AppImageUpdate) which reads the update information in the AppImage. This is a low level tool.
68-
2. Use a higher level tool that uses AppImageUpdate, like [AM](https://github.com/ivan-hc/AM) or [appimaged](https://github.com/probonopd/go-appimage/blob/master/src/appimaged/README.md) daemon, these tools also automatically handle desktop integration.
82+
1. Use [AppImageUpdate](https://github.com/AppImageCommunity/AppImageUpdate) which reads the update information in the AppImage. This is a low level tool.
83+
2. Use a higher level tool that uses AppImageUpdate, like [AM](https://github.com/ivan-hc/AM) or [appimaged](https://github.com/probonopd/go-appimage/blob/master/src/appimaged/README.md) daemon, these tools also automatically handle desktop integration.
6984

70-
## ❓ What's Next?
85+
## 🖥️ Supported System Architectures
86+
87+
This AppImage supports the following architectures:
88+
89+
| **#** | **Architecture** | **Status** | **Availability** |
90+
| :---: | ---------------- | :--------: | ---------------- |
91+
| 1 | x86_64 | 🟢 | Available |
92+
| 2 | aarch64 | 🟢 | Available |
7193

72-
1. Submit AppImage(s) to [AppImageHub](https://appimage.github.io/).
73-
2. Provide AppImages for other supported architectures.
94+
**Notes:**
95+
96+
- **x86_64**: Widely used in modern desktops and servers, supporting 64-bit processing.
97+
- **aarch64**: 64-bit ARM architecture, planned for future support in cloud computing environments.
98+
99+
## ❓ What's Next?
74100

75-
| # | **Architecture** | **Status** |
76-
| :-: | ---------------- | :--------: |
77-
| 1 | x86_64 ||
78-
| 2 | i386 | 🟠 |
79-
| 3 | ARM | 🟠 |
101+
- [x] Provide AppImages for other supported architectures
102+
- [ ] Submit AppImage(s) to [AppImageHub](https://appimage.github.io/)
103+
- [ ] Dependency caching in ci for a faster release cycle
80104

81105
### 🛠️ Troubleshooting
82106

build.sh

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,25 @@ 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-
cp -v /usr/lib/x86_64-linux-gnu/libpthread.so.0 ./usr/lib
66-
if ! mv ./usr/lib/ld-linux-x86-64.so.2 ./; then
67-
cp -v /lib64/ld-linux-x86-64.so.2 ./
65+
66+
# ld-linux contains x86-64 instead of x86_64
67+
case "${ARCH}" in
68+
"x86_64")
69+
ld_linux="ld-linux-x86-64.so.2"
70+
;;
71+
"aarch64")
72+
ld_linux="ld-linux-aarch64.so.1"
73+
;;
74+
*)
75+
echo "Unsupported ARCH: '${ARCH}'"
76+
exit 1
77+
;;
78+
esac
79+
80+
cp -v /usr/lib/${ARCH}-linux-gnu/libpthread.so.0 ./usr/lib
81+
82+
if ! mv ./usr/lib/${ld_linux} ./ld-linux.so; then
83+
cp -v /usr/lib/${ARCH}-linux-gnu/${ld_linux} ./ld-linux.so
6884
fi
6985

7086
# Prepare AppImage -- Configure launcher script, metainfo and desktop file with icon.
@@ -76,11 +92,11 @@ HERE="$(dirname "$(readlink -f "$0")")"
7692
export TERM=xterm-256color
7793
export GHOSTTY_RESOURCES_DIR="${HERE}/usr/share/ghostty"
7894
79-
exec "${HERE}"/ld-linux-x86-64.so.2 --library-path "${HERE}"/usr/lib "${HERE}"/usr/bin/ghostty "$@"
95+
exec "${HERE}"/ld-linux.so --library-path "${HERE}"/usr/lib "${HERE}"/usr/bin/ghostty "$@"
8096
8197
if [ "$?" -gt 0 ] && [ -n "$WAYLAND_DISPLAY" ]; then
8298
export GDK_BACKEND=x11
83-
exec "${HERE}"/ld-linux-x86-64.so.2 --library-path "${HERE}"/usr/lib "${HERE}"/usr/bin/ghostty "$@"
99+
exec "${HERE}"/ld-linux.so --library-path "${HERE}"/usr/lib "${HERE}"/usr/bin/ghostty "$@"
84100
fi
85101
EOF
86102

setup.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -e
44

55
export DEBIAN_FRONTEND="noninteractive"
6+
export ARCH="$(uname -m)"
67

78
ZIG_VERSION="0.13.0"
89
MINISIGN_URL="https://github.com/jedisct1/minisign/releases/download/0.11/minisign-0.11-linux.tar.gz"
@@ -29,22 +30,22 @@ apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq -y install ${buildPk
2930

3031
# download & install other dependencies
3132
# appimagetool: https://github.com/AppImage/appimagetool
32-
wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
33-
install appimagetool-x86_64.AppImage /usr/local/bin/appimagetool
33+
wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${ARCH}.AppImage"
34+
install "appimagetool-${ARCH}.AppImage" /usr/local/bin/appimagetool
3435

3536
# minisign: https://github.com/jedisct1/minisign
3637
wget -q "${MINISIGN_URL}" -O "minisign-linux.tar.gz"
3738
tar -xzf "minisign-linux.tar.gz"
38-
mv minisign-linux/x86_64/minisign /usr/local/bin
39+
mv minisign-linux/"${ARCH}"/minisign /usr/local/bin
3940

4041
# zig: https://ziglang.org
41-
wget -q "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz"
42-
tar -xf "zig-linux-x86_64-${ZIG_VERSION}.tar.xz" -C /opt
43-
ln -s "/opt/zig-linux-x86_64-${ZIG_VERSION}/zig" /usr/local/bin/zig
42+
wget -q "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz"
43+
tar -xf "zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz" -C /opt
44+
ln -s "/opt/zig-linux-${ARCH}-${ZIG_VERSION}/zig" /usr/local/bin/zig
4445

4546
# cleanup
4647
rm -r \
47-
"appimagetool-x86_64.AppImage" \
48+
"appimagetool-${ARCH}.AppImage" \
4849
"minisign-linux.tar.gz" \
4950
"minisign-linux" \
50-
"zig-linux-x86_64-${ZIG_VERSION}.tar.xz"
51+
"zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz"

0 commit comments

Comments
 (0)