From 98e5a30e37e0f1281c5ad0ca146fbf67bf2a34bc Mon Sep 17 00:00:00 2001 From: psadi Date: Sat, 11 Oct 2025 18:58:28 +0530 Subject: [PATCH] chore: restructure project --- .github/workflows/ci.yaml | 14 ++++++++---- README.md | 4 ---- TROUBLESHOOTING.md | 20 ---------------- build.sh => bin/build-ghostty.sh | 39 ++++++-------------------------- bin/bundle-appimage.sh | 25 ++++++++++++++++++++ setup.sh => bin/setup-env.sh | 22 ------------------ 6 files changed, 41 insertions(+), 83 deletions(-) delete mode 100644 TROUBLESHOOTING.md rename build.sh => bin/build-ghostty.sh (59%) create mode 100755 bin/bundle-appimage.sh rename setup.sh => bin/setup-env.sh (79%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d73fd33..dd108b9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -55,16 +55,20 @@ jobs: - name: Setup build environment run: | if [ "${{ github.event_name }}" == "schedule" ]; then - export ZIG_VERSION=0.15.1 + ZIG_VERSION=0.15.1 echo "tip" > VERSION else - export ZIG_VERSION=0.14.0 + ZIG_VERSION=0.14.0 fi - ZIG_VERSION=$ZIG_VERSION ./setup.sh + ZIG_VERSION=$ZIG_VERSION ./bin/setup-env.sh - - name: Build Ghostty AppImage + - name: Build Ghostty run: | - ./build.sh + ./bin/build-ghostty.sh + + - name: Bundle AppImage + run: | + ./bin/bundle-appimage.sh - name: Upload AppImage Artifacts uses: actions/upload-artifact@v4 diff --git a/README.md b/README.md index 09dec20..d28b34b 100644 --- a/README.md +++ b/README.md @@ -151,10 +151,6 @@ Since AppImages are self-contained executables, there is no formal installation -## 🛠️ Troubleshooting - -Refer [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) file - ## 🤝 Contributing Contributions & Bugfixes are welcome. If you like to contribute, please feel free to fork the repository and submit a pull request. diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md deleted file mode 100644 index 24c8978..0000000 --- a/TROUBLESHOOTING.md +++ /dev/null @@ -1,20 +0,0 @@ -## 🛠️ Troubleshooting - -**Known Issues** - -1. **[TERMINFO](https://ghostty.org/docs/help/terminfo) `xterm-ghostty` not-set/breaks functionality** - - **Fix:** Set the TERMINFO value to `xterm-256color` at runtime by running the AppImage as follows, - - ```bash - # Option 1 - ❯ TERM=xterm-256color ./Ghostty-${VERSION}-${ARCH}.AppImage - - # Option 2: Add `export TERM=xterm-256color` to your .bashrc or .zshrc and launch the appimage normally - ``` - -1. **Gtk-CRITICAL \*\*: 13:43:27.628: gtk_widget_unparent: assertion 'GTK_IS_WIDGET (widget)' failed** - - **Fix:** Referenced in [#3267](https://github.com/ghostty-org/ghostty/discussions/3267), reported/resolved at [#32](https://github.com/psadi/ghostty-appimage/issues/32) - -_If you encounter any errors, check the terminal for error messages that may indicate missing dependencies or other issues_ diff --git a/build.sh b/bin/build-ghostty.sh similarity index 59% rename from build.sh rename to bin/build-ghostty.sh index 034bc55..f263b12 100755 --- a/build.sh +++ b/bin/build-ghostty.sh @@ -6,21 +6,17 @@ ARCH="$(uname -m)" GHOSTTY_VERSION="$(cat VERSION)" PUB_KEY="RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV" -export UPINFO="gh-releases-zsync|$(echo "${GITHUB_REPOSITORY}" | tr '/' '|')|latest|Ghostty-*$ARCH.AppImage.zsync" -export URUNTIME_PRELOAD=1 -export DEPLOY_OPENGL=1 -export EXEC_WRAPPER=1 - rm -rf AppDir dist ghostty-* BUILD_ARGS=" - --summary all \ - -Doptimize=ReleaseFast \ -Dcpu=baseline \ + -Doptimize=ReleaseFast \ -Dpie=true \ - -Demit-docs \ - -Dgtk-wayland=true \ - -Dgtk-x11=true" + --system /tmp/offline-cache/p \ + -Dgtk-wayland=true \ + -Dgtk-x11=true \ + -Demit-docs=false \ + -Dstrip=true" if [ "${GHOSTTY_VERSION}" = "tip" ]; then export UPINFO="gh-releases-zsync|$(echo "${GITHUB_REPOSITORY}" | tr '/' '|')|tip|Ghostty-*$ARCH.AppImage.zsync" @@ -43,29 +39,8 @@ rm "ghostty-${GHOSTTY_VERSION}.tar.gz" \ BUILD_ARGS="${BUILD_ARGS} -Dversion-string=${GHOSTTY_VERSION}" -#Fetch Zig Cache -if [ -f './nix/build-support/fetch-zig-cache.sh' ]; then - ZIG_GLOBAL_CACHE_DIR=/tmp/offline-cache ./nix/build-support/fetch-zig-cache.sh - BUILD_ARGS="${BUILD_ARGS} --system /tmp/offline-cache/p" -fi - -# Build Ghostty with zig ( cd "ghostty-${GHOSTTY_VERSION}" + ZIG_GLOBAL_CACHE_DIR=/tmp/offline-cache ./nix/build-support/fetch-zig-cache.sh zig build ${BUILD_ARGS} ) - -export OUTNAME="Ghostty-${GHOSTTY_VERSION}-${ARCH}.AppImage" -export DESKTOP="./ghostty-${GHOSTTY_VERSION}/zig-out/share/applications/com.mitchellh.ghostty.desktop" -export ICON="./ghostty-${GHOSTTY_VERSION}/zig-out/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png" - -./quick-sharun ./ghostty-${GHOSTTY_VERSION}/zig-out/bin/ghostty -cp -rf ./ghostty-${GHOSTTY_VERSION}/zig-out/share/* ./AppDir/share/ -echo 'unset ARGV0' >>./AppDir/.env -# temp fix for https://github.com/pkgforge-dev/ghostty-appimage/issues/93 -ln -s /usr/share/glvnd/egl_vendor.d/10_nvidia.json ./AppDir/share/glvnd/egl_vendor.d/10_nvidia.json - -./uruntime2appimage - -mkdir -p ./dist -mv -v ./*.AppImage* ./dist diff --git a/bin/bundle-appimage.sh b/bin/bundle-appimage.sh new file mode 100755 index 0000000..b1bbd0a --- /dev/null +++ b/bin/bundle-appimage.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set -eux + +ARCH="$(uname -m)" +GHOSTTY_VERSION="$(cat VERSION)" + +export UPINFO="gh-releases-zsync|$(echo "${GITHUB_REPOSITORY}" | tr '/' '|')|latest|Ghostty-*$ARCH.AppImage.zsync" +export URUNTIME_PRELOAD=1 +export DEPLOY_OPENGL=1 +export EXEC_WRAPPER=1 +export OUTNAME="Ghostty-${GHOSTTY_VERSION}-${ARCH}.AppImage" +export DESKTOP="./ghostty-${GHOSTTY_VERSION}/zig-out/share/applications/com.mitchellh.ghostty.desktop" +export ICON="./ghostty-${GHOSTTY_VERSION}/zig-out/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png" + +./quick-sharun ./ghostty-${GHOSTTY_VERSION}/zig-out/bin/ghostty +cp -rf ./ghostty-${GHOSTTY_VERSION}/zig-out/share/* ./AppDir/share/ +echo 'unset ARGV0' >>./AppDir/.env +# temp fix for https://github.com/pkgforge-dev/ghostty-appimage/issues/93 +ln -s /usr/share/glvnd/egl_vendor.d/10_nvidia.json ./AppDir/share/glvnd/egl_vendor.d/10_nvidia.json + +./uruntime2appimage + +mkdir -p ./dist +mv -v ./*.AppImage* ./dist diff --git a/setup.sh b/bin/setup-env.sh similarity index 79% rename from setup.sh rename to bin/setup-env.sh index 0164c16..480b38c 100755 --- a/setup.sh +++ b/bin/setup-env.sh @@ -17,13 +17,11 @@ pacman -Syuq --needed --noconfirm --noprogressbar ${buildDeps} ${ghosttyDeps} ARCH="$(uname -m)" ZIG_VERSION="${ZIG_VERSION:-0.14.0}" -PANDOC_VERSION="$(get_latest_gh_release 'jgm/pandoc')" MINISIGN_VERSION="$(get_latest_gh_release 'jedisct1/minisign')" GH_BASE="https://github.com" GH_USER_CONTENT="https://raw.githubusercontent.com" -PANDOC_BASE="${GH_BASE}/jgm/pandoc/releases/download/${PANDOC_VERSION}" MINISIGN_URL="${GH_BASE}/jedisct1/minisign/releases/download/${MINISIGN_VERSION}/minisign-${MINISIGN_VERSION}-linux.tar.gz" ZIG_PACKAGE_NAME="zig-linux-${ARCH}-${ZIG_VERSION}" @@ -38,19 +36,6 @@ DEBLOATED_PKGS="${GH_USER_CONTENT}/pkgforge-dev/Anylinux-AppImages/refs/heads/ma SHARUN="${GH_USER_CONTENT}/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh" URUNTIME="${GH_USER_CONTENT}/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh" -case "${ARCH}" in -"x86_64") - PANDOC_URL="${PANDOC_BASE}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz" - ;; -"aarch64") - PANDOC_URL="${PANDOC_BASE}/pandoc-${PANDOC_VERSION}-linux-arm64.tar.gz" - ;; -*) - echo "Unsupported ARCH: '${ARCH}'" - exit 1 - ;; -esac - # Install Debloated Pkgs wget "${DEBLOATED_PKGS}" -O /tmp/get-debloated-pkgs.sh chmod a+x /tmp/get-debloated-pkgs.sh @@ -70,12 +55,6 @@ wget "${MINISIGN_URL}" -O /tmp/minisign-linux.tar.gz tar -xzf /tmp/minisign-linux.tar.gz -C /tmp mv /tmp/minisign-linux/"${ARCH}"/minisign /usr/local/bin -# pandoc: https://github.com/jgm/pandoc -rm -rf /usr/local/bin/pandoc* -wget "${PANDOC_URL}" -O /tmp/pandoc-linux.tar.gz -tar -xzf /tmp/pandoc-linux.tar.gz -C /tmp -mv /tmp/"pandoc-${PANDOC_VERSION}"/bin/* /usr/local/bin - # Sharun wget "${SHARUN}" -O quick-sharun chmod +x quick-sharun @@ -91,5 +70,4 @@ rm -rf \ /tmp/appimagetool.AppImage \ /tmp/minisign-linux* \ /tmp/zig-linux.tar.xz \ - /tmp/pandoc* \ /tmp/*.pkg.tar.zst