Skip to content

Commit 8c42134

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

File tree

2 files changed

+42
-16
lines changed

2 files changed

+42
-16
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: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
set -e
44

5+
preload_lib() {
6+
[ -f "$1" ] && [ -d "$2" ] && mv "$1" "$2"
7+
}
8+
59
export ARCH="$(uname -m)"
610
export APPIMAGE_EXTRACT_AND_RUN=1
711

@@ -15,7 +19,7 @@ DESKTOP_FILE="${PWD}/assets/ghostty.desktop"
1519
LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
1620
BUILD_ARGS="
1721
--summary all \
18-
--prefix ${APP_DIR}/usr \
22+
--prefix ${APP_DIR} \
1923
-Doptimize=ReleaseFast \
2024
-Dcpu=baseline \
2125
-Dpie=true \
@@ -26,7 +30,7 @@ BUILD_ARGS="
2630

2731
rm -rf "${TMP_DIR}"
2832

29-
mkdir -p -- "${TMP_DIR}" "${APP_DIR}/usr" "${APP_DIR}/usr/lib" "${APP_DIR}/usr/share/metainfo"
33+
mkdir -p -- "${TMP_DIR}" "${APP_DIR}/share/metainfo" "${APP_DIR}/shared/preload"
3034

3135
cd "${TMP_DIR}"
3236

@@ -60,23 +64,26 @@ zig build ${BUILD_ARGS}
6064

6165
cd "${APP_DIR}"
6266

63-
cp "${APPDATA_FILE}" "usr/share/metainfo/com.mitchellh.ghostty.appdata.xml"
64-
cp "${DESKTOP_FILE}" "usr/share/applications/com.mitchellh.ghostty.desktop"
67+
cp "${APPDATA_FILE}" "share/metainfo/com.mitchellh.ghostty.appdata.xml"
68+
cp "${DESKTOP_FILE}" "share/applications/com.mitchellh.ghostty.desktop"
6569

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" .
70+
ln -s "com.mitchellh.ghostty.desktop" "share/applications/ghostty.desktop"
71+
ln -s "share/applications/com.mitchellh.ghostty.desktop" .
72+
ln -s "share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png" .
6973

7074
# bundle all libs
7175
wget "$LIB4BN" -O ./lib4bin
7276
chmod +x ./lib4bin
73-
xvfb-run -a -- ./lib4bin -p -v -e -s -k ./usr/bin/ghostty /usr/lib/libEGL*
74-
rm -rf ./usr/bin
77+
xvfb-run -a -- ./lib4bin -p -v -e -s -k ./bin/ghostty /usr/lib/libEGL*
7578

7679
# Prepare AppImage -- Configure launcher script, metainfo and desktop file with icon.
77-
echo 'GHOSTTY_RESOURCES_DIR=${SHARUN_DIR}/usr/share/ghostty' >>./.env
80+
echo 'GHOSTTY_RESOURCES_DIR=${SHARUN_DIR}/share/ghostty' >>./.env
7881
echo 'unset ARGV0' >>./.env
7982

83+
preload_lib "shared/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so" "shared/preload"
84+
85+
[ -d 'shared/lib/gdk-pixbuf-2.0' ] && rm -rf shared/lib/gdk-pixbuf-2.0
86+
8087
ln -s ./bin/ghostty ./AppRun
8188
./sharun -g
8289

0 commit comments

Comments
 (0)