Skip to content

Commit ffff221

Browse files
author
psadi
committed
added scripts
1 parent 86f02b7 commit ffff221

File tree

5 files changed

+97
-57
lines changed

5 files changed

+97
-57
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,23 @@ permissions:
1414
jobs:
1515
build:
1616
name: Build Ghostty
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-24.04
1818
container:
1919
image: ubuntu:24.04
20+
options: "--privileged --cap-add SYS_ADMIN --device /dev/fuse"
2021
steps:
2122
- name: Checkout ghostty-appimage
2223
uses: actions/checkout@v4
2324

2425
- name: Setup Build Env
25-
run: ./setup-env.sh
26+
run: ./setup.sh
2627

2728
- name: Build Ghostty
28-
run: just setup compile extract
29+
run: ./build.sh
2930

3031
- name: Upload Artifact
3132
uses: actions/upload-artifact@v4
3233
with:
3334
name: Ghostty_AppImage
3435
retention-days: 7
35-
path: Ghostty-*.AppImage
36+
path: /tmp/ghostty-build/Ghostty-*.AppImage

Justfile

Lines changed: 0 additions & 29 deletions
This file was deleted.

build.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
GHOSTTY_VERSION="1.0.1"
6+
TMP_DIR="/tmp/ghostty-build"
7+
APP_DIR="${TMP_DIR}/ghostty.AppDir"
8+
PUB_KEY="RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV"
9+
10+
rm -rf "${TMP_DIR}"
11+
12+
mkdir -p -- "${TMP_DIR}" "${APP_DIR}/usr"
13+
14+
cd "${TMP_DIR}"
15+
16+
wget -q "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_VERSION}.tar.gz"
17+
wget -q "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
18+
19+
minisign -V -m "ghostty-${GHOSTTY_VERSION}.tar.gz" -P "${PUB_KEY}" -s "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
20+
21+
rm ghostty-${GHOSTTY_VERSION}.tar.gz.minisig
22+
23+
tar -xzmf "ghostty-${GHOSTTY_VERSION}.tar.gz"
24+
25+
rm "ghostty-${GHOSTTY_VERSION}.tar.gz"
26+
27+
cd "${TMP_DIR}/ghostty-${GHOSTTY_VERSION}"
28+
29+
sed -i 's/linkSystemLibrary2("bzip2", dynamic_link_opts)/linkSystemLibrary2("bz2", dynamic_link_opts)/' build.zig
30+
31+
# Fetch Zig Cache
32+
ZIG_GLOBAL_CACHE_DIR=/tmp/offline-cache ./nix/build-support/fetch-zig-cache.sh
33+
34+
# Build Ghostty with zig
35+
zig build \
36+
--summary all \
37+
--prefix "${APP_DIR}/usr" \
38+
--system /tmp/offline-cache/p \
39+
-Doptimize=ReleaseFast \
40+
-Dcpu=baseline \
41+
-Dpie=true \
42+
-Demit-docs \
43+
-Dversion-string="${GHOSTTY_VERSION}"
44+
45+
cd "${APP_DIR}"
46+
47+
# prep appimage
48+
printf '#!/bin/sh\n\nexec "$(dirname "$(readlink -f "$0")")/usr/bin/ghostty"\n' | tee AppRun > /dev/null
49+
chmod +x AppRun
50+
ln -s usr/share/applications/com.mitchellh.ghostty.desktop
51+
ln -s usr/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png
52+
53+
cd "${TMP_DIR}"
54+
# create app image
55+
ARCH=x8_64 appimagetool "${APP_DIR}"

setup-env.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

setup.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
export DEBIAN_FRONTEND="noninteractive"
6+
7+
ZIG_VERSION="0.13.0"
8+
9+
# update & install os base dependencies
10+
buildPkgs="build-essential libbz2-dev pandoc wget fuse libfuse2t64"
11+
ghosttyPkgs="libgtk-4-dev libadwaita-1-dev"
12+
apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq -y install $buildPkgs $ghosttyPkgs
13+
14+
# configure fuse
15+
16+
# modprobe -v fuse
17+
#adduser $USER fuse
18+
#printf 'fuse' | tee /etc/modules > /dev/null
19+
#sed -i 's/^#user_allow_other/user_allow_other/' /etc/fuse.conf
20+
21+
# download & install other dependencie
22+
# appimagetool: https://github.com/AppImage/appimagetool
23+
wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
24+
install appimagetool-x86_64.AppImage /usr/local/bin/appimagetool
25+
rm appimagetool-x86_64.AppImage
26+
27+
# minisign: https://github.com/jedisct1/minisign
28+
wget -q "https://github.com/jedisct1/minisign/releases/download/0.11/minisign-0.11-linux.tar.gz"
29+
tar -xzf minisign-0.11-linux.tar.gz
30+
mv minisign-linux/x86_64/minisign /usr/local/bin
31+
rm -r minisign-0.11-linux.tar.gz
32+
33+
# zig: https://ziglang.org
34+
wget -q "https://ziglang.org/download/$ZIG_VERSION/zig-linux-x86_64-$ZIG_VERSION.tar.xz"
35+
tar -xf "zig-linux-x86_64-$ZIG_VERSION.tar.xz" -C /opt
36+
rm "zig-linux-x86_64-$ZIG_VERSION.tar.xz"
37+
ln -s "/opt/zig-linux-x86_64-$ZIG_VERSION/zig" /usr/local/bin/zig

0 commit comments

Comments
 (0)