├── .github
├── actionlint.yaml
└── workflows
│ └── ci.yaml
├── .gitignore
├── .pre-commit-config.yaml
├── LICENSE
├── README.md
├── TROUBLESHOOTING.md
├── VERSION
├── assets
├── 1.png
├── 2.png
├── appimage.png
├── ghostty.appdata.xml
├── ghostty.desktop
└── ghostty.png
├── build.sh
└── setup.sh
/.github/actionlint.yaml:
--------------------------------------------------------------------------------
1 | self-hosted-runner:
2 | labels:
3 | - ubuntu-24.04-arm
4 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yaml:
--------------------------------------------------------------------------------
1 | name: Build
2 | concurrency:
3 | group: build-${{ github.ref }}
4 | cancel-in-progress: true
5 |
6 | on:
7 | schedule:
8 | - cron: "0 0 * * *"
9 | workflow_dispatch: {}
10 | pull_request:
11 | paths-ignore:
12 | - "**/*.md"
13 | - "**/VERSION"
14 | types: [opened, synchronize, reopened]
15 | release:
16 | types: [published]
17 |
18 | jobs:
19 | build_appimage:
20 | permissions:
21 | actions: read
22 | security-events: write
23 | contents: write
24 | name: 👻 Build Ghostty (${{ matrix.arch }}) ${{ matrix.glfw == true && '(glfw)' || '' }}
25 | runs-on: ${{ matrix.runs-on }}
26 | strategy:
27 | matrix:
28 | include:
29 | - arch: aarch64
30 | platform: linux/arm64
31 | runs-on: ubuntu-24.04-arm
32 | glfw: false
33 | - arch: x86_64
34 | platform: linux/amd64
35 | runs-on: ubuntu-24.04
36 | glfw: false
37 | - arch: aarch64
38 | platform: linux/arm64
39 | runs-on: ubuntu-24.04-arm
40 | glfw: true
41 | - arch: x86_64
42 | platform: linux/amd64
43 | runs-on: ubuntu-24.04
44 | glfw: true
45 | container:
46 | image: ghcr.io/pkgforge-dev/archlinux:latest
47 | steps:
48 | - name: Checkout ghostty-appimage
49 | uses: actions/checkout@v4
50 | with:
51 | persist-credentials: false
52 |
53 | - name: Cache dependencies
54 | id: cache-ghostty
55 | uses: actions/cache@v4
56 | with:
57 | path: |
58 | /var/cache/pacman
59 | /tmp/offline-cache
60 | /root/.cache/zig
61 | key: ${{ runner.os }}-${{ matrix.arch }}-ghostty-${{ hashFiles('**/VERSION') }}
62 | restore-keys: |
63 | ${{ runner.os }}-${{ matrix.arch }}-ghostty-
64 |
65 | - name: Setup build environment
66 | run: |
67 | if [ "${{ github.event_name }}" == "schedule" ]; then
68 | export ZIG_VERSION=0.14.0
69 | else
70 | export ZIG_VERSION=0.13.0
71 | fi
72 |
73 | ZIG_VERSION=$ZIG_VERSION ./setup.sh
74 |
75 | - name: Build Ghostty AppImage
76 | run: |
77 | if [ "${{ github.event_name }}" == "schedule" ]; then
78 | echo "tip" > VERSION
79 | fi
80 | ./build.sh
81 | env:
82 | GLFW: ${{ matrix.glfw }}
83 |
84 | - name: Upload AppImage Artifacts
85 | uses: actions/upload-artifact@v4
86 | with:
87 | name: ghostty-appimage-${{ matrix.arch }}${{ matrix.glfw == true && '-glfw' || '' }}
88 | retention-days: 7
89 | path: /tmp/ghostty-build/Ghostty*-${{ matrix.arch }}.AppImage*
90 |
91 | tag:
92 | name: "👻 Tip Tag"
93 | if: ${{ github.event_name == 'schedule' && github.ref_name == 'main' }}
94 | permissions:
95 | actions: read
96 | security-events: write
97 | contents: write
98 | runs-on: ubuntu-latest
99 | needs:
100 | - build_appimage
101 | steps:
102 | - uses: actions/checkout@v4 # zizmor: ignore[artipacked]
103 |
104 | - name: Clean-up Old Release Assets
105 | run: |
106 | gh release view tip --json assets --jq '.assets[].name' | while read -r asset; do
107 | if [ -n "$asset" ]; then
108 | gh release delete-asset tip "${asset}" -y
109 | fi
110 | done
111 | env:
112 | GH_TOKEN: ${{ github.token }}
113 |
114 | - name: Create 'tip' tag
115 | run: |
116 | git config user.name "github-actions[bot]"
117 | git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
118 | git tag -fa tip -m "Latest Continuous Release" "${GITHUB_SHA}"
119 | git push --force origin tip
120 |
121 | release_stable:
122 | name: 👻 Release Ghostty AppImage (Stable)
123 | needs:
124 | - build_appimage
125 | permissions:
126 | actions: read
127 | contents: write
128 | runs-on: ubuntu-latest
129 | if: ${{ github.event_name == 'release' }}
130 | steps:
131 | - uses: actions/download-artifact@v4
132 | with:
133 | name: ghostty-appimage-aarch64
134 |
135 | - uses: actions/download-artifact@v4
136 | with:
137 | name: ghostty-appimage-x86_64
138 |
139 | - uses: actions/download-artifact@v4
140 | with:
141 | name: ghostty-appimage-aarch64-glfw
142 |
143 | - uses: actions/download-artifact@v4
144 | with:
145 | name: ghostty-appimage-x86_64-glfw
146 |
147 | - name: Ghostty stable
148 | uses: svenstaro/upload-release-action@v2
149 | with:
150 | repo_token: ${{ secrets.GITHUB_TOKEN }}
151 | file: "*.AppImage*"
152 | tag: ${{ github.ref }}
153 | overwrite: true
154 | file_glob: true
155 |
156 | release_nightly:
157 | name: 👻 Release Ghostty AppImage (Nightly)
158 | if: ${{ github.event_name == 'schedule' && github.ref_name == 'main' }}
159 | needs:
160 | - build_appimage
161 | - tag
162 | permissions:
163 | actions: read
164 | contents: write
165 | runs-on: ubuntu-latest
166 | steps:
167 | - uses: actions/download-artifact@v4
168 | with:
169 | name: ghostty-appimage-aarch64
170 |
171 | - uses: actions/download-artifact@v4
172 | with:
173 | name: ghostty-appimage-x86_64
174 |
175 | - uses: actions/download-artifact@v4
176 | with:
177 | name: ghostty-appimage-aarch64-glfw
178 |
179 | - uses: actions/download-artifact@v4
180 | with:
181 | name: ghostty-appimage-x86_64-glfw
182 |
183 | - name: Ghostty Tip ("Nightly")
184 | uses: softprops/action-gh-release@v2.2.2
185 | with:
186 | name: '👻 Ghostty Tip ("Nightly")'
187 | prerelease: true
188 | tag_name: tip
189 | target_commitish: ${{ github.sha }}
190 | files: |
191 | *.AppImage*
192 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.AppImage
2 | *.tar.gz
3 |
4 | # Swap
5 | [._]*.s[a-v][a-z]
6 | !*.svg # comment out if you don't need vector files
7 | [._]*.sw[a-p]
8 | [._]s[a-rt-v][a-z]
9 | [._]ss[a-gi-z]
10 | [._]sw[a-p]
11 |
12 | # Session
13 | Session.vim
14 | Sessionx.vim
15 |
16 | # Temporary
17 | .netrwhist
18 | *~
19 | # Auto-generated tag files
20 | tags
21 | # Persistent undo
22 | [._]*.un~
23 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | repos:
3 | - repo: https://github.com/pre-commit/pre-commit-hooks
4 | rev: v5.0.0
5 | hooks:
6 | - id: check-executables-have-shebangs
7 | - id: check-merge-conflict
8 | - id: check-shebang-scripts-are-executable
9 | - id: fix-byte-order-marker
10 | - id: mixed-line-ending
11 | - id: end-of-file-fixer
12 | - id: trailing-whitespace
13 | args: [--markdown-linebreak-ext=md]
14 | - id: check-yaml
15 | - id: no-commit-to-branch
16 |
17 | - repo: https://github.com/shellcheck-py/shellcheck-py
18 | rev: v0.10.0.1
19 | hooks:
20 | - id: shellcheck
21 | args: ["--severity=error"]
22 |
23 | - repo: https://github.com/scop/pre-commit-shfmt
24 | rev: v3.10.0-2
25 | hooks:
26 | - id: shfmt
27 | args: ["-w", "-s"]
28 |
29 | - repo: https://github.com/rhysd/actionlint
30 | rev: v1.7.6
31 | hooks:
32 | - id: actionlint
33 |
34 | - repo: https://github.com/woodruffw/zizmor
35 | rev: v0.8.0
36 | hooks:
37 | - id: zizmor
38 | files: ^\.github/workflows/.*\.ya?ml$
39 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2025 Adithya Ps
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Ghostty AppImage
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | 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 (Including musl based).
14 |
15 | **Ghostty Source Code:** [Click Here](https://github.com/ghostty-org/ghostty)
16 |
17 | ## 🚀 Quick Start
18 |
19 | 1. Download the latest AppImage from the [releases](https://github.com/pkgforge-dev/ghostty-appimage/releases) section.
20 | 2. Follow the installation instructions below to run the AppImage.
21 |
22 | ## 📦 Builds
23 |
24 | 1. Ghostty AppImages are available for both **x86_64** and **aarch64** systems.
25 | 1. Stable builds are based on upstream releases, with minor fixes and patches released as **version+1** tag(s).
26 | 1. Daily nightly builds, based on the upstream [tip releases](https://github.com/ghostty-org/ghostty/releases/tag/tip), are built and released at **00:00 UTC every day** and are available as pre-releases in the [releases](https://github.com/pkgforge-dev/ghostty-appimage/releases/tag/tip) section.
27 |
28 | ## 🧪 Experimental Builds (GLFW)
29 |
30 | > [!WARNING]
31 | >
32 | > Please read the following carefully before using them
33 | >
34 | > - These builds are available for both stable and daily nightly releases
35 | > - These builds use the experimental flag `-Dapp-runtime=glfw`
36 | > - They do not include bundled dependencies for Gtk and libadwaita
37 | > - Window decorations may not work on non-GNOME desktop environments (No CSD)
38 | > - Tabs and splits are not functional
39 | > - The terminal inspector does not work
40 | > - The build size is drastically reduced (around 20 MB) as 80+ dependencies are not bundled
41 | > - Please refer to the [**upstream warning notice**](https://github.com/ghostty-org/ghostty/blob/main/PACKAGING.md#build-options) for further info
42 |
43 | ## ⚙️ Installation
44 |
45 |
46 | Command Line (Manual)
47 |
48 | Run the following commands in your terminal:
49 |
50 | ```bash
51 | # Download the latest AppImage package from releases
52 | wget https://github.com/pkgforge-dev/ghostty-appimage/releases/download/${VERSION}/Ghostty-${VERSION}-${ARCH}.AppImage
53 |
54 | # Make the AppImage executable
55 | chmod +x Ghostty-${VERSION}-${ARCH}.AppImage
56 |
57 | # Run the AppImage
58 | ./Ghostty-${VERSION}-${ARCH}.AppImage
59 |
60 | # Optionally, add the AppImage to your PATH for easier access
61 |
62 | # With sudo for system wide availability
63 | sudo install ./Ghostty-${VERSION}-${ARCH}.AppImage /usr/local/bin/ghostty
64 |
65 | # Without sudo, XDG base spec mandate
66 | install ./Ghostty-${VERSION}-${ARCH}.AppImage $HOME/.local/bin/ghostty
67 |
68 | # Now you can run Ghostty from anywhere using the command:
69 | ghostty
70 | ```
71 |
72 |
73 |
74 |
75 | Command Line (Automatic)
76 |
77 | Ghostty AppImage can be accessed through [**Soar**](https://github.com/pkgforge/soar) or [**AM**](https://github.com/ivan-hc/AM)/[**AppMan**](https://github.com/ivan-hc/AppMan). These tools automate the installation process, configure the PATH, and integrate with your desktop environment when installing AppImages.
78 |
79 | 1. Using [**Soar**](https://github.com/pkgforge/soar)
80 |
81 | ```bash
82 | # Install
83 | soar install ghostty
84 |
85 | # Upgrade
86 | soar update ghostty
87 |
88 | # Uninstall
89 | soar remove ghostty
90 | ```
91 |
92 | 1. Using [**AM**](https://github.com/ivan-hc/AM) or [**AppMan**](https://github.com/ivan-hc/AppMan) _(Choose one as appropriate)_
93 |
94 | ```bash
95 | # Install
96 | am -i ghostty
97 |
98 | # Upgrade
99 | am -u ghostty
100 |
101 | # Uninstall
102 | am -r ghostty
103 | ```
104 |
105 | _Note: Ensure you have the necessary permissions to run these commands. For more detailed usage, refer to the documentation of each tool._
106 |
107 |
108 |
109 |
110 | Graphical (Manual)
111 |
112 | 1. Download the latest AppImage package from the [releases](https://github.com/pkgforge-dev/ghostty-appimage/releases) section.
113 | 2. Locate the downloaded file in your file explorer (e.g., Nautilus, Thunar, PCManFM).
114 | 3. Right-click the downloaded file and select **Properties**.
115 | 4. Navigate to the **Permissions** tab and check the box that says **Allow executing file as program/Executable as Program**.
116 | 5. Close the properties window and double-click the AppImage file to run it.
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 | Graphical (Automatic)
127 |
128 | Ghostty AppImage can easily be managed using graphical tools such as [AppImageLauncher](https://github.com/TheAssassin/AppImageLauncher) and [Gear Lever](https://github.com/mijorus/gearlever).
129 |
130 | 1. **Using [AppImageLauncher](https://github.com/TheAssassin/AppImageLauncher)**
131 |
132 | For detailed instructions, please refer to the [AppImageLauncher documentation](https://docs.appimage.org/user-guide/run-appimages.html#appimagelauncher).
133 |
134 | > **🛈 NOTE**
135 | >
136 | > With the launch of AppImageLauncher **v3.0.0**, you have to use the alpha pre-releases as the stable release doesn't work with the static runtime
137 | >
138 | > For more information please refer the [discussion](https://github.com/TheAssassin/AppImageLauncher/discussions/687) and the [comment](https://github.com/TheAssassin/AppImageLauncher/discussions/687#discussioncomment-12181060)
139 |
140 | 2. **Using [Gear Lever](https://github.com/mijorus/gearlever)**
141 |
142 | - Download the latest AppImage package from the [releases](https://github.com/pkgforge-dev/ghostty-appimage/releases) section.
143 | - Simply drag and drop the files from your file manager into the Gear Lever application.
144 | - Follow the on-screen instructions to configure the setup as a one-time installation process.
145 |
146 | _Note: Ensure the necessary prerequsites are satisfied for these applications. For more detailed usage, refer to the documentation of each tool_
147 |
148 |
149 |
150 | ## ⏫ Updating
151 |
152 | Since AppImages are self-contained executables, there is no formal installation process beyond setting executable permissions.
153 |
154 |
155 | Update (Manual)
156 |
157 | 1. Download the latest AppImage package from the [releases](https://github.com/pkgforge-dev/ghostty-appimage/releases) section.
158 | 1. Follow the same steps as in the [Installation](#installation) section to make it executable and run it.
159 |
160 |
161 |
162 |
163 | Update (Automatic)
164 |
165 | 1. Use [AppImageUpdate](https://github.com/AppImageCommunity/AppImageUpdate) which reads the update information in the AppImage. This is a low level tool.
166 | 1. Use a higher level tool that uses AppImageUpdate, like [AppImageLauncher](https://github.com/TheAssassin/AppImageLauncher), [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.
167 |
168 |
169 |
170 | ## 🛠️ Troubleshooting
171 |
172 | Refer [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) file
173 |
174 | ## 🤝 Contributing
175 |
176 | Contributions & Bugfixes are welcome. If you like to contribute, please feel free to fork the repository and submit a pull request.
177 |
178 | For any questions or discussions, please open an issue in the repository.
179 |
--------------------------------------------------------------------------------
/TROUBLESHOOTING.md:
--------------------------------------------------------------------------------
1 | ## 🛠️ Troubleshooting
2 |
3 | **Known Issues**
4 |
5 | 1. **[TERMINFO](https://ghostty.org/docs/help/terminfo) `xterm-ghostty` not-set/breaks functionality**
6 |
7 | **Fix:** Set the TERMINFO value to `xterm-256color` at runtime by running the AppImage as follows,
8 |
9 | ```bash
10 | # Option 1
11 | ❯ TERM=xterm-256color ./Ghostty-${VERSION}-${ARCH}.AppImage
12 |
13 | # Option 2: Add `export TERM=xterm-256color` to your .bashrc or .zshrc and launch the appimage normally
14 | ```
15 |
16 | 1. **Gtk-CRITICAL \*\*: 13:43:27.628: gtk_widget_unparent: assertion 'GTK_IS_WIDGET (widget)' failed**
17 |
18 | **Fix:** Referenced in [#3267](https://github.com/ghostty-org/ghostty/discussions/3267), reported/resolved at [#32](https://github.com/psadi/ghostty-appimage/issues/32)
19 |
20 | _If you encounter any errors, check the terminal for error messages that may indicate missing dependencies or other issues_
21 |
--------------------------------------------------------------------------------
/VERSION:
--------------------------------------------------------------------------------
1 | 1.1.3
2 |
--------------------------------------------------------------------------------
/assets/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pkgforge-dev/ghostty-appimage/152862e43b34b88283ad938e2bba02ade670c93c/assets/1.png
--------------------------------------------------------------------------------
/assets/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pkgforge-dev/ghostty-appimage/152862e43b34b88283ad938e2bba02ade670c93c/assets/2.png
--------------------------------------------------------------------------------
/assets/appimage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pkgforge-dev/ghostty-appimage/152862e43b34b88283ad938e2bba02ade670c93c/assets/appimage.png
--------------------------------------------------------------------------------
/assets/ghostty.appdata.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.mitchellh.ghostty
5 | MIT
6 | MIT
7 | Ghostty
8 | https://raw.githubusercontent.com/ghostty-org/ghostty/refs/heads/main/images/icons/icon_256.png
9 | Fast, native, feature-rich terminal emulator pushing modern features
10 |
11 |
12 | Ghostty is a terminal emulator that differentiates itself by being fast,
13 | feature-rich, and native. While there are many excellent terminal
14 | emulators available, they all force you to choose between speed,
15 | features, or native UIs. Ghostty provides all three.
16 |
17 |
18 |
19 | In all categories, I am not trying to claim that Ghostty is the best
20 | (i.e. the fastest, most feature-rich, or most native). But Ghostty is
21 | competitive in all three categories and Ghostty doesn't make you choose
22 | between them.
23 |
24 |
25 |
26 | Ghostty also intends to push the boundaries of what is possible with a
27 | terminal emulator by exposing modern, opt-in features that enable CLI
28 | tool developers to build more feature rich, interactive applications.
29 |
30 |
31 |
32 | While aiming for this ambitious goal, our first step is to make Ghostty
33 | one of the best fully standards compliant terminal emulator, remaining
34 | compatible with all existing shells and software while supporting all of
35 | the latest terminal innovations in the ecosystem. You can use Ghostty as
36 | a drop-in replacement for your existing terminal emulator.
37 |
38 |
39 |
40 | com.mitchellh.ghostty.desktop
41 |
42 | https://ghostty.org/
43 | https://ghostty.org/docs/about
44 | https://github.com/ghostty-org/ghostty/issues
45 |
46 |
54 |
55 |
56 | Mitchell Hashimoto
57 |
58 |
59 |
60 |
61 |
62 |
63 | Initial AppImage build.
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/assets/ghostty.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Name=Ghostty
3 | Type=Application
4 | Comment=A terminal emulator
5 | Exec=ghostty
6 | Icon=com.mitchellh.ghostty
7 | StartupWMClass=com.mitchellh.ghostty
8 | Categories=System;TerminalEmulator;Utility;
9 | Keywords=terminal;tty;pty;
10 | StartupNotify=true
11 | Terminal=false
12 | Actions=new-window;
13 | X-GNOME-UsesNotifications=true
14 | X-TerminalArgExec=-e
15 | X-TerminalArgTitle=--title=
16 | X-TerminalArgAppId=--class=
17 | X-TerminalArgDir=--working-directory=
18 | X-TerminalArgHold=--wait-after-command
19 |
20 | [Desktop Action new-window]
21 | Name=New Window
22 | Exec=ghostty
23 |
--------------------------------------------------------------------------------
/assets/ghostty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pkgforge-dev/ghostty-appimage/152862e43b34b88283ad938e2bba02ade670c93c/assets/ghostty.png
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -eux
4 |
5 | ARCH="$(uname -m)"
6 | GHOSTTY_VERSION="$(cat VERSION)"
7 | TMP_DIR="/tmp/ghostty-build"
8 | APP_DIR="${TMP_DIR}/ghostty.AppDir"
9 | PUB_KEY="RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV"
10 | UPINFO="gh-releases-zsync|$(echo "${GITHUB_REPOSITORY}" | tr '/' '|')|latest|Ghostty-*$ARCH.AppImage.zsync"
11 | APPDATA_FILE="${PWD}/assets/ghostty.appdata.xml"
12 | DESKTOP_FILE="${PWD}/assets/ghostty.desktop"
13 | LIBS2BUNDLE="./bin/ghostty /usr/lib/libEGL*"
14 | BUILD_ARGS="
15 | --summary all \
16 | --prefix ${APP_DIR} \
17 | -Doptimize=ReleaseFast \
18 | -Dcpu=baseline \
19 | -Dpie=true \
20 | -Demit-docs \
21 | -Dgtk-wayland=true \
22 | -Dgtk-x11=true"
23 |
24 | rm -rf "${TMP_DIR}"
25 |
26 | mkdir -p -- "${TMP_DIR}" "${APP_DIR}/share/metainfo" "${APP_DIR}/shared/lib"
27 |
28 | cd "${TMP_DIR}"
29 |
30 | if [ "${GHOSTTY_VERSION}" = "tip" ]; then
31 | wget "https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz" -O "ghostty-${GHOSTTY_VERSION}.tar.gz"
32 | wget "https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz.minisig" -O "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
33 | GHOSTTY_VERSION="$(tar -tf "ghostty-${GHOSTTY_VERSION}.tar.gz" --wildcards "*zig.zon.txt" | awk -F'[-/]' '{print $2"-"$3}')"
34 | mv ghostty-tip.tar.gz "ghostty-${GHOSTTY_VERSION}.tar.gz"
35 | mv ghostty-tip.tar.gz.minisig "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
36 | else
37 | wget "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_VERSION}.tar.gz"
38 | wget "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
39 | fi
40 |
41 | if [ "${GLFW}" = true ]; then
42 | BUILD_ARGS="${BUILD_ARGS} -Dapp-runtime=glfw"
43 | else
44 | LIBS2BUNDLE="${LIBS2BUNDLE} /usr/lib/gdk-pixbuf-*/*/*/*"
45 | fi
46 |
47 | minisign -V -m "ghostty-${GHOSTTY_VERSION}.tar.gz" -P "${PUB_KEY}" -s "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
48 |
49 | tar -xzmf "ghostty-${GHOSTTY_VERSION}.tar.gz"
50 |
51 | rm "ghostty-${GHOSTTY_VERSION}.tar.gz" \
52 | "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
53 |
54 | BUILD_DIR="ghostty-${GHOSTTY_VERSION}"
55 | BUILD_ARGS="${BUILD_ARGS} -Dversion-string=${GHOSTTY_VERSION}"
56 |
57 | cd "${TMP_DIR}/${BUILD_DIR}"
58 |
59 | #Fetch Zig Cache
60 | if [ -f './nix/build-support/fetch-zig-cache.sh' ]; then
61 | ZIG_GLOBAL_CACHE_DIR=/tmp/offline-cache ./nix/build-support/fetch-zig-cache.sh
62 | BUILD_ARGS="${BUILD_ARGS} --system /tmp/offline-cache/p"
63 | fi
64 |
65 | # Build Ghostty with zig
66 | zig build ${BUILD_ARGS}
67 |
68 | # Prepare AppImage -- Configure launcher script, metainfo and desktop file with icon.
69 | cd "${APP_DIR}"
70 |
71 | cp "${APPDATA_FILE}" "share/metainfo/com.mitchellh.ghostty.appdata.xml"
72 | cp "${DESKTOP_FILE}" "share/applications/com.mitchellh.ghostty.desktop"
73 |
74 | ln -s "com.mitchellh.ghostty.desktop" "share/applications/ghostty.desktop"
75 | ln -s "share/applications/com.mitchellh.ghostty.desktop" .
76 | ln -s "share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png" .
77 | ln -s "share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png" .DirIcon
78 |
79 | # bundle all libs
80 | xvfb-run -a -- sharun l -p -v -e -s -k ${LIBS2BUNDLE}
81 |
82 | # preload libpixbufloader /w ld-preload-open as svg icons breaks
83 | # either on ghostty tab bar or gnome-text-editor while config edit or both :(
84 | if [ "${GLFW}" = false ]; then
85 | mv ./shared/lib/gdk-pixbuf-2.0 ./
86 | cp -rv /opt/path-mapping.so ./shared/lib/
87 | cp -rv gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so ./shared/lib/
88 |
89 | echo 'path-mapping.so' >./.preload
90 | echo 'PATH_MAPPING=/usr/lib/gdk-pixbuf-2.0:${SHARUN_DIR}/gdk-pixbuf-2.0' >>./.env
91 | fi
92 |
93 | echo 'GHOSTTY_RESOURCES_DIR=${SHARUN_DIR}/share/ghostty' >>./.env
94 | echo 'unset ARGV0' >>./.env
95 |
96 | ln -s ./bin/ghostty ./AppRun
97 | ./sharun -g
98 |
99 | VERSION="$(./AppRun --version | awk 'FNR==1 {print $2}')"
100 | if [ -z "${VERSION}" ]; then
101 | echo "ERROR: Could not get version from ghostty binary"
102 | exit 1
103 | fi
104 |
105 | GHOSTTY_APPIMAGE="Ghostty-${VERSION}-${ARCH}.AppImage"
106 |
107 | if [ "${GLFW}" = true ]; then
108 | UPINFO="gh-releases-zsync|$(echo "${GITHUB_REPOSITORY:-no-user/no-repo}" | tr '/' '|')|latest|Ghostty_*$ARCH.AppImage.zsync"
109 | GHOSTTY_APPIMAGE="Ghostty_Glfw-${VERSION}-${ARCH}.AppImage"
110 | fi
111 |
112 | cd "${TMP_DIR}"
113 |
114 | # create app image
115 | cp "$(command -v uruntime)" ./uruntime
116 | cp "$(command -v uruntime-lite)" ./uruntime-lite
117 |
118 | # persist mount for faster launch times
119 | sed -i 's|URUNTIME_MOUNT=[0-9]|URUNTIME_MOUNT=0|' ./uruntime-lite
120 |
121 | # update info
122 | ./uruntime-lite --appimage-addupdinfo "${UPINFO}"
123 |
124 | echo "Generating AppImage"
125 | ./uruntime --appimage-mkdwarfs -f \
126 | --set-owner 0 --set-group 0 \
127 | --no-history --no-create-timestamp \
128 | --compression zstd:level=22 -S26 -B8 \
129 | --header uruntime-lite -i "${APP_DIR}" \
130 | -o "${GHOSTTY_APPIMAGE}"
131 |
132 | echo "Generating Zsync file"
133 | zsyncmake ./*.AppImage -u ./*.AppImage
134 |
--------------------------------------------------------------------------------
/setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -eux
4 |
5 | get_latest_gh_release() {
6 |
7 | gh_ref="${1}"
8 | curl -s "https://api.github.com/repos/${gh_ref}/releases/latest" | jq -r .tag_name
9 | }
10 |
11 | # Update & install OS base dependencies
12 | buildDeps="base-devel freetype2 oniguruma wget mesa file zsync appstream xorg-server-xvfb patchelf binutils strace git jq"
13 | ghosttyDeps="gtk4 libadwaita gtk4-layer-shell"
14 | rm -rf "/usr/share/libalpm/hooks/package-cleanup.hook"
15 | pacman -Syuq --needed --noconfirm --noprogressbar ${buildDeps} ${ghosttyDeps}
16 |
17 | ARCH="$(uname -m)"
18 |
19 | ZIG_VERSION="${ZIG_VERSION:-0.13.0}"
20 | PANDOC_VERSION="$(get_latest_gh_release 'jgm/pandoc')"
21 | MINISIGN_VERSION="$(get_latest_gh_release 'jedisct1/minisign')"
22 | SHARUN_VERSION="$(get_latest_gh_release 'VHSgunzo/sharun')"
23 | URUNTIME_VERSION="$(get_latest_gh_release 'VHSgunzo/uruntime')"
24 |
25 | GITHUB_BASE="https://github.com"
26 | PANDOC_BASE="${GITHUB_BASE}/jgm/pandoc/releases/download/${PANDOC_VERSION}"
27 | MINISIGN_URL="${GITHUB_BASE}/jedisct1/minisign/releases/download/${MINISIGN_VERSION}/minisign-${MINISIGN_VERSION}-linux.tar.gz"
28 | URUNTIME_URL="${GITHUB_BASE}/VHSgunzo/uruntime/releases/download/${URUNTIME_VERSION}/uruntime-appimage-dwarfs-${ARCH}"
29 | URUNTIME_LITE_URL="${GITHUB_BASE}/VHSgunzo/uruntime/releases/download/${URUNTIME_VERSION}/uruntime-appimage-dwarfs-lite-${ARCH}"
30 | LLVM_BASE="${GITHUB_BASE}/pkgforge-dev/llvm-libs-debloated/releases/download/continuous"
31 | ZIG_URL="https://ziglang.org/download/${ZIG_VERSION}/zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz"
32 | SHARUN_URL="${GITHUB_BASE}/VHSgunzo/sharun/releases/download/${SHARUN_VERSION}/sharun-${ARCH}"
33 | LD_PRELOAD_OPEN="${GITHUB_BASE}/fritzw/ld-preload-open.git"
34 |
35 | case "${ARCH}" in
36 | "x86_64")
37 | PANDOC_URL="${PANDOC_BASE}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz"
38 | LLVM_URL="${LLVM_BASE}/llvm-libs-nano-x86_64.pkg.tar.zst"
39 | LIBXML_URL="${LLVM_BASE}/libxml2-iculess-x86_64.pkg.tar.zst"
40 | MESA_URL="${LLVM_BASE}/mesa-mini-x86_64.pkg.tar.zst"
41 | ;;
42 | "aarch64")
43 | PANDOC_URL="${PANDOC_BASE}/pandoc-${PANDOC_VERSION}-linux-arm64.tar.gz"
44 | LLVM_URL="${LLVM_BASE}/llvm-libs-nano-aarch64.pkg.tar.xz"
45 | LIBXML_URL="${LLVM_BASE}/libxml2-iculess-aarch64.pkg.tar.xz"
46 | MESA_URL="${LLVM_BASE}/mesa-mini-aarch64.pkg.tar.xz"
47 | ;;
48 | *)
49 | echo "Unsupported ARCH: '${ARCH}'"
50 | exit 1
51 | ;;
52 | esac
53 |
54 | # Debloated llvm and libxml2 without libicudata
55 | wget "${LLVM_URL}" -O /tmp/llvm-libs.pkg.tar.zst
56 | wget "${LIBXML_URL}" -O /tmp/libxml2.pkg.tar.zst
57 | wget "${MESA_URL}" -O /tmp/mesa-mini.pkg.tar.zst
58 | pacman -U --noconfirm /tmp/*.pkg.tar.zst
59 |
60 | # Download & install other dependencies
61 | # zig: https://ziglang.org
62 | rm -rf /opt/zig*
63 | unlink /usr/local/bin/zig || true
64 | wget "${ZIG_URL}" -O /tmp/zig-linux.tar.xz
65 | tar -xJf /tmp/zig-linux.tar.xz -C /opt
66 | ln -s "/opt/zig-linux-${ARCH}-${ZIG_VERSION}/zig" /usr/local/bin/zig
67 |
68 | # uruntime: https://github.com/VHSgunzo/uruntime
69 | rm -rf /usr/local/bin/uruntime
70 | wget "${URUNTIME_URL}" -O /tmp/uruntime
71 | chmod +x /tmp/uruntime
72 | mv /tmp/uruntime /usr/local/bin/uruntime
73 |
74 | rm -rf /usr/local/bin/uruntime-lite
75 | wget "${URUNTIME_LITE_URL}" -O /tmp/uruntime-lite
76 | chmod +x /tmp/uruntime-lite
77 | mv /tmp/uruntime-lite /usr/local/bin/uruntime-lite
78 |
79 | # minisign: https://github.com/jedisct1/minisign
80 | rm -rf /usr/local/bin/minisign
81 | wget "${MINISIGN_URL}" -O /tmp/minisign-linux.tar.gz
82 | tar -xzf /tmp/minisign-linux.tar.gz -C /tmp
83 | mv /tmp/minisign-linux/"${ARCH}"/minisign /usr/local/bin
84 |
85 | # pandoc: https://github.com/jgm/pandoc
86 | rm -rf /usr/local/bin/pandoc*
87 | wget "${PANDOC_URL}" -O /tmp/pandoc-linux.tar.gz
88 | tar -xzf /tmp/pandoc-linux.tar.gz -C /tmp
89 | mv /tmp/"pandoc-${PANDOC_VERSION}"/bin/* /usr/local/bin
90 |
91 | # sharun: https://github.com/VHSgunzo/sharun
92 | rm -rf /usr/local/bin/sharun
93 | wget "${SHARUN_URL}" -O /usr/local/bin/sharun
94 | chmod +x /usr/local/bin/sharun
95 |
96 | # ld-preload-open: https://github.com/fritzw/ld-preload-open
97 | rm -rf /opt/path-mapping.so
98 | git clone "${LD_PRELOAD_OPEN}"
99 | (
100 | cd ld-preload-open
101 | make all
102 | mv ./path-mapping.so ../
103 | )
104 | rm -rf ld-preload-open
105 | mv ./path-mapping.so /opt/path-mapping.so
106 |
107 | # Cleanup
108 | pacman -Scc --noconfirm
109 |
110 | rm -rf \
111 | /tmp/appimagetool.AppImage \
112 | /tmp/minisign-linux* \
113 | /tmp/zig-linux.tar.xz \
114 | /tmp/pandoc* \
115 | /tmp/*.pkg.tar.zst
116 |
--------------------------------------------------------------------------------