Skip to content

Commit 02218bf

Browse files
author
psadi
committed
fix: preload libpixbufloader for svg icon render
fixes #36
1 parent 7d8952b commit 02218bf

File tree

2 files changed

+54
-17
lines changed

2 files changed

+54
-17
lines changed

.github/workflows/ci.yaml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Ghostty AppImage
1+
name: Build
22
on:
33
schedule:
44
- cron: "0 0 * * *"
@@ -14,7 +14,7 @@ jobs:
1414
actions: read
1515
security-events: write
1616
contents: write
17-
name: Build Ghostty (${{ matrix.arch }})
17+
name: 👻 Build Ghostty (${{ matrix.arch }})
1818
runs-on: ${{ matrix.runs-on }}
1919
strategy:
2020
matrix:
@@ -63,17 +63,36 @@ jobs:
6363
retention-days: 7
6464
path: /tmp/ghostty-build/Ghostty-*-${{ matrix.arch }}.AppImage*
6565

66-
- name: Ghostty stable release
66+
release_appimage:
67+
name: 👻 Release Ghostty AppImage
68+
needs:
69+
- build_appimage
70+
permissions:
71+
actions: read
72+
security-events: write
73+
contents: write
74+
runs-on: ubuntu-latest
75+
if: ${{ github.event_name == 'release' || github.event_name == 'schedule' }}
76+
steps:
77+
- uses: actions/download-artifact@v4
78+
with:
79+
name: ghostty-appimage-aarch64
80+
81+
- uses: actions/download-artifact@v4
82+
with:
83+
name: ghostty-appimage-x86_64
84+
85+
- name: Ghostty stable
6786
if: ${{ github.event_name == 'release' }}
6887
uses: svenstaro/upload-release-action@v2
6988
with:
7089
repo_token: ${{ secrets.GITHUB_TOKEN }}
71-
file: /tmp/ghostty-build/Ghostty-*-${{ matrix.arch }}.AppImage*
90+
file: "*.AppImage*"
7291
tag: ${{ github.ref }}
7392
overwrite: true
7493
file_glob: true
7594

76-
- name: Ghostty Tip ("Nightly") release
95+
- name: Ghostty Tip ("Nightly")
7796
uses: marvinpinto/action-automatic-releases@v1.2.1
7897
if: ${{ github.event_name == 'schedule' }}
7998
with:
@@ -82,5 +101,5 @@ jobs:
82101
prerelease: true
83102
draft: false
84103
files: |
85-
/tmp/ghostty-build/Ghostty-*-${{ matrix.arch }}.AppImage*
104+
*.AppImage*
86105
repo_token: ${{ secrets.GITHUB_TOKEN }}

build.sh

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
set -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+
520
export ARCH="$(uname -m)"
621
export APPIMAGE_EXTRACT_AND_RUN=1
722

@@ -15,7 +30,7 @@ DESKTOP_FILE="${PWD}/assets/ghostty.desktop"
1530
LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
1631
BUILD_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

2742
rm -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

3146
cd "${TMP_DIR}"
3247

@@ -58,23 +73,26 @@ cd "${TMP_DIR}/${BUILD_DIR}"
5873
# Build Ghostty with zig
5974
zig build ${BUILD_ARGS}
6075

76+
# Prepare AppImage -- Configure launcher script, metainfo and desktop file with icon.
6177
cd "${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
7187
wget "$LIB4BN" -O ./lib4bin
7288
chmod +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
7896
echo 'unset ARGV0' >>./.env
7997

8098
ln -s ./bin/ghostty ./AppRun

0 commit comments

Comments
 (0)