diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0e47b35..23409c7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,7 +21,7 @@ jobs: actions: read security-events: write contents: write - name: ๐Ÿ‘ป Build Ghostty (${{ matrix.arch }}) + name: ๐Ÿ‘ป Build Ghostty (${{ matrix.arch }}) ${{ matrix.glfw == true && '(glfw)' || '' }} runs-on: ${{ matrix.runs-on }} strategy: matrix: @@ -29,9 +29,19 @@ jobs: - arch: aarch64 platform: linux/arm64 runs-on: ubuntu-24.04-arm + glfw: false - arch: x86_64 platform: linux/amd64 runs-on: ubuntu-24.04 + glfw: false + - arch: aarch64 + platform: linux/arm64 + runs-on: ubuntu-24.04-arm + glfw: true + - arch: x86_64 + platform: linux/amd64 + runs-on: ubuntu-24.04 + glfw: true container: image: ghcr.io/pkgforge-dev/archlinux:latest steps: @@ -68,11 +78,13 @@ jobs: echo "tip" > VERSION fi ./build.sh + env: + GLFW: ${{ matrix.glfw }} - name: Upload AppImage Artifacts uses: actions/upload-artifact@v4 with: - name: ghostty-appimage-${{ matrix.arch }} + name: ghostty-appimage-${{ matrix.arch }}${{ matrix.glfw == true && '-glfw' || '' }} retention-days: 7 path: /tmp/ghostty-build/Ghostty-*-${{ matrix.arch }}.AppImage* @@ -124,6 +136,14 @@ jobs: with: name: ghostty-appimage-x86_64 + - uses: actions/download-artifact@v4 + with: + name: ghostty-appimage-aarch64-glfw + + - uses: actions/download-artifact@v4 + with: + name: ghostty-appimage-x86_64-glfw + - name: Ghostty stable uses: svenstaro/upload-release-action@v2 with: @@ -152,6 +172,14 @@ jobs: with: name: ghostty-appimage-x86_64 + - uses: actions/download-artifact@v4 + with: + name: ghostty-appimage-aarch64-glfw + + - uses: actions/download-artifact@v4 + with: + name: ghostty-appimage-x86_64-glfw + - name: Ghostty Tip ("Nightly") uses: softprops/action-gh-release@v2.2.2 with: diff --git a/README.md b/README.md index 5b0fadc..b0233b2 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,21 @@ This repository provides build scripts to create a Universal AppImage for [Ghost 1. Stable builds are based on upstream releases, with minor fixes and patches released as **version+1** tag(s). 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. +## ๐Ÿงช Experimental Builds (GLFW) + +> [!WARNING] +> +> Please read the following carefully before using them +> +> - These builds are available for both stable and daily nightly releases +> - These builds use the experimental flag `-Dapp-runtime=glfw` +> - They do not include bundled dependencies for Gtk and libadwaita +> - Window decorations may not work on non-GNOME desktop environments (No CSD) +> - Tabs and splits are not functional +> - The terminal inspector does not work +> - The build size is drastically reduced (around 20 MB) as 80+ dependencies are not bundled +> - Please refer to the [**upstream warning notice**](https://github.com/ghostty-org/ghostty/blob/main/PACKAGING.md#build-options) for further info + ## โš™๏ธ Installation
diff --git a/build.sh b/build.sh index 2adca1d..5008806 100755 --- a/build.sh +++ b/build.sh @@ -12,6 +12,7 @@ PUB_KEY="RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV" UPINFO="gh-releases-zsync|$(echo "${GITHUB_REPOSITORY:-no-user/no-repo}" | tr '/' '|')|latest|*$ARCH.AppImage.zsync" APPDATA_FILE="${PWD}/assets/ghostty.appdata.xml" DESKTOP_FILE="${PWD}/assets/ghostty.desktop" +LIBS2BUNDLE="./bin/ghostty /usr/lib/libEGL*" BUILD_ARGS=" --summary all \ --prefix ${APP_DIR} \ @@ -39,6 +40,12 @@ else wget "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_VERSION}.tar.gz.minisig" fi +if [ $GLFW == true ]; then + BUILD_ARGS="${BUILD_ARGS} -Dapp-runtime=glfw" +else + LIBS2BUNDLE="${LIBS2BUNDLE} /usr/lib/gdk-pixbuf-*/*/*/*" +fi + minisign -V -m "ghostty-${GHOSTTY_VERSION}.tar.gz" -P "${PUB_KEY}" -s "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig" tar -xzmf "ghostty-${GHOSTTY_VERSION}.tar.gz" @@ -72,19 +79,19 @@ ln -s "share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png" . ln -s "share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png" .DirIcon # bundle all libs -xvfb-run -a -- sharun l -p -v -e -s -k \ - ./bin/ghostty \ - /usr/lib/libEGL* \ - /usr/lib/gdk-pixbuf-*/*/*/* +xvfb-run -a -- sharun l -p -v -e -s -k ${LIBS2BUNDLE} # preload libpixbufloader /w ld-preload-open as svg icons breaks # either on ghostty tab bar or gnome-text-editor while config edit or both :( -mv ./shared/lib/gdk-pixbuf-2.0 ./ -cp -rv /opt/path-mapping.so ./shared/lib/ -cp -rv gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so ./shared/lib/ +if [ $GLFW == false ]; then + mv ./shared/lib/gdk-pixbuf-2.0 ./ + cp -rv /opt/path-mapping.so ./shared/lib/ + cp -rv gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so ./shared/lib/ + + echo 'path-mapping.so' >./.preload + echo 'PATH_MAPPING=/usr/lib/gdk-pixbuf-2.0:${SHARUN_DIR}/gdk-pixbuf-2.0' >>./.env +fi -echo 'path-mapping.so' >./.preload -echo 'PATH_MAPPING=/usr/lib/gdk-pixbuf-2.0:${SHARUN_DIR}/gdk-pixbuf-2.0' >>./.env echo 'GHOSTTY_RESOURCES_DIR=${SHARUN_DIR}/share/ghostty' >>./.env echo 'unset ARGV0' >>./.env @@ -97,6 +104,12 @@ if [ -z "$VERSION" ]; then exit 1 fi +GHOSTTY_APPIMAGE="Ghostty-${VERSION}-${ARCH}.AppImage" + +if [ $GLFW == true ]; then + GHOSTTY_APPIMAGE="Ghostty-Glfw-${VERSION}-${ARCH}.AppImage" +fi + cd "${TMP_DIR}" # create app image @@ -115,7 +128,7 @@ echo "Generating AppImage" --no-history --no-create-timestamp \ --compression zstd:level=22 -S26 -B8 \ --header uruntime-lite -i "${APP_DIR}" \ - -o Ghostty-"${VERSION}"-"${ARCH}".AppImage + -o "${GHOSTTY_APPIMAGE}" echo "Generating Zsync file" zsyncmake *.AppImage -u *.AppImage