22
33set -eux
44
5- export ARCH=" $( uname -m) "
6- export APPIMAGE_EXTRACT_AND_RUN=1
5+ ARCH=" $( uname -m) "
6+ export ARCH
7+
8+ APPIMAGE_EXTRACT_AND_RUN=1
9+ export APPIMAGE_EXTRACT_AND_RUN
710
811GHOSTTY_VERSION=" $( cat VERSION) "
912TMP_DIR=" /tmp/ghostty-build"
1013APP_DIR=" ${TMP_DIR} /ghostty.AppDir"
1114PUB_KEY=" RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV"
12- UPINFO=" gh-releases-zsync|$( echo " ${GITHUB_REPOSITORY:- no-user / no-repo } " | tr ' /' ' |' ) |latest|*$ARCH .AppImage.zsync"
15+ UPINFO=" gh-releases-zsync|$( echo " ${GITHUB_REPOSITORY} " | tr ' /' ' |' ) |latest|Ghostty- *$ARCH .AppImage.zsync"
1316APPDATA_FILE=" ${PWD} /assets/ghostty.appdata.xml"
1417DESKTOP_FILE=" ${PWD} /assets/ghostty.desktop"
1518LIBS2BUNDLE=" ./bin/ghostty /usr/lib/libEGL*"
@@ -29,18 +32,18 @@ mkdir -p -- "${TMP_DIR}" "${APP_DIR}/share/metainfo" "${APP_DIR}/shared/lib"
2932
3033cd " ${TMP_DIR} "
3134
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
35+ if [ " ${ GHOSTTY_VERSION} " = " tip" ]; then
36+ wget " https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz" -O " ghostty-${GHOSTTY_VERSION} .tar.gz"
37+ wget " https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz.minisig" -O " ghostty-${GHOSTTY_VERSION} .tar.gz.minisig"
38+ GHOSTTY_VERSION=" $( tar -tf " ghostty-${GHOSTTY_VERSION} .tar.gz" --wildcards " *zig.zon.txt" | awk -F' [-/]' ' {print $2"-"$3}' ) "
39+ mv ghostty-tip.tar.gz " ghostty-${GHOSTTY_VERSION} .tar.gz"
40+ mv ghostty-tip.tar.gz.minisig " ghostty-${GHOSTTY_VERSION} .tar.gz.minisig"
3841else
3942 wget " https://release.files.ghostty.org/${GHOSTTY_VERSION} /ghostty-${GHOSTTY_VERSION} .tar.gz"
4043 wget " https://release.files.ghostty.org/${GHOSTTY_VERSION} /ghostty-${GHOSTTY_VERSION} .tar.gz.minisig"
4144fi
4245
43- if [ $ GLFW = = true ]; then
46+ if [ " ${ GLFW} " = true ]; then
4447 BUILD_ARGS=" ${BUILD_ARGS} -Dapp-runtime=glfw"
4548else
4649 LIBS2BUNDLE=" ${LIBS2BUNDLE} /usr/lib/gdk-pixbuf-*/*/*/*"
@@ -83,7 +86,7 @@ xvfb-run -a -- sharun l -p -v -e -s -k ${LIBS2BUNDLE}
8386
8487# preload libpixbufloader /w ld-preload-open as svg icons breaks
8588# either on ghostty tab bar or gnome-text-editor while config edit or both :(
86- if [ $ GLFW = = false ]; then
89+ if [ " ${ GLFW} " = false ]; then
8790 mv ./shared/lib/gdk-pixbuf-2.0 ./
8891 cp -rv /opt/path-mapping.so ./shared/lib/
8992 cp -rv gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so ./shared/lib/
@@ -98,23 +101,25 @@ echo 'unset ARGV0' >>./.env
98101ln -s ./bin/ghostty ./AppRun
99102./sharun -g
100103
101- export VERSION=" $( ./AppRun --version | awk ' FNR==1 {print $2}' ) "
102- if [ -z " $VERSION " ]; then
104+ VERSION=" $( ./AppRun --version | awk ' FNR==1 {print $2}' ) "
105+ export VERSION
106+ if [ -z " ${VERSION} " ]; then
103107 echo " ERROR: Could not get version from ghostty binary"
104108 exit 1
105109fi
106110
107111GHOSTTY_APPIMAGE=" Ghostty-${VERSION} -${ARCH} .AppImage"
108112
109- if [ $GLFW == true ]; then
110- GHOSTTY_APPIMAGE=" Ghostty-Glfw-${VERSION} -${ARCH} .AppImage"
113+ if [ " ${GLFW} " = true ]; then
114+ UPINFO=" gh-releases-zsync|$( echo " ${GITHUB_REPOSITORY:- no-user/ no-repo} " | tr ' /' ' |' ) |latest|Ghossty_*$ARCH .AppImage.zsync"
115+ GHOSTTY_APPIMAGE=" Ghostty_Glfw-${VERSION} -${ARCH} .AppImage"
111116fi
112117
113118cd " ${TMP_DIR} "
114119
115120# create app image
116- cp $( command -v uruntime) ./uruntime
117- cp $( command -v uruntime-lite) ./uruntime-lite
121+ cp " $( command -v uruntime) " ./uruntime
122+ cp " $( command -v uruntime-lite) " ./uruntime-lite
118123
119124# persist mount for faster launch times
120125sed -i ' s|URUNTIME_MOUNT=[0-9]|URUNTIME_MOUNT=0|' ./uruntime-lite
@@ -131,4 +136,4 @@ echo "Generating AppImage"
131136 -o " ${GHOSTTY_APPIMAGE} "
132137
133138echo " Generating Zsync file"
134- zsyncmake * .AppImage -u * .AppImage
139+ zsyncmake ./ * .AppImage -u ./ * .AppImage
0 commit comments