22
33set -e
44
5+ libpixbuf_config () {
6+ git clone https://github.com/fritzw/ld-preload-open.git
7+ (
8+ cd ld-preload-open
9+ make all
10+ mv ./path-mapping.so ../
11+ )
12+ rm -rf ld-preload-open
13+ mv ./path-mapping.so ./shared/lib
14+ mv ./shared/lib/gdk-pixbuf-2.0 ./
15+ cp -rv gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so ./shared/lib
16+ echo ' path-mapping.so' > ./.preload
17+ echo ' PATH_MAPPING=/usr/lib/gdk-pixbuf-2.0:${SHARUN_DIR}/gdk-pixbuf-2.0' >> ./.env
18+ }
19+
520export ARCH=" $( uname -m) "
621export APPIMAGE_EXTRACT_AND_RUN=1
722
@@ -15,7 +30,7 @@ DESKTOP_FILE="${PWD}/assets/ghostty.desktop"
1530LIB4BN=" https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
1631BUILD_ARGS="
1732 --summary all \
18- --prefix ${APP_DIR} /usr \
33+ --prefix ${APP_DIR} \
1934 -Doptimize=ReleaseFast \
2035 -Dcpu=baseline \
2136 -Dpie=true \
@@ -26,7 +41,7 @@ BUILD_ARGS="
2641
2742rm -rf " ${TMP_DIR} "
2843
29- mkdir -p -- " ${TMP_DIR} " " ${APP_DIR} /usr " " ${APP_DIR} /usr/lib " " ${APP_DIR} /usr/share/metainfo "
44+ mkdir -p -- " ${TMP_DIR} " " ${APP_DIR} /share/metainfo " " ${APP_DIR} /shared/lib "
3045
3146cd " ${TMP_DIR} "
3247
@@ -58,23 +73,26 @@ cd "${TMP_DIR}/${BUILD_DIR}"
5873# Build Ghostty with zig
5974zig build ${BUILD_ARGS}
6075
76+ # Prepare AppImage -- Configure launcher script, metainfo and desktop file with icon.
6177cd " ${APP_DIR} "
6278
63- cp " ${APPDATA_FILE} " " usr/ share/metainfo/com.mitchellh.ghostty.appdata.xml"
64- cp " ${DESKTOP_FILE} " " usr/ share/applications/com.mitchellh.ghostty.desktop"
79+ cp " ${APPDATA_FILE} " " share/metainfo/com.mitchellh.ghostty.appdata.xml"
80+ cp " ${DESKTOP_FILE} " " share/applications/com.mitchellh.ghostty.desktop"
6581
66- ln -s " com.mitchellh.ghostty.desktop" " usr/ share/applications/ghostty.desktop"
67- ln -s " usr/ share/applications/com.mitchellh.ghostty.desktop" .
68- ln -s " usr/ share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png" .
82+ ln -s " com.mitchellh.ghostty.desktop" " share/applications/ghostty.desktop"
83+ ln -s " share/applications/com.mitchellh.ghostty.desktop" .
84+ ln -s " share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png" .
6985
7086# bundle all libs
7187wget " $LIB4BN " -O ./lib4bin
7288chmod +x ./lib4bin
73- xvfb-run -a -- ./lib4bin -p -v -e -s -k ./usr/bin/ghostty /usr/lib/libEGL*
74- rm -rf ./usr/bin
89+ xvfb-run -a -- ./lib4bin -p -v -e -s -k ./bin/ghostty /usr/lib/libEGL*
7590
76- # Prepare AppImage -- Configure launcher script, metainfo and desktop file with icon.
77- echo ' GHOSTTY_RESOURCES_DIR=${SHARUN_DIR}/usr/share/ghostty' >> ./.env
91+ # preload libpixbufloader /w ld-preload-open as svg icons breaks
92+ # either on ghostty tab bar or gnome-text-editor while config edit or both :(
93+ libpixbuf_config
94+
95+ echo ' GHOSTTY_RESOURCES_DIR=${SHARUN_DIR}/share/ghostty' >> ./.env
7896echo ' unset ARGV0' >> ./.env
7997
8098ln -s ./bin/ghostty ./AppRun
0 commit comments