diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 222828b..b299657 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,10 +36,13 @@ jobs: image: ghcr.io/pkgforge-dev/archlinux:latest steps: - name: Checkout ghostty-appimage - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: persist-credentials: false + - name: Preparing Container + uses: pkgforge-dev/anylinux-setup-action@0964f2258d6c93d1391359978dde081fd8b3c6af # v2 + - name: Cache dependencies id: cache-ghostty uses: actions/cache@v4 @@ -55,27 +58,24 @@ jobs: - name: Setup build environment run: | if [ "${{ github.event_name }}" == "schedule" ]; then - ZIG_VERSION=0.14.0 - else - ZIG_VERSION=0.13.0 + echo "tip" > VERSION fi + ./bin/setup-env.sh - sed -i "s/#ZIG_VERSION/${ZIG_VERSION}/g" setup.sh - ./setup.sh + - name: Build Ghostty + run: | + ./bin/build-ghostty.sh - - name: Build Ghostty AppImage + - name: Bundle AppImage run: | - if [ "${{ github.event_name }}" == "schedule" ]; then - echo "tip" > VERSION - fi - ./build.sh + ./bin/bundle-appimage.sh - name: Upload AppImage Artifacts uses: actions/upload-artifact@v4 with: name: ghostty-appimage-${{ matrix.arch }} retention-days: 7 - path: /tmp/ghostty-build/Ghostty-*-${{ matrix.arch }}.AppImage* + path: dist tag: name: "👻 Tip Tag" @@ -88,12 +88,23 @@ jobs: needs: - build_appimage steps: - - uses: actions/checkout@v4 # zizmor: ignore[artipacked] - - name: Tip Tag + - uses: actions/checkout@v5 # zizmor: ignore[artipacked] + + - name: Clean-up Old Release Assets + run: | + gh release view tip --json assets --jq '.assets[].name' | while read -r asset; do + if [ -n "$asset" ]; then + gh release delete-asset tip "${asset}" -y + fi + done + env: + GH_TOKEN: ${{ github.token }} + + - name: Create 'tip' tag run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git tag -fa tip -m "Latest Continuous Release" ${GITHUB_SHA} + git tag -fa tip -m "Latest Continuous Release" "${GITHUB_SHA}" git push --force origin tip release_stable: @@ -106,11 +117,11 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event_name == 'release' }} steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v6 with: name: ghostty-appimage-aarch64 - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v6 with: name: ghostty-appimage-x86_64 @@ -134,16 +145,16 @@ jobs: contents: write runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v6 with: name: ghostty-appimage-aarch64 - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v6 with: name: ghostty-appimage-x86_64 - name: Ghostty Tip ("Nightly") - uses: softprops/action-gh-release@v2.2.1 + uses: softprops/action-gh-release@v3.0.1 with: name: '👻 Ghostty Tip ("Nightly")' prerelease: true diff --git a/.gitignore b/.gitignore index a760406..1fb216c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,10 @@ Sessionx.vim tags # Persistent undo [._]*.un~ + +AppDir +ghostty-* +quick-sharun +uruntime2appimage +dist +appinfo diff --git a/README.md b/README.md index 5b0fadc..0abdb42 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Run the following commands in your terminal: ```bash # Download the latest AppImage package from releases -wget https://github.com/pkgforge-dev/ghostty-appimage/releases/download/${VERSION}/Ghostty-${VERSION}-${ARCH}.AppImage +wget https://github.com/pkgforge-dev/ghostty-appimage/releases/download/v${VERSION}/Ghostty-${VERSION}-${ARCH}.AppImage # Make the AppImage executable chmod +x Ghostty-${VERSION}-${ARCH}.AppImage @@ -110,25 +110,26 @@ _Note: Ensure you have the necessary permissions to run these commands. For more
Graphical (Automatic) -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). +Ghostty AppImage can easily be managed using graphical tools such as [AppManager](https://github.com/kem-a/AppManager) and [Gear Lever](https://github.com/mijorus/gearlever). -1. **Using [AppImageLauncher](https://github.com/TheAssassin/AppImageLauncher)** - - For detailed instructions, please refer to the [AppImageLauncher documentation](https://docs.appimage.org/user-guide/run-appimages.html#appimagelauncher). - - > **🛈 NOTE** - > - > 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 - > - > 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) +1. **Using [AppManager](https://github.com/kem-a/AppManager)** + - Download the latest AppImage package from the [releases](https://github.com/pkgforge-dev/ghostty-appimage/releases) section. + - Simply drag and drop the files from your file manager into the AppManager application. + - Follow the on-screen instructions to configure the setup as a one-time installation process. 2. **Using [Gear Lever](https://github.com/mijorus/gearlever)** - - Download the latest AppImage package from the [releases](https://github.com/pkgforge-dev/ghostty-appimage/releases) section. - Simply drag and drop the files from your file manager into the Gear Lever application. - Follow the on-screen instructions to configure the setup as a one-time installation process. -_Note: Ensure the necessary prerequsites are satisfied for these applications. For more detailed usage, refer to the documentation of each tool_ +> **🛈 NOTE** +> Ensure the necessary prerequsites are satisfied for these applications. For more detailed usage, refer to the documentation of each tool + +> **🛈 NOTE** + Gearlever does not support delta updates with zsync and you may need to give it the URL to update manually. + +> **🛈 NOTE** + Gearlever does not have official AppImage releases. You can use [this one](https://github.com/pkgforge-dev/Gear-Lever-AppImage) however.
@@ -154,7 +155,7 @@ Since AppImages are self-contained executables, there is no formal installation ## 🛠️ Troubleshooting -Refer [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) file +See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for known issues and fixes. ## 🤝 Contributing diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 24c8978..fcea981 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -1,20 +1,30 @@ -## 🛠️ Troubleshooting +# Troubleshooting -**Known Issues** +## `Error opening terminal: xterm-ghostty` when using `sudo` -1. **[TERMINFO](https://ghostty.org/docs/help/terminfo) `xterm-ghostty` not-set/breaks functionality** +Ghostty sets `TERM=xterm-ghostty`, but the terminfo entry is bundled inside the AppImage and is not installed on the host system. When you run a terminal application via `sudo` (e.g., `sudo aptitude`, `sudo vim`), the root environment cannot find the terminfo entry and fails with: - **Fix:** Set the TERMINFO value to `xterm-256color` at runtime by running the AppImage as follows, +``` +Error opening terminal: xterm-ghostty. +``` - ```bash - # Option 1 - ❯ TERM=xterm-256color ./Ghostty-${VERSION}-${ARCH}.AppImage +**Fix:** extract the terminfo entry from the AppImage and install it system-wide. - # Option 2: Add `export TERM=xterm-256color` to your .bashrc or .zshrc and launch the appimage normally - ``` +```bash +# Extract the terminfo entry into a temporary directory +tmpdir=$(mktemp -d /tmp/ghostty-appimage.XXXXXX) +(cd "$tmpdir" && /path/to/Ghostty.AppImage --appimage-extract share/terminfo/x/xterm-ghostty) -1. **Gtk-CRITICAL \*\*: 13:43:27.628: gtk_widget_unparent: assertion 'GTK_IS_WIDGET (widget)' failed** +# Install for the current user +mkdir -p ~/.local/share/terminfo/x +cp "$tmpdir/squashfs-root/share/terminfo/x/xterm-ghostty" ~/.local/share/terminfo/x/ - **Fix:** Referenced in [#3267](https://github.com/ghostty-org/ghostty/discussions/3267), reported/resolved at [#32](https://github.com/psadi/ghostty-appimage/issues/32) +# Install system-wide so root and sudo can find it +sudo mkdir -p /usr/share/terminfo/x +sudo cp "$tmpdir/squashfs-root/share/terminfo/x/xterm-ghostty" /usr/share/terminfo/x/ -_If you encounter any errors, check the terminal for error messages that may indicate missing dependencies or other issues_ +# Clean up +rm -rf "$tmpdir" +``` + +This only needs to be done once, or again after upgrading to a new AppImage release. diff --git a/VERSION b/VERSION index 781dcb0..3a3cd8c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.3 +1.3.1 diff --git a/assets/ghostty.appdata.xml b/assets/ghostty.appdata.xml deleted file mode 100644 index 723a1f5..0000000 --- a/assets/ghostty.appdata.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - com.mitchellh.ghostty - MIT - MIT - Ghostty - https://raw.githubusercontent.com/ghostty-org/ghostty/refs/heads/main/images/icons/icon_256.png - Fast, native, feature-rich terminal emulator pushing modern features - -

- Ghostty is a terminal emulator that differentiates itself by being fast, - feature-rich, and native. While there are many excellent terminal - emulators available, they all force you to choose between speed, - features, or native UIs. Ghostty provides all three. -

- -

- In all categories, I am not trying to claim that Ghostty is the best - (i.e. the fastest, most feature-rich, or most native). But Ghostty is - competitive in all three categories and Ghostty doesn't make you choose - between them. -

- -

- Ghostty also intends to push the boundaries of what is possible with a - terminal emulator by exposing modern, opt-in features that enable CLI - tool developers to build more feature rich, interactive applications. -

- -

- While aiming for this ambitious goal, our first step is to make Ghostty - one of the best fully standards compliant terminal emulator, remaining - compatible with all existing shells and software while supporting all of - the latest terminal innovations in the ecosystem. You can use Ghostty as - a drop-in replacement for your existing terminal emulator. -

-
- - com.mitchellh.ghostty.desktop - - https://ghostty.org/ - https://ghostty.org/docs/about - https://github.com/ghostty-org/ghostty/issues - - - - - Mitchell Hashimoto - - - - - -

- Initial AppImage build. -

-
-
-
-
diff --git a/assets/ghostty.desktop b/assets/ghostty.desktop deleted file mode 100644 index 35aa68c..0000000 --- a/assets/ghostty.desktop +++ /dev/null @@ -1,22 +0,0 @@ -[Desktop Entry] -Name=Ghostty -Type=Application -Comment=A terminal emulator -Exec=ghostty -Icon=com.mitchellh.ghostty -StartupWMClass=com.mitchellh.ghostty -Categories=System;TerminalEmulator;Utility; -Keywords=terminal;tty;pty; -StartupNotify=true -Terminal=false -Actions=new-window; -X-GNOME-UsesNotifications=true -X-TerminalArgExec=-e -X-TerminalArgTitle=--title= -X-TerminalArgAppId=--class= -X-TerminalArgDir=--working-directory= -X-TerminalArgHold=--wait-after-command - -[Desktop Action new-window] -Name=New Window -Exec=ghostty diff --git a/bin/build-ghostty.sh b/bin/build-ghostty.sh new file mode 100755 index 0000000..afda651 --- /dev/null +++ b/bin/build-ghostty.sh @@ -0,0 +1,67 @@ +#!/bin/sh + +set -eux + +ARCH="$(uname -m)" +GHOSTTY_VERSION="$(cat VERSION)" +PUB_KEY="RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV" + +rm -rf AppDir dist ghostty-* + +BUILD_ARGS=" + -Dcpu=baseline \ + -Doptimize=ReleaseFast \ + -Dpie=true \ + --system /tmp/offline-cache/p \ + -fno-sys=freetype \ + -fno-sys=zlib \ + -fno-sys=libpng \ + -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" + wget "https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz" -O "ghostty-${GHOSTTY_VERSION}.tar.gz" + wget "https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz.minisig" -O "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig" + GHOSTTY_VERSION="$(tar -tf "ghostty-${GHOSTTY_VERSION}.tar.gz" --wildcards "*zig.zon.txt" | awk '-F[-/]' '{print $2"-"$3"-"$4}')" + echo "${GHOSTTY_VERSION}" >VERSION + mv ghostty-tip.tar.gz "ghostty-${GHOSTTY_VERSION}.tar.gz" + mv ghostty-tip.tar.gz.minisig "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig" +else + wget "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_VERSION}.tar.gz" + wget "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_VERSION}.tar.gz.minisig" +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" + +rm "ghostty-${GHOSTTY_VERSION}.tar.gz" \ + "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig" + +BUILD_ARGS="${BUILD_ARGS} -Dversion-string=${GHOSTTY_VERSION}" + +# Configure Zig: https://ziglang.org +ZIG_VERSION="$(cat "ghostty-${GHOSTTY_VERSION}/build.zig.zon" | grep ".minimum_zig_version" | cut -d'"' -f2)" +ZIG_PACKAGE_NAME="zig-${ARCH}-linux-${ZIG_VERSION}" +CURRENT_ZIG_VERSION=$(zig version 2>/dev/null || true) +if [ "$CURRENT_ZIG_VERSION" != "$ZIG_VERSION" ]; then + echo "Installing Zig ${ZIG_VERSION}..." + ZIG_URL="https://ziglang.org/download/${ZIG_VERSION}/${ZIG_PACKAGE_NAME}.tar.xz" + rm -rf /opt/zig* + unlink /usr/local/bin/zig || true + wget "${ZIG_URL}" -O /tmp/zig-linux.tar.xz + tar -xJf /tmp/zig-linux.tar.xz -C /opt + ln -s "/opt/${ZIG_PACKAGE_NAME}/zig" /usr/local/bin/zig + echo "Zig ${ZIG_VERSION} installed successfully" +else + echo "Zig ${ZIG_VERSION} is already installed, skipping installation" +fi + +( + cd "ghostty-${GHOSTTY_VERSION}" + ZIG_GLOBAL_CACHE_DIR=/tmp/offline-cache ./nix/build-support/fetch-zig-cache.sh + zig build ${BUILD_ARGS} +) diff --git a/bin/bundle-appimage.sh b/bin/bundle-appimage.sh new file mode 100755 index 0000000..16b6954 --- /dev/null +++ b/bin/bundle-appimage.sh @@ -0,0 +1,21 @@ +#!/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 DEPLOY_OPENGL=1 +export EXEC_WRAPPER=1 +export URUNTIME_PRELOAD=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/ +quick-sharun --make-appimage + +mkdir -p ./dist +mv -v ./*.AppImage* ./dist diff --git a/bin/setup-env.sh b/bin/setup-env.sh new file mode 100755 index 0000000..ea5c43a --- /dev/null +++ b/bin/setup-env.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +set -eux + +get_latest_gh_release() { + + gh_ref="${1}" + curl -s "https://api.github.com/repos/${gh_ref}/releases/latest" | jq -r .tag_name +} + +# Update & install OS base dependencies +buildDeps="base-devel freetype2 oniguruma wget mesa file zsync appstream xorg-server-xvfb patchelf binutils strace git jq" +ghosttyDeps="gtk4 libadwaita gtk4-layer-shell" +rm -rf "/usr/share/libalpm/hooks/package-cleanup.hook" +pacman -Syuq --needed --noconfirm --noprogressbar ${buildDeps} ${ghosttyDeps} + +# GCC 15+ compiles glibc crt startup objects with .sframe sections that use R_X86_64_PC64 +# relocations. Zig's self-hosted linker doesn't support this relocation type, causing +# build-time helpers (e.g. ghostty-build-data) to fail. Strip .sframe and its associated +# relocation section from the affected objects so the linker never encounters them. +for _crt in /usr/lib/crt1.o /usr/lib/Scrt1.o /usr/lib/rcrt1.o; do + [ -f "$_crt" ] && objcopy --remove-section .sframe --remove-section .rela.sframe "$_crt" +done + +ARCH="$(uname -m)" + +MINISIGN_VERSION="$(get_latest_gh_release 'jedisct1/minisign')" + +GH_BASE="https://github.com" + +MINISIGN_URL="${GH_BASE}/jedisct1/minisign/releases/download/${MINISIGN_VERSION}/minisign-${MINISIGN_VERSION}-linux.tar.gz" + +# Install Debloated Pkgs (get-debloated-pkgs provided by anylinux-setup-action) +get-debloated-pkgs --add-common --prefer-nano + +# minisign: https://github.com/jedisct1/minisign +rm -rf /usr/local/bin/minisign +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 + +# Cleanup +pacman -Scc --noconfirm + +rm -rf \ + /tmp/appimagetool.AppImage \ + /tmp/minisign-linux* \ + /tmp/zig-linux.tar.xz diff --git a/build.sh b/build.sh deleted file mode 100755 index de5737d..0000000 --- a/build.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh - -set -eux - -export ARCH="$(uname -m)" -export APPIMAGE_EXTRACT_AND_RUN=1 - -GHOSTTY_VERSION="$(cat VERSION)" -TMP_DIR="/tmp/ghostty-build" -APP_DIR="${TMP_DIR}/ghostty.AppDir" -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" -BUILD_ARGS=" - --summary all \ - --prefix ${APP_DIR} \ - -Doptimize=ReleaseFast \ - -Dcpu=baseline \ - -Dpie=true \ - -Demit-docs \ - -Dgtk-wayland=true \ - -Dgtk-x11=true" - -rm -rf "${TMP_DIR}" - -mkdir -p -- "${TMP_DIR}" "${APP_DIR}/share/metainfo" "${APP_DIR}/shared/lib" - -cd "${TMP_DIR}" - -if [ $GHOSTTY_VERSION == "tip" ]; then - wget "https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz" -O ghostty-${GHOSTTY_VERSION}.tar.gz - wget "https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz.minisig" -O ghostty-${GHOSTTY_VERSION}.tar.gz.minisig - GHOSTTY_VERSION="$(tar -tf ghostty-${GHOSTTY_VERSION}.tar.gz --wildcards "*zig.zon.txt" | awk -F'[-/]' '{print $2"-"$3}')" - mv ghostty-tip.tar.gz ghostty-${GHOSTTY_VERSION}.tar.gz - mv ghostty-tip.tar.gz.minisig ghostty-${GHOSTTY_VERSION}.tar.gz.minisig -else - wget "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_VERSION}.tar.gz" - wget "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_VERSION}.tar.gz.minisig" -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" - -rm "ghostty-${GHOSTTY_VERSION}.tar.gz" \ - "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig" - -BUILD_DIR="ghostty-${GHOSTTY_VERSION}" -BUILD_ARGS="${BUILD_ARGS} -Dversion-string=${GHOSTTY_VERSION}" - -cd "${TMP_DIR}/${BUILD_DIR}" - -#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 -zig build ${BUILD_ARGS} - -# Prepare AppImage -- Configure launcher script, metainfo and desktop file with icon. -cd "${APP_DIR}" - -cp "${APPDATA_FILE}" "share/metainfo/com.mitchellh.ghostty.appdata.xml" -cp "${DESKTOP_FILE}" "share/applications/com.mitchellh.ghostty.desktop" - -ln -s "com.mitchellh.ghostty.desktop" "share/applications/ghostty.desktop" -ln -s "share/applications/com.mitchellh.ghostty.desktop" . -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-*/*/*/* - -# 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/ - -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 - -ln -s ./bin/ghostty ./AppRun -./sharun -g - -export VERSION="$(./AppRun --version | awk 'FNR==1 {print $2}')" -if [ -z "$VERSION" ]; then - echo "ERROR: Could not get version from ghostty binary" - exit 1 -fi - -cd "${TMP_DIR}" - -# create app image -cp $(command -v uruntime) ./uruntime - -# persist mount for faster launch times -sed -i 's|URUNTIME_MOUNT=[0-9]|URUNTIME_MOUNT=0|' ./uruntime - -# update info -./uruntime --appimage-addupdinfo "${UPINFO}" - -echo "Generating AppImage" -./uruntime --appimage-mkdwarfs -f \ - --set-owner 0 --set-group 0 \ - --no-history --no-create-timestamp \ - --compression zstd:level=22 -S26 -B32 \ - --header uruntime -i "${APP_DIR}" \ - -o Ghostty-"${VERSION}"-"${ARCH}".AppImage - -echo "Generating Zsync file" -zsyncmake *.AppImage -u *.AppImage diff --git a/setup.sh b/setup.sh deleted file mode 100755 index d1807bc..0000000 --- a/setup.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh - -set -eux - -get_latest_gh_release() { - - local gh_ref="${1}" - local version - curl -s "https://api.github.com/repos/${gh_ref}/releases/latest" | jq -r .tag_name -} - -# Update & install OS base dependencies -buildDeps="base-devel freetype2 oniguruma wget mesa file zsync appstream xorg-server-xvfb patchelf binutils strace git jq" -ghosttyDeps="gtk4 libadwaita gtk4-layer-shell" -rm -rf "/usr/share/libalpm/hooks/package-cleanup.hook" -pacman -Syuq --needed --noconfirm --noprogressbar ${buildDeps} ${ghosttyDeps} - -export ARCH="$(uname -m)" - -ZIG_VERSION="#ZIG_VERSION" -PANDOC_VERSION="$(get_latest_gh_release 'jgm/pandoc')" -MINISIGN_VERSION="$(get_latest_gh_release 'jedisct1/minisign')" -SHARUN_VERSION="$(get_latest_gh_release 'VHSgunzo/sharun')" -URUNTIME_VERSION="$(get_latest_gh_release 'VHSgunzo/uruntime')" - -GITHUB_BASE="https://github.com" -PANDOC_BASE="${GITHUB_BASE}/jgm/pandoc/releases/download/${PANDOC_VERSION}" -MINISIGN_URL="${GITHUB_BASE}/jedisct1/minisign/releases/download/${MINISIGN_VERSION}/minisign-${MINISIGN_VERSION}-linux.tar.gz" -URUNTIME_URL="${GITHUB_BASE}/VHSgunzo/uruntime/releases/download/${URUNTIME_VERSION}/uruntime-appimage-dwarfs-${ARCH}" -LLVM_BASE="${GITHUB_BASE}/pkgforge-dev/llvm-libs-debloated/releases/download/continuous" -ZIG_URL="https://ziglang.org/download/${ZIG_VERSION}/zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz" -SHARUN_URL="${GITHUB_BASE}/VHSgunzo/sharun/releases/download/${SHARUN_VERSION}/sharun-${ARCH}" -LD_PRELOAD_OPEN="${GITHUB_BASE}/fritzw/ld-preload-open.git" - -case "${ARCH}" in -"x86_64") - PANDOC_URL="${PANDOC_BASE}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz" - LLVM_URL="${LLVM_BASE}/llvm-libs-nano-x86_64.pkg.tar.zst" - LIBXML_URL="${LLVM_BASE}/libxml2-iculess-x86_64.pkg.tar.zst" - ;; -"aarch64") - PANDOC_URL="${PANDOC_BASE}/pandoc-${PANDOC_VERSION}-linux-arm64.tar.gz" - LLVM_URL="${LLVM_BASE}/llvm-libs-nano-aarch64.pkg.tar.xz" - LIBXML_URL="${LLVM_BASE}/libxml2-iculess-aarch64.pkg.tar.xz" - ;; -*) - echo "Unsupported ARCH: '${ARCH}'" - exit 1 - ;; -esac - -# Debloated llvm and libxml2 without libicudata -wget "${LLVM_URL}" -O /tmp/llvm-libs.pkg.tar.zst -wget "${LIBXML_URL}" -O /tmp/libxml2.pkg.tar.zst -pacman -U --noconfirm /tmp/llvm-libs.pkg.tar.zst /tmp/libxml2.pkg.tar.zst - -# Download & install other dependencies -# zig: https://ziglang.org -rm -rf /opt/zig* -unlink /usr/local/bin/zig || true -wget "${ZIG_URL}" -O /tmp/zig-linux.tar.xz -tar -xJf /tmp/zig-linux.tar.xz -C /opt -ln -s "/opt/zig-linux-${ARCH}-${ZIG_VERSION}/zig" /usr/local/bin/zig - -# uruntime: https://github.com/VHSgunzo/uruntime -rm -rf /usr/local/bin/uruntime -wget "${URUNTIME_URL}" -O /tmp/uruntime -chmod +x /tmp/uruntime -mv /tmp/uruntime /usr/local/bin/uruntime - -# minisign: https://github.com/jedisct1/minisign -rm -rf /usr/local/bin/minisign -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: https://github.com/VHSgunzo/sharun -rm -rf /usr/local/bin/sharun -wget "${SHARUN_URL}" -O /usr/local/bin/sharun -chmod +x /usr/local/bin/sharun - -# ld-preload-open: https://github.com/fritzw/ld-preload-open -rm -rf /opt/path-mapping.so -git clone "${LD_PRELOAD_OPEN}" -( - cd ld-preload-open - make all - mv ./path-mapping.so ../ -) -rm -rf ld-preload-open -mv ./path-mapping.so /opt/path-mapping.so - -# Cleanup -pacman -Scc --noconfirm - -rm -rf \ - /tmp/appimagetool.AppImage \ - /tmp/minisign-linux* \ - /tmp/zig-linux.tar.xz \ - /tmp/pandoc* \ - /tmp/llvm-libs.pkg.tar.zst \ - /tmp/libxml2.pkg.tar.zst