diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fa8c521..ffee722 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -74,7 +74,7 @@ jobs: with: name: ghostty-appimage-${{ matrix.arch }} retention-days: 7 - path: /tmp/ghostty-build/Ghostty*-${{ matrix.arch }}.AppImage* + path: dist tag: name: "👻 Tip Tag" diff --git a/.gitignore b/.gitignore index a760406..0ec533f 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,9 @@ Sessionx.vim tags # Persistent undo [._]*.un~ + +AppDir +ghostty-* +quick-sharun +uruntime2appimage +dist 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/build.sh b/build.sh index 26208c3..8a7f383 100755 --- a/build.sh +++ b/build.sh @@ -4,16 +4,16 @@ set -eux ARCH="$(uname -m)" 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}" | tr '/' '|')|latest|Ghostty-*$ARCH.AppImage.zsync" -APPDATA_FILE="${PWD}/assets/ghostty.appdata.xml" -DESKTOP_FILE="${PWD}/assets/ghostty.desktop" -LIBS2BUNDLE="./bin/ghostty /usr/lib/libEGL* /usr/lib/gdk-pixbuf-*/*/*/*" + +export ADD_HOOKS="self-updater.bg.hook" +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 + BUILD_ARGS=" --summary all \ - --prefix ${APP_DIR} \ -Doptimize=ReleaseFast \ -Dcpu=baseline \ -Dpie=true \ @@ -21,12 +21,6 @@ BUILD_ARGS=" -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" @@ -45,11 +39,8 @@ 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 @@ -57,64 +48,17 @@ if [ -f './nix/build-support/fetch-zig-cache.sh' ]; then 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 ${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/ - -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 - -VERSION="$(./AppRun --version | awk 'FNR==1 {print $2}')" -if [ -z "${VERSION}" ]; then - echo "ERROR: Could not get version from ghostty binary" - exit 1 -fi - -GHOSTTY_APPIMAGE="Ghostty-${VERSION}-${ARCH}.AppImage" - -cd "${TMP_DIR}" - -# create app image -cp "$(command -v uruntime)" ./uruntime -cp "$(command -v uruntime-lite)" ./uruntime-lite - -# persist mount for faster launch times -sed -i 's|URUNTIME_MOUNT=[0-9]|URUNTIME_MOUNT=0|' ./uruntime-lite +( + cd "ghostty-${GHOSTTY_VERSION}" + zig build ${BUILD_ARGS} +) -# update info -./uruntime-lite --appimage-addupdinfo "${UPINFO}" +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" -echo "Generating AppImage" -./uruntime --appimage-mkdwarfs -f \ - --set-owner 0 --set-group 0 \ - --no-history --no-create-timestamp \ - --compression zstd:level=22 -S26 -B8 \ - --header uruntime-lite -i "${APP_DIR}" \ - -o "${GHOSTTY_APPIMAGE}" +./quick-sharun ./ghostty-${GHOSTTY_VERSION}/zig-out/bin/ghostty +./uruntime2appimage -echo "Generating Zsync file" -zsyncmake ./*.AppImage -u ./*.AppImage +mkdir -p ./dist +mv -v ./*.AppImage* ./dist diff --git a/setup.sh b/setup.sh index ce2313f..a5b19ae 100755 --- a/setup.sh +++ b/setup.sh @@ -19,31 +19,24 @@ ARCH="$(uname -m)" ZIG_VERSION="${ZIG_VERSION:-0.13.0}" 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}" -URUNTIME_LITE_URL="${GITHUB_BASE}/VHSgunzo/uruntime/releases/download/${URUNTIME_VERSION}/uruntime-appimage-dwarfs-lite-${ARCH}" -LLVM_BASE="${GITHUB_BASE}/pkgforge-dev/llvm-libs-debloated/releases/download/continuous" + +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_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" + +DEBLOATED_PKGS="${GH_USER_CONTENT}/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/get-debloated-pkgs.sh" +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" - LLVM_URL="${LLVM_BASE}/llvm-libs-nano-x86_64.pkg.tar.zst" - LIBXML_URL="${LLVM_BASE}/libxml2-iculess-x86_64.pkg.tar.zst" - MESA_URL="${LLVM_BASE}/mesa-mini-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" - MESA_URL="${LLVM_BASE}/mesa-mini-aarch64.pkg.tar.xz" ;; *) echo "Unsupported ARCH: '${ARCH}'" @@ -51,11 +44,10 @@ case "${ARCH}" in ;; 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 -wget "${MESA_URL}" -O /tmp/mesa-mini.pkg.tar.zst -pacman -U --noconfirm /tmp/*.pkg.tar.zst +# Install Debloated Pkgs +wget "${DEBLOATED_PKGS}" -O /tmp/get-debloated-pkgs.sh +chmod a+x /tmp/get-debloated-pkgs.sh +sh /tmp/get-debloated-pkgs.sh --add-opengl --prefer-nano gtk4-mini libxml2-mini # Download & install other dependencies # zig: https://ziglang.org @@ -65,17 +57,6 @@ 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 - -rm -rf /usr/local/bin/uruntime-lite -wget "${URUNTIME_LITE_URL}" -O /tmp/uruntime-lite -chmod +x /tmp/uruntime-lite -mv /tmp/uruntime-lite /usr/local/bin/uruntime-lite - # minisign: https://github.com/jedisct1/minisign rm -rf /usr/local/bin/minisign wget "${MINISIGN_URL}" -O /tmp/minisign-linux.tar.gz @@ -88,21 +69,13 @@ 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 +# Sharun +wget "${SHARUN}" -O quick-sharun +chmod +x quick-sharun + +# Sharun +wget "${URUNTIME}" -O uruntime2appimage +chmod +x uruntime2appimage # Cleanup pacman -Scc --noconfirm