Skip to content

Commit 98e5a30

Browse files
committed
chore: restructure project
1 parent 99d8fbb commit 98e5a30

File tree

6 files changed

+41
-83
lines changed

6 files changed

+41
-83
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,20 @@ jobs:
5555
- name: Setup build environment
5656
run: |
5757
if [ "${{ github.event_name }}" == "schedule" ]; then
58-
export ZIG_VERSION=0.15.1
58+
ZIG_VERSION=0.15.1
5959
echo "tip" > VERSION
6060
else
61-
export ZIG_VERSION=0.14.0
61+
ZIG_VERSION=0.14.0
6262
fi
63-
ZIG_VERSION=$ZIG_VERSION ./setup.sh
63+
ZIG_VERSION=$ZIG_VERSION ./bin/setup-env.sh
6464
65-
- name: Build Ghostty AppImage
65+
- name: Build Ghostty
6666
run: |
67-
./build.sh
67+
./bin/build-ghostty.sh
68+
69+
- name: Bundle AppImage
70+
run: |
71+
./bin/bundle-appimage.sh
6872
6973
- name: Upload AppImage Artifacts
7074
uses: actions/upload-artifact@v4

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,6 @@ Since AppImages are self-contained executables, there is no formal installation
151151

152152
</details>
153153

154-
## 🛠️ Troubleshooting
155-
156-
Refer [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) file
157-
158154
## 🤝 Contributing
159155

160156
Contributions & Bugfixes are welcome. If you like to contribute, please feel free to fork the repository and submit a pull request.

TROUBLESHOOTING.md

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

build.sh renamed to bin/build-ghostty.sh

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,17 @@ ARCH="$(uname -m)"
66
GHOSTTY_VERSION="$(cat VERSION)"
77
PUB_KEY="RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV"
88

9-
export UPINFO="gh-releases-zsync|$(echo "${GITHUB_REPOSITORY}" | tr '/' '|')|latest|Ghostty-*$ARCH.AppImage.zsync"
10-
export URUNTIME_PRELOAD=1
11-
export DEPLOY_OPENGL=1
12-
export EXEC_WRAPPER=1
13-
149
rm -rf AppDir dist ghostty-*
1510

1611
BUILD_ARGS="
17-
--summary all \
18-
-Doptimize=ReleaseFast \
1912
-Dcpu=baseline \
13+
-Doptimize=ReleaseFast \
2014
-Dpie=true \
21-
-Demit-docs \
22-
-Dgtk-wayland=true \
23-
-Dgtk-x11=true"
15+
--system /tmp/offline-cache/p \
16+
-Dgtk-wayland=true \
17+
-Dgtk-x11=true \
18+
-Demit-docs=false \
19+
-Dstrip=true"
2420

2521
if [ "${GHOSTTY_VERSION}" = "tip" ]; then
2622
export UPINFO="gh-releases-zsync|$(echo "${GITHUB_REPOSITORY}" | tr '/' '|')|tip|Ghostty-*$ARCH.AppImage.zsync"
@@ -43,29 +39,8 @@ rm "ghostty-${GHOSTTY_VERSION}.tar.gz" \
4339

4440
BUILD_ARGS="${BUILD_ARGS} -Dversion-string=${GHOSTTY_VERSION}"
4541

46-
#Fetch Zig Cache
47-
if [ -f './nix/build-support/fetch-zig-cache.sh' ]; then
48-
ZIG_GLOBAL_CACHE_DIR=/tmp/offline-cache ./nix/build-support/fetch-zig-cache.sh
49-
BUILD_ARGS="${BUILD_ARGS} --system /tmp/offline-cache/p"
50-
fi
51-
52-
# Build Ghostty with zig
5342
(
5443
cd "ghostty-${GHOSTTY_VERSION}"
44+
ZIG_GLOBAL_CACHE_DIR=/tmp/offline-cache ./nix/build-support/fetch-zig-cache.sh
5545
zig build ${BUILD_ARGS}
5646
)
57-
58-
export OUTNAME="Ghostty-${GHOSTTY_VERSION}-${ARCH}.AppImage"
59-
export DESKTOP="./ghostty-${GHOSTTY_VERSION}/zig-out/share/applications/com.mitchellh.ghostty.desktop"
60-
export ICON="./ghostty-${GHOSTTY_VERSION}/zig-out/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png"
61-
62-
./quick-sharun ./ghostty-${GHOSTTY_VERSION}/zig-out/bin/ghostty
63-
cp -rf ./ghostty-${GHOSTTY_VERSION}/zig-out/share/* ./AppDir/share/
64-
echo 'unset ARGV0' >>./AppDir/.env
65-
# temp fix for https://github.com/pkgforge-dev/ghostty-appimage/issues/93
66-
ln -s /usr/share/glvnd/egl_vendor.d/10_nvidia.json ./AppDir/share/glvnd/egl_vendor.d/10_nvidia.json
67-
68-
./uruntime2appimage
69-
70-
mkdir -p ./dist
71-
mv -v ./*.AppImage* ./dist

bin/bundle-appimage.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
3+
set -eux
4+
5+
ARCH="$(uname -m)"
6+
GHOSTTY_VERSION="$(cat VERSION)"
7+
8+
export UPINFO="gh-releases-zsync|$(echo "${GITHUB_REPOSITORY}" | tr '/' '|')|latest|Ghostty-*$ARCH.AppImage.zsync"
9+
export URUNTIME_PRELOAD=1
10+
export DEPLOY_OPENGL=1
11+
export EXEC_WRAPPER=1
12+
export OUTNAME="Ghostty-${GHOSTTY_VERSION}-${ARCH}.AppImage"
13+
export DESKTOP="./ghostty-${GHOSTTY_VERSION}/zig-out/share/applications/com.mitchellh.ghostty.desktop"
14+
export ICON="./ghostty-${GHOSTTY_VERSION}/zig-out/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png"
15+
16+
./quick-sharun ./ghostty-${GHOSTTY_VERSION}/zig-out/bin/ghostty
17+
cp -rf ./ghostty-${GHOSTTY_VERSION}/zig-out/share/* ./AppDir/share/
18+
echo 'unset ARGV0' >>./AppDir/.env
19+
# temp fix for https://github.com/pkgforge-dev/ghostty-appimage/issues/93
20+
ln -s /usr/share/glvnd/egl_vendor.d/10_nvidia.json ./AppDir/share/glvnd/egl_vendor.d/10_nvidia.json
21+
22+
./uruntime2appimage
23+
24+
mkdir -p ./dist
25+
mv -v ./*.AppImage* ./dist

setup.sh renamed to bin/setup-env.sh

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ pacman -Syuq --needed --noconfirm --noprogressbar ${buildDeps} ${ghosttyDeps}
1717
ARCH="$(uname -m)"
1818

1919
ZIG_VERSION="${ZIG_VERSION:-0.14.0}"
20-
PANDOC_VERSION="$(get_latest_gh_release 'jgm/pandoc')"
2120
MINISIGN_VERSION="$(get_latest_gh_release 'jedisct1/minisign')"
2221

2322
GH_BASE="https://github.com"
2423
GH_USER_CONTENT="https://raw.githubusercontent.com"
2524

26-
PANDOC_BASE="${GH_BASE}/jgm/pandoc/releases/download/${PANDOC_VERSION}"
2725
MINISIGN_URL="${GH_BASE}/jedisct1/minisign/releases/download/${MINISIGN_VERSION}/minisign-${MINISIGN_VERSION}-linux.tar.gz"
2826

2927
ZIG_PACKAGE_NAME="zig-linux-${ARCH}-${ZIG_VERSION}"
@@ -38,19 +36,6 @@ DEBLOATED_PKGS="${GH_USER_CONTENT}/pkgforge-dev/Anylinux-AppImages/refs/heads/ma
3836
SHARUN="${GH_USER_CONTENT}/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh"
3937
URUNTIME="${GH_USER_CONTENT}/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh"
4038

41-
case "${ARCH}" in
42-
"x86_64")
43-
PANDOC_URL="${PANDOC_BASE}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz"
44-
;;
45-
"aarch64")
46-
PANDOC_URL="${PANDOC_BASE}/pandoc-${PANDOC_VERSION}-linux-arm64.tar.gz"
47-
;;
48-
*)
49-
echo "Unsupported ARCH: '${ARCH}'"
50-
exit 1
51-
;;
52-
esac
53-
5439
# Install Debloated Pkgs
5540
wget "${DEBLOATED_PKGS}" -O /tmp/get-debloated-pkgs.sh
5641
chmod a+x /tmp/get-debloated-pkgs.sh
@@ -70,12 +55,6 @@ wget "${MINISIGN_URL}" -O /tmp/minisign-linux.tar.gz
7055
tar -xzf /tmp/minisign-linux.tar.gz -C /tmp
7156
mv /tmp/minisign-linux/"${ARCH}"/minisign /usr/local/bin
7257

73-
# pandoc: https://github.com/jgm/pandoc
74-
rm -rf /usr/local/bin/pandoc*
75-
wget "${PANDOC_URL}" -O /tmp/pandoc-linux.tar.gz
76-
tar -xzf /tmp/pandoc-linux.tar.gz -C /tmp
77-
mv /tmp/"pandoc-${PANDOC_VERSION}"/bin/* /usr/local/bin
78-
7958
# Sharun
8059
wget "${SHARUN}" -O quick-sharun
8160
chmod +x quick-sharun
@@ -91,5 +70,4 @@ rm -rf \
9170
/tmp/appimagetool.AppImage \
9271
/tmp/minisign-linux* \
9372
/tmp/zig-linux.tar.xz \
94-
/tmp/pandoc* \
9573
/tmp/*.pkg.tar.zst

0 commit comments

Comments
 (0)