Skip to content

Commit 272884e

Browse files
committed
Fix: Bundle Pango for SVGs and Enable Debug Logs
1. Added libpango, libharfbuzz, and libthai to the bundle to ensure SVGs with text/complex rendering can load. 2. Enabled G_MESSAGES_DEBUG=all to expose why the theme toggle is failing silently. 3. Added diagnostic check for the 'color-scheme' schema key.
1 parent e4ae6ac commit 272884e

1 file changed

Lines changed: 41 additions & 20 deletions

File tree

build_appimage.sh

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ mkdir -p AppDir/usr/lib/girepository-1.0
4646
if [ -d "/usr/lib/x86_64-linux-gnu/girepository-1.0" ]; then cp -r /usr/lib/x86_64-linux-gnu/girepository-1.0/* AppDir/usr/lib/girepository-1.0/; fi
4747

4848
# --- FIX 1: AVATARS (TOOLS) ---
49-
# We keep this because diagnostics confirmed it works!
5049
echo "🖼️ Bundling Image Loader Tools..."
5150
LOADER_DIR=AppDir/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders
5251
mkdir -p $LOADER_DIR
@@ -60,7 +59,6 @@ mkdir -p AppDir/usr/share/icons
6059
cp -r /usr/share/icons/Adwaita AppDir/usr/share/icons/
6160
cp -r /usr/share/icons/hicolor AppDir/usr/share/icons/
6261

63-
# Bundle GTK 4.0 Stylesheets (Kept this, it fixed the gray buttons)
6462
echo "🎨 Bundling GTK 4 Resources..."
6563
mkdir -p AppDir/usr/share/gtk-4.0
6664
if [ -d "/usr/share/gtk-4.0" ]; then
@@ -106,25 +104,35 @@ export XDG_CONFIG_DIRS="$APPDIR/usr/etc:$XDG_CONFIG_DIRS"
106104
export GTK_DATA_PREFIX="$APPDIR/usr"
107105
export GTK_PATH="$APPDIR/usr/lib/gtk-4.0"
108106
109-
# 2. THEME FIX (KEYFILE BACKEND)
110-
# Switch from 'memory' (broken/amnesia) to 'keyfile' (robust/persistent)
111-
export GSETTINGS_BACKEND=keyfile
107+
# 2. DEBUG MODE (The Loud Fix)
108+
export G_MESSAGES_DEBUG=all
109+
export GTK_DEBUG=0
112110
113-
# 3. SETUP KEYFILE STORAGE
114-
# We direct config to a temporary folder or user config to ensure write access
115-
# Using /tmp ensures we don't pollute the host system for now
111+
# 3. SETTINGS BACKEND (KEYFILE)
112+
export GSETTINGS_BACKEND=keyfile
116113
export XDG_CONFIG_HOME="/tmp/flipstack_config_$$"
117114
mkdir -p "$XDG_CONFIG_HOME/glib-2.0/settings"
118115
119-
# 4. PORTAL & INPUT SETTINGS
116+
# 4. PORTAL & INPUT
120117
export ADW_DISABLE_PORTAL=1
121118
export GTK_IM_MODULE=gtk-im-context-simple
122119
123-
# 5. RUNTIME CACHE (Avatars)
120+
# 5. RUNTIME CACHE
124121
export GDK_PIXBUF_MODULEDIR="$APPDIR/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders"
125122
export GDK_PIXBUF_MODULE_FILE="/tmp/flipstack_loaders_$$.cache"
126123
"$APPDIR/usr/bin/gdk-pixbuf-query-loaders" "$GDK_PIXBUF_MODULEDIR"/*.so > "$GDK_PIXBUF_MODULE_FILE" 2>/dev/null
127124
125+
# --- DIAGNOSTICS START ---
126+
echo "--- DEBUG PROBE ---"
127+
echo "Checking for 'color-scheme' key in schemas..."
128+
if grep -q "color-scheme" "$GSETTINGS_SCHEMA_DIR/gschemas.compiled"; then
129+
echo "✅ 'color-scheme' key found in compiled schemas."
130+
else
131+
echo "❌ CRITICAL: 'color-scheme' key MISSING in compiled schemas."
132+
fi
133+
echo "--- END PROBE ---"
134+
# --- DIAGNOSTICS END ---
135+
128136
# 6. LAUNCH
129137
exec "$APPDIR/usr/bin/python3" -m main "$@"
130138
EOF
@@ -137,21 +145,34 @@ chmod +x AppDir/AppRun
137145
echo "📦 Phase 3: Packing..."
138146

139147
export DEPLOY_GTK_VERSION=4
140-
LIBADWAITA_PATH=$(find /usr/lib/x86_64-linux-gnu -name "libadwaita-1.so.0" | head -n 1)
141-
LIBRSVG_PATH=$(find /usr/lib/x86_64-linux-gnu -name "librsvg-2.so.2" | head -n 1)
142-
SVG_LOADER_PATH=$(find /usr/lib/x86_64-linux-gnu -name "libpixbufloader-svg.so" | head -n 1)
143-
LIBXML2_PATH=$(find /usr/lib/x86_64-linux-gnu -name "libxml2.so.2" | head -n 1)
144-
LIBCAIRO_PATH=$(find /usr/lib/x86_64-linux-gnu -name "libcairo.so.2" | head -n 1)
148+
# Helper to find libs
149+
find_lib() { find /usr/lib/x86_64-linux-gnu -name "$1" | head -n 1; }
150+
151+
LIBADWAITA=$(find_lib "libadwaita-1.so.0")
152+
LIBRSVG=$(find_lib "librsvg-2.so.2")
153+
SVG_LOADER=$(find_lib "libpixbufloader-svg.so")
154+
LIBXML2=$(find_lib "libxml2.so.2")
155+
LIBCAIRO=$(find_lib "libcairo.so.2")
156+
157+
# SVG TEXT RENDERING DEPENDENCIES (New additions)
158+
LIBPANGO=$(find_lib "libpango-1.0.so.0")
159+
LIBPANGOCAIRO=$(find_lib "libpangocairo-1.0.so.0")
160+
LIBHARFBUZZ=$(find_lib "libharfbuzz.so.0")
161+
LIBTHAI=$(find_lib "libthai.so.0")
145162

146163
linuxdeploy \
147164
--appdir AppDir \
148165
--plugin gtk \
149166
--executable AppDir/usr/bin/python3 \
150-
--library "$LIBADWAITA_PATH" \
151-
--library "$LIBRSVG_PATH" \
152-
--library "$SVG_LOADER_PATH" \
153-
--library "$LIBXML2_PATH" \
154-
--library "$LIBCAIRO_PATH" \
167+
--library "$LIBADWAITA" \
168+
--library "$LIBRSVG" \
169+
--library "$SVG_LOADER" \
170+
--library "$LIBXML2" \
171+
--library "$LIBCAIRO" \
172+
--library "$LIBPANGO" \
173+
--library "$LIBPANGOCAIRO" \
174+
--library "$LIBHARFBUZZ" \
175+
--library "$LIBTHAI" \
155176
--icon-file assets/icons/io.github.dagaza.FlipStack.svg \
156177
--desktop-file io.github.dagaza.FlipStack.desktop \
157178
--output appimage

0 commit comments

Comments
 (0)