From c2d0e7860c6a17fe71e81a3ada5c740513c2666b Mon Sep 17 00:00:00 2001 From: deepend Date: Thu, 19 Feb 2026 14:10:52 -0700 Subject: [PATCH] Updated osx/makebundle.sh to gracefully handle staged macOS dependency trees that omit GTK runtime module files by removing the corresponding entries from zoitechat.bundle before invoking gtk-mac-bundler. This prevents the exact Cannot find source to copy .../immodules/*.so class of failure you hit in CI. Kept the existing .so/.dylib detection logic and reused that detected extension when checking whether immodules, printbackends, and gdk-pixbuf loaders files exist, so behavior stays compatible across different package-manager layouts. --- osx/makebundle.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/osx/makebundle.sh b/osx/makebundle.sh index 239a31a7..7b775713 100755 --- a/osx/makebundle.sh +++ b/osx/makebundle.sh @@ -98,6 +98,19 @@ else perl -0pi -e 's|(/immodules/)\*\.dylib|$1*.so|g; s|(/printbackends/)\*\.dylib|$1*.so|g; s|(/loaders/)\*\.dylib|$1*.so|g' "$BUNDLE_DEF" fi +# Some staged builds omit GTK runtime module directories entirely +# (for example stripped-down CI artifacts). Remove bundle entries for +# missing globs so gtk-mac-bundler does not abort. +if ! find "$BUNDLE_PREFIX/lib/gtk-3.0" -type f -path "*/immodules/*.${GTK_MODULE_EXT}" -print -quit 2>/dev/null | grep -q .; then + perl -0pi -e 's|\n\s*\s*\$\{prefix\}/lib/\$\{gtkdir\}/\$\{pkg:\$\{gtk\}:gtk_binary_version\}/immodules/\*\.(?:so|dylib)\s*\n|\n|g' "$BUNDLE_DEF" +fi +if ! find "$BUNDLE_PREFIX/lib/gtk-3.0" -type f -path "*/printbackends/*.${GTK_MODULE_EXT}" -print -quit 2>/dev/null | grep -q .; then + perl -0pi -e 's|\n\s*\s*\$\{prefix\}/lib/\$\{gtkdir\}/\$\{pkg:\$\{gtk\}:gtk_binary_version\}/printbackends/\*\.(?:so|dylib)\s*\n|\n|g' "$BUNDLE_DEF" +fi +if ! find "$BUNDLE_PREFIX/lib/gdk-pixbuf-2.0" -type f -path "*/loaders/*.${GTK_MODULE_EXT}" -print -quit 2>/dev/null | grep -q .; then + perl -0pi -e 's|\n\s*\s*\$\{prefix\}/lib/gdk-pixbuf-2\.0/\$\{pkg:gdk-pixbuf-2\.0:gdk_pixbuf_binary_version\}/loaders/\*\.(?:so|dylib)\s*\n|\n|g' "$BUNDLE_DEF" +fi + # Keep Info.plist generation deterministic by always rendering from template # using a single, explicit version source.