22
33set -eux
44
5- export ARCH=" $( uname -m) "
6- export APPIMAGE_EXTRACT_AND_RUN=1
7-
5+ ARCH=" $( uname -m) "
86GHOSTTY_VERSION=" $( cat VERSION) "
97TMP_DIR=" /tmp/ghostty-build"
108APP_DIR=" ${TMP_DIR} /ghostty.AppDir"
119PUB_KEY=" RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV"
12- UPINFO=" gh-releases-zsync|$( echo " ${GITHUB_REPOSITORY:- no-user / no-repo } " | tr ' /' ' |' ) |latest|*$ARCH .AppImage.zsync"
10+ UPINFO=" gh-releases-zsync|$( echo " ${GITHUB_REPOSITORY} " | tr ' /' ' |' ) |latest|Ghostty- *$ARCH .AppImage.zsync"
1311APPDATA_FILE=" ${PWD} /assets/ghostty.appdata.xml"
1412DESKTOP_FILE=" ${PWD} /assets/ghostty.desktop"
1513LIBS2BUNDLE=" ./bin/ghostty /usr/lib/libEGL*"
@@ -29,18 +27,18 @@ mkdir -p -- "${TMP_DIR}" "${APP_DIR}/share/metainfo" "${APP_DIR}/shared/lib"
2927
3028cd " ${TMP_DIR} "
3129
32- if [ $ GHOSTTY_VERSION = = " tip" ]; then
33- wget " https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz" -O ghostty-${GHOSTTY_VERSION} .tar.gz
34- wget " https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz.minisig" -O ghostty-${GHOSTTY_VERSION} .tar.gz.minisig
35- GHOSTTY_VERSION=" $( tar -tf ghostty-${GHOSTTY_VERSION} .tar.gz --wildcards " *zig.zon.txt" | awk -F' [-/]' ' {print $2"-"$3}' ) "
36- mv ghostty-tip.tar.gz ghostty-${GHOSTTY_VERSION} .tar.gz
37- mv ghostty-tip.tar.gz.minisig ghostty-${GHOSTTY_VERSION} .tar.gz.minisig
30+ if [ " ${ GHOSTTY_VERSION} " = " tip" ]; then
31+ wget " https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz" -O " ghostty-${GHOSTTY_VERSION} .tar.gz"
32+ wget " https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz.minisig" -O " ghostty-${GHOSTTY_VERSION} .tar.gz.minisig"
33+ GHOSTTY_VERSION=" $( tar -tf " ghostty-${GHOSTTY_VERSION} .tar.gz" --wildcards " *zig.zon.txt" | awk -F' [-/]' ' {print $2"-"$3}' ) "
34+ mv ghostty-tip.tar.gz " ghostty-${GHOSTTY_VERSION} .tar.gz"
35+ mv ghostty-tip.tar.gz.minisig " ghostty-${GHOSTTY_VERSION} .tar.gz.minisig"
3836else
3937 wget " https://release.files.ghostty.org/${GHOSTTY_VERSION} /ghostty-${GHOSTTY_VERSION} .tar.gz"
4038 wget " https://release.files.ghostty.org/${GHOSTTY_VERSION} /ghostty-${GHOSTTY_VERSION} .tar.gz.minisig"
4139fi
4240
43- if [ $ GLFW = = true ]; then
41+ if [ " ${ GLFW} " = true ]; then
4442 BUILD_ARGS=" ${BUILD_ARGS} -Dapp-runtime=glfw"
4543else
4644 LIBS2BUNDLE=" ${LIBS2BUNDLE} /usr/lib/gdk-pixbuf-*/*/*/*"
@@ -83,7 +81,7 @@ xvfb-run -a -- sharun l -p -v -e -s -k ${LIBS2BUNDLE}
8381
8482# preload libpixbufloader /w ld-preload-open as svg icons breaks
8583# either on ghostty tab bar or gnome-text-editor while config edit or both :(
86- if [ $ GLFW = = false ]; then
84+ if [ " ${ GLFW} " = false ]; then
8785 mv ./shared/lib/gdk-pixbuf-2.0 ./
8886 cp -rv /opt/path-mapping.so ./shared/lib/
8987 cp -rv gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so ./shared/lib/
@@ -98,23 +96,24 @@ echo 'unset ARGV0' >>./.env
9896ln -s ./bin/ghostty ./AppRun
9997./sharun -g
10098
101- export VERSION=" $( ./AppRun --version | awk ' FNR==1 {print $2}' ) "
102- if [ -z " $VERSION " ]; then
99+ VERSION=" $( ./AppRun --version | awk ' FNR==1 {print $2}' ) "
100+ if [ -z " ${ VERSION} " ]; then
103101 echo " ERROR: Could not get version from ghostty binary"
104102 exit 1
105103fi
106104
107105GHOSTTY_APPIMAGE=" Ghostty-${VERSION} -${ARCH} .AppImage"
108106
109- if [ $GLFW == true ]; then
110- GHOSTTY_APPIMAGE=" Ghostty-Glfw-${VERSION} -${ARCH} .AppImage"
107+ if [ " ${GLFW} " = true ]; then
108+ UPINFO=" gh-releases-zsync|$( echo " ${GITHUB_REPOSITORY:- no-user/ no-repo} " | tr ' /' ' |' ) |latest|Ghossty_*$ARCH .AppImage.zsync"
109+ GHOSTTY_APPIMAGE=" Ghostty_Glfw-${VERSION} -${ARCH} .AppImage"
111110fi
112111
113112cd " ${TMP_DIR} "
114113
115114# create app image
116- cp $( command -v uruntime) ./uruntime
117- cp $( command -v uruntime-lite) ./uruntime-lite
115+ cp " $( command -v uruntime) " ./uruntime
116+ cp " $( command -v uruntime-lite) " ./uruntime-lite
118117
119118# persist mount for faster launch times
120119sed -i ' s|URUNTIME_MOUNT=[0-9]|URUNTIME_MOUNT=0|' ./uruntime-lite
@@ -131,4 +130,4 @@ echo "Generating AppImage"
131130 -o " ${GHOSTTY_APPIMAGE} "
132131
133132echo " Generating Zsync file"
134- zsyncmake * .AppImage -u * .AppImage
133+ zsyncmake ./ * .AppImage -u ./ * .AppImage
0 commit comments